• Welcome to Valhalla Legends Archive.
 

How difficult would it be to make a bot that does this...

Started by warz, April 21, 2006, 12:29 AM

Previous topic - Next topic

Ringo

Quote from: warz on April 25, 2006, 03:43 AM
Anyone know if this is even the correct function?
What function are you trying to find?
Im guessing you mean the function to check for missing packets, or function to buffer sent packets?
If so, what packet command? because all 3 work differntly, both ways.
If i was you, i would worry more about disassembling algorithm's for "everything", becuase almost everything has a algorithm in sc, thats how every client keeps in perfect sequance.
for example if i selected a marine, sc would send that command to all other players, then if i were to attack move that marine across the map, that would also get sent, but thats pritty much where it ends.
Everyones SC will know exacly what path that marine will take and exacly where it will come into contact with another unit, and exacly what unit will get the first hit, and exacly when a unit will "miss hit" due to differnt levels of terrains, and exacly when that unit will heal +1 life, and exacly when and what unit will die 1st.
Thats the same for peons gathering minerals, everyone will know exacly what X/Y a peon is every millisecond, and what mineral it will goto if the one it was going to is inuse, and exacly how long it will take it to get there, working out the total minerals of a player all the time.
Another example would be setting a rally point for a gateway at somones eles base, then build 5 zealots, 5 commands would be sent in the next beat. But them zealots could finish building, walk to that players base, kill all his units and buildings, and finaly eliminate them, with no more than the packets to say i set rally point and built 5 zealots being sent.
The closest iv been to being able to play agame of SC on-bot, is to build units and attack other players with them, but thats about it.
Things like path finding and stuff like that, have always been a no-go area, due to knowing nothing about disassembly at all, nore time or interest to work them out (other than defalt unit build times). :(

Would it not be easyer to just grab this infomation from SC its self and make a macro?

Physaro: You can get the defalt unit dammages and stuff, from campain editor, and use them settings, unless its UMS, then use the maps settings in teh scenario.chk in the Map file mpq.

warz

i'll get there everntually. you see, after reverse engineering certain functions ill know what theyre doing and then what to look for based on what that function does. i'll know why it was called, what it calls, etc. i understand this seems like a never ending project, and it might be hard to grasp that concept, but that's what i'm looking for.

why create another bot that just does the exact same thing as any other bot? besides, i like projects that are kind of like 'work at your own pace'. reverse a function here, reverse a function there.. take a break, come back do some more. maybe the actual finished product isn't my real goal. maybe i'm more interested in the reverse engineering aspect of this, which is why i actually enjoy staring at a debugger all day. i don't know, but it's not a big deal. progress will be made, and that's all.

Ringo

Quote from: warz on April 25, 2006, 02:53 PM
i'll get there everntually. you see, after reverse engineering certain functions ill know what theyre doing and then what to look for based on what that function does. i'll know why it was called, what it calls, etc. i understand this seems like a never ending project, and it might be hard to grasp that concept, but that's what i'm looking for.
But i dont think you have said what function it is your looking for :p

Quote from: warz on April 25, 2006, 02:53 PM
why create another bot that just does the exact same thing as any other bot? besides, i like projects that are kind of like 'work at your own pace'. reverse a function here, reverse a function there.. take a break, come back do some more. maybe the actual finished product isn't my real goal. maybe i'm more interested in the reverse engineering aspect of this, which is why i actually enjoy staring at a debugger all day. i don't know, but it's not a big deal. progress will be made, and that's all.
Hm, i think you missed my points, i was just pointing out "How difficult it would be to make a bot that does this...", not trying to talk you out of it in anyway :P

But in my opinion, I think your going about it a painfull way to start out :P
Anyway i got some logs if there any use, there logs of traffic from ALL directions between all players, like A<>B/A<>C/A<>D/B<>C/B<>D/C<>D (game room only)
Full Log
Command 0 Log
Command 1 Log
Command 2 Log

Best of luck anyway.

warz

Quote from: Ringo on April 25, 2006, 04:56 PM
Quote from: warz on April 25, 2006, 02:53 PM
i'll get there everntually. you see, after reverse engineering certain functions ill know what theyre doing and then what to look for based on what that function does. i'll know why it was called, what it calls, etc. i understand this seems like a never ending project, and it might be hard to grasp that concept, but that's what i'm looking for.
But i dont think you have said what function it is your looking for :p

Quote from: warz on April 25, 2006, 02:53 PM
why create another bot that just does the exact same thing as any other bot? besides, i like projects that are kind of like 'work at your own pace'. reverse a function here, reverse a function there.. take a break, come back do some more. maybe the actual finished product isn't my real goal. maybe i'm more interested in the reverse engineering aspect of this, which is why i actually enjoy staring at a debugger all day. i don't know, but it's not a big deal. progress will be made, and that's all.
Hm, i think you missed my points, i was just pointing out "How difficult it would be to make a bot that does this...", not trying to talk you out of it in anyway :P

But in my opinion, I think your going about it a painfull way to start out :P
Anyway i got some logs if there any use, there logs of traffic from ALL directions between all players, like A<>B/A<>C/A<>D/B<>C/B<>D/C<>D (game room only)
Full Log
Command 0 Log
Command 1 Log
Command 2 Log

Best of luck anyway.

Well think about starcraft from a C programming point of view. How do you suppose it handles sending its packets? Do you think it's similar to methods you'd see in most bnet bots - a ping pong style method? Receive one packet from bnet, pong back with the correct reply? A simple function for each packet, then sent directly to where it's going?

No, apparantly starcraft formulates its packets and then adds them to a linked list if its a data packet, and then loops. Theres a battle.snp function that returns the next packet to be sent and then removes it from the linked list. That's what I meant when asking if thats what that function looks like it was doing.

Anyways, the method I'm going about this with, yes, is difficult in the beginning. I feel though that taking this route will lead to a better understand of how starcraft manages its UDP data and will help to create a much better emulation of the client. It's easy enough to document all the class 0, 1 and 2 packets. I've already got tons of them documented to my best ability. I could most likely get a client into the game room as of right now by simply using my logs.

What about all those unknown values? What about packets that nobody knows what they're there for, but you could just simply reply to and probably get a client into the game room? What if it IS important.

Thank you for those logs, they'll be helpful I'm sure

MyndFyre

You know what you should do?  Get BWChart's source code (which is available) and it should have all the info you need for the algorithms Brood War uses for pathing.

You'd better be fucking thankful.  I was inspired to remember the program, and it seriously took me a half hour to find the damn site.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

MyndFyre

Actually, now I'm looking at BWChart, and it doesn't emulate all of those things.  Just the location-clicks and things like that.  Sorry man.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.


Sorc.Polgara

omg mindfire's sig is pro... liberal bashing ftw.