Valhalla Legends Forums Archive | Battle.net Bot Development | a type of bnet bot no one's mentioned (AFAIK)

AuthorMessageTime
MrMachineCode
You might remember from my other posting I'm looking to make a bnet bot that will connect my AI program to battlenet. AI is my forte; I have no experience with socket or network programming, and it is only because I work as a network administrator that I have a vague understanding of the discussions about packets and packet logging for the binary interface. (Because I work with network hardware, not network programming.) Furthermore, I'm just lazy, ok? I don't want to have to learn to work with packets when I'm still busy programming my AI.

I still need a way to connect my AI program to bnet, but I am not so brazen as to ask someone to give me that solution on a silver platter. But, wait, I already have that solution on a silver platter.

Why should I try to make a program to connect to the bnet binary interface, when blizzard has already made a dozen programs FOR me that do it?

I'm talking, of course, about the games themselves. For instance, I have Diablo 1, which is all I'm actually interested in connecting as anyway. WHY NOT USE THE DIABLO 1 EXE ITSELF AS MY AI'S CHAT CLIENT???

Madness you say? Not at all. Diablo has to call certain Windows functions to get it's user input from the keyboard and mouse, and it has to call other functions to display text. If I hack my keyboard and video drivers, load a wedge between the drivers and the diablo.exe that can send data from my AI to Diablo so that Diablo thinks it's coming from the keyboard, and can intercept Diablo sending chat text to the screen, I can use diablo.exe like a massive, bloated, clunky chat interface.

Windows provides a function called *system hooks* that lets you do things like this. It's how key-loggers work and how some drivers probably work.

For those of you who have some experience programming packet interfaces, hacking the keyboard and video drivers might well be more work than it's worth. On the other hand, I have some small experience doing stuff like this, and none at all with packet programming. I think that for me, it would be easier to make this bizarre contraption.

And don't forget there is one advantage--Blizzard could NEVER plug this hole without banning their own games!

Edit: Uh, that is to say, I have written video drivers and keyboard drivers for DOS games. Which is not quite the same thing as doing it for windows. Still, I'm sure I can do it.
October 24, 2003, 6:40 PM
K
[quote]And don't forget there is one advantage--Blizzard could NEVER plug this hole without banning their own games! [/quote]

Well, they already kinda have. Diablo I is restricted to public channels. If you only want to have your bot in public channels, why not just use the chat gateway? There are loads of examples on how to connect to it and parse it.
Plus you wouldn't have to deal with the bloated diablo interface ;)
October 24, 2003, 6:42 PM
MrMachineCode
Hrmmm.... I was under the impression that the telnet chat interface was 100%, totally banned from all bnet channels. When I tried TopazChat I couldn't join diablo 1 channels (or any others, for that matter), it said I was restricted. If it's only because Topaz chat is crap, and if I could get to diablo 1 channels with a telnet interface, that would be welcome news indeed.
October 24, 2003, 6:48 PM
K
The telnet interface can join open channels, like "public chat (x)", "open tech support", "blizzard chat (x)". Diablo I can join these channels plus Diablo I specific channels. If you want to get into Diablo I channels, then emulating / hooking Diablo would be the answer.

PS - What language is your AI program written in? I'm sure someone could provide you with a connection somehow, either with source code that you could merge or via a plugin interface.
October 24, 2003, 7:05 PM
Skywing
The idea of hijacking the game process or using the game through a proxy type program to connect to Battle.net isn't new. There are a number of very significant disadvantages to doing this:

1) Automatic reconnection is mostly unfeasible.
2) Many of the Blizzard game clients run a tight loop with no wait states while in the Battle.net chat screen. This impacts the performance of the rest of the system.
3) Many of the Blizzard game clients have a very large memory footprint, even when in the Battle.net chat screen.
4) At least two Battle.net-enabled Blizzard games are prone to crashing if left in a Battle.net chat channel.
5) At least two Battle.net-enabled Blizzard games contain authentication routines that make the use of a proxy type program that does not modify code in the game process unfeasible.
October 24, 2003, 7:58 PM
MrMachineCode
My AI is in C++. I am rewriting it from scratch, to incorporate new ideas and put it in a DLL, but that will also be in C++.

It's the Diablo USA-x channels and the Diablo <some clan> channels I want to be able to access, but maybe open tech support could be fun to put it in instead.

Good points, Skywing; since I have an old computer, the memory and speed issues would indeed be a problem. Furthermore, Diablo 1 does indeed crash in chat after a few hours, and this would be a bit of an annoyance as what I want to do is to be able to leave my AI in a channel for DAYS so that it will learn as much as possible.

OTOH, if I were to develop such a program as could hook the user interface like this, I can think of a lot of fun things I could do with something like that. If I had one that was general enough I'd be able to interface it to many different programs.
October 24, 2003, 8:57 PM
Kp
[quote author=MrMachineCode link=board=17;threadid=3229;start=0#msg25433 date=1067020823]
For those of you who have some experience programming packet interfaces, hacking the keyboard and video drivers might well be more work than it's worth. On the other hand, I have some small experience doing stuff like this, and none at all with packet programming. I think that for me, it would be easier to make this bizarre contraption.[/quote]Even in light of your admitted inexperience with the bnbinary interface, I think it'd be much easier for you to develop a separate binary client that emulates Diablo than to try to hack Diablo itself. The binary interface is IMO not that hard with a decent tutorial and some basic programming experience, and definitely outweighs the problems (as Skywing outlined).

[quote author=K link=board=17;threadid=3229;start=0#msg25438 date=1067022358]
The telnet interface can join open channels, like "public chat (x)", "open tech support", "blizzard chat (x)". Diablo I can join these channels plus Diablo I specific channels.[/quote]Minor correction: Diablo clients cannot enter "Public Chat *"or "Blizzard Chat *". They can enter Diablo *, the Diablo-related channels, Open Tech Support, and Blizzard Tech Support.
October 24, 2003, 9:33 PM
Tuberload
I think the idea of incorporating your AI into previously built bots that have plug-in support would be the best idea. You could just create a wrapper for your AI API that would allow for it to plug-in to any bot you would like.
October 24, 2003, 10:28 PM
Arta
I agree with Kp. You are obviously a competent programmer - learning to use sockets and coding a basic Battle.net client shouldn't pose a significant challenge, especially with things like BnetDocs to help you.

I like this AI idea - I'm willing to help if you need a hand. You can grab my MSN address from anyone who knows me or find me in channel if you wish.
October 25, 2003, 1:54 AM
-MichaeL-
hrmm.. why not just use CSB?
November 1, 2003, 7:52 PM
iago
Good luck writing a good ai in VB :P
November 1, 2003, 10:28 PM
Grok
[quote author=iago link=board=17;threadid=3229;start=0#msg26846 date=1067725733]
Good luck writing a good ai in VB :P
[/quote]

Why is that a problem? Or why can he not call his AI from VB?
November 1, 2003, 10:39 PM
iago
[quote author=Grok link=board=17;threadid=3229;start=0#msg26848 date=1067726373]
[quote author=iago link=board=17;threadid=3229;start=0#msg26846 date=1067725733]
Good luck writing a good ai in VB :P
[/quote]

Why is that a problem? Or why can he not call his AI from VB?
[/quote]

True, he could make a call to it.

But a lot of the concepts we've used in AI would be fairly difficult to port to vb.
November 1, 2003, 10:49 PM
Adron
[quote author=iago link=board=17;threadid=3229;start=0#msg26851 date=1067726952]
But a lot of the concepts we've used in AI would be fairly difficult to port to vb.
[/quote]

Such as?
November 2, 2003, 2:22 AM
-MichaeL-
This may be a little off topic but could you create a AI with VB?
November 2, 2003, 3:04 AM
iago
[quote author=Adron link=board=17;threadid=3229;start=0#msg26910 date=1067739750]
[quote author=iago link=board=17;threadid=3229;start=0#msg26851 date=1067726952]
But a lot of the concepts we've used in AI would be fairly difficult to port to vb.
[/quote]

Such as?
[/quote]

Decision trees, for one. A lot of ai that we did involved priority queues, decision trees, etc. And those are rather difficult to create in vb (as far as I know)
November 2, 2003, 3:08 AM

Search