Valhalla Legends Forums Archive | Battle.net Bot Development | Starcraft Starting Positions/Colors/Races

AuthorMessageTime
aton
Hi!

does anyone know how starcraft calculates my starting position, my color and my race (if i am random).
perhaps what network packet transmits this information...


my theory is: its all generated using a pseudo-random number generator, and some byte(s) that are used to initialise this pseudo-random number generator are transmitted in some packet, once you join the game lobby.

i havent found those bytes yet though, and perhaps i am all wrong.

any help is appreciated!

greetings, aton
February 20, 2006, 7:07 PM
Ringo
Hm, i can help with the colors, thats about it.
In side the map mpq, you have a .chk file with all the map configeration and layout etc, if you do a ascii search for the "COLR" section about 75% into the file, you should see 12 bytes appending it, which should look like:
08 00 00 00 00 01 02 03 04 05 08 07
Section headers are a total of 8 bytes long, 1st dword being the section ID "COLR" and the 2nd being the lengh of the data after it (discluding the section header)
You can change a set players race color by changeing the desired byte in the data:
01 01 01 01 01 01 01 01
Would make all 8 playable players red.
I cant remember is this will work in non-UMS games or not tho.

Hope this helps

[EDIT]: i have some ideas for you :)
Start Location:
when the game has started, you could just read there first unit clicks and calc there start location from the map location the unit was clicked/moved to.
Players Race:
Again, you could just read the 1st unit that they build to link the peon type to the race of the player.
Then if one was doing a 4 pool, you could link them to being zerg when they prompt there drone to spawn a pool.

They are messy ideas, and would probly go pair shape in a team melee, but worth a try? :)
February 20, 2006, 7:22 PM
aton
i am looking for a way to tell while still being in the game lobby!!!

parsing the coordinates for starting positions has a disadvantage too, i dont know what number each starting position for an unknown map has, and not what coordinates. if i could get the number of the players starting position it would be much better.

the color thing: that just makes the actual colors for each player, but not the distribution, i.e. who gets which color.

February 20, 2006, 8:07 PM
Skywing
Yes, these are based off of a random seed that is sent while in the lobby.  I did some research into how to determine this information based on the seed but never finished writing a compatible implementation.

It should be fairly easy to determine which packet includes the seed by just logging all of the Storm udp messages sent/received.
February 20, 2006, 8:14 PM
aton
i did that a lot of times, but never actually found the seed. do you know what packet includes it? (i'd probably find the offset myself)

and do you have some notes of your research about the calculation of this stuff? i'd love to read a bit
February 20, 2006, 8:30 PM

Search