Jump to content

Recording Game Commands


bridgar
 Share

Recommended Posts

Hi,

I am interested in recording the commands that I give in game.

This format seems to make sense: Turn X, unit list Y was given command Z at destination W.

My first approach is to look at NetMessageSim and catch the messages before they send to pull apart my commands. My problem here is that I can't seem to make any sense of the "command" stored in the RootedValue tmpData. (CSimulationMessage::Serialize in NetMessageSim.cpp)

My second approach is to pull the packets that I send. Here, I seem to be able to get the command type, time of the packet sending, and number of units. I cannot, however figure out the destination from the packets.

Example packet: http://imgur.com/0fXkCIq

You can see that there are 9 units being moved with a walk command; I just can't figure out how to get the x and z coordinates of the destination or what the units are. I can see that x and z are there but I have no way of knowing. For my purposes, location of the command may be sufficient.

Does anyone have any idea how to get the destination of commands?

Link to comment
Share on other sites

turn 14 200endturn 15 200cmd 1 {"type":"walk","entities":[7079,7080],"x":620.8948974609375,"z":839.1896362304688,"queued":false}endturn 16 200endturn 17 200end

You see the commands in this file already like in the example above (here you see a move command for two units). The hashes are generated in multiplayer games and are a checksum of the game state or parts of it. You can't use the hashes for anything else than checking if they are equal. They are used to detect out of sync errors in multiplayer games for example. The AI doesn't send the commands like human players in case you were looking for that.

Commands.txt is generated during the game in real-time, as well as the hashes.

  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...