• Welcome to Valhalla Legends Archive.

Information for newcomers

Started by Arta, October 22, 2004, 06:20 AM

Previous topic - Next topic


This thread is here to answer some of the most common questions and to provide links to resources you may find helpful.

First of all, bot development is not simple. If you use something that does most of the work for you, like CleanSlateBot (CSB), it can be made fairly easy, but this intro assumes you are doing it the proper way. Bot development can be a good starting project - and has been for many - but only if you're pretty determined. With that in mind, pick the from the following headings the one that seems most appropriate for you, and read on.

I am a new programmer with little or no networking experience:

Firstly: You will probably find this hard. You will need to do lots of reading. Most of the time, people here will be unwilling to help you, and may even be downright rude, if you do not attempt to answer your own questions before asking them. With that in mind, you should read and understand the following:

You need to learn about TCP/IP and networking.

You need to learn how to use these concepts in your language of choice (VB, C++, Java)

You will need to learn about binary, hexadecimal, and endian-ness.

You will need to learn how to copy chunks of data in your chosen language (For example, CopyMemory in VB, memcpy or pointers in C++)

You will need to know how to monitor network traffic, and how to find what you're looking for within a packet dump. A good tool for this is Ethereal. You can learn how to capture packets with Ethereal and how to filter the packets you capture. Tip: filter your capture by only viewing TCP/IP packets with a source or destination port number of 6112 ("tcp.port == 6112").

After you've done all these things, your first task is to get a packet capture the game you plan to emulate, logging on to Battle.net. In other words: Start a packet capture, fire up Starcraft (or whatever) log on, quit, and stop the capture. You should be able to view a log of everything the game sent and recieved during the logon. Use BnetDocs to find out what the packets mean, and what they contain. Learn to tell the difference between data packets and connection maintenance packets. Try to figure out what's going on. Make sure you can do this before you continue.

Now, you need to write something to recieve packets and display them, parse those packets, interpret them, and send replies. This may still seem duanting, but you should be much better prepared if you've completed all the steps above. At this point, you should also understand enough to be able to answer a lot of your own questions using Google.

I am an intermediate or advanced programmer:

Firstly, you should read the steps for beginners detailed above. If you find that one of them covers an area with which you are unfamiliar, you should complete that step.

When you've done that, you should write some basic framework you can build on - something to send and recieve data - it can be pretty basic. Send a Protocol Byte (0x01, probably) and a starting message (like SID_AUTH_INFO) and see what you get back. You'll need to write something to parse the messages you recieve and to put together responses. You can use BnetDocs to read documentation on message formats & data types which should give you some idea of the kind of code you'll need to write to accomplish this.

Resources for everyone:

Everyone should find these resources fairly useful at some point:

BnetDocs, for message documentation;
Spht's Battle.net Bot Development website contains a lot of useful material;
The Battle.net Bot Development Forum for discusson;
Ethereal is a fantastic packet capture utility;
MSDN should be your first port of call for any questions about Microsoft products (Windows API, VB, c#, etc).

This thread will be left open for people to reply with links to useful resources, but will be very heavily moderated - no questions here please. If your post gets deleted, please don't be offended!

Edit 20/05/2005: Fixed broken binary/hex links. Thanks Joe[x86]!


Battle.net Bot Development References

Forgot BNBDR ;) Although it may confuse new comers its a good refrence after you get up on your feet.

Edit: Spelling

[Spht edit: Fixed link.]
Quote from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?


Should always look at Google before coming.  I also really like vbForums they have everything, including C/C++ and .NET Framework Languages, not just Visual Basic.   As well as really smart people who are really quick and informational with there responses.  Post your non bnet related questions there or in the apropriate language forum, or both!  :)
There are only two kinds of people who are really fascinating: people who know absolutely everything, and people who know absolutely nothing.


Thank you Arta.

http://www.gametutorials.com provides great and easily understandable/comprehendable tutorials on C, C++, Winsock, Win32, DirextX, OpenGL, and example project tutorials.  They come in a form where you download the fully commented source code which guides you through statement by statement.



A friend of mine requested this program...it's a simple brood war login that keeps his list of accounts alive, but I included the source so I could post it here so any new comers could have a sample barebones connection to study and tinker with.