bridgar Posted November 9, 2014 Report Share Posted November 9, 2014 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/0fXkCIqYou 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? Quote Link to comment Share on other sites More sharing options...
Yves Posted November 9, 2014 Report Share Posted November 9, 2014 Have you checked the commands.txt file that already gets created in each game?Look in the wiki in GameDataPaths to find the files.Is that what you need? 2 Quote Link to comment Share on other sites More sharing options...
bridgar Posted November 10, 2014 Author Report Share Posted November 10, 2014 This does appear to be what I'm looking for. I don't know how they're hashed, though. Can I turn these hashes back into commands?Also, out of curiosity, is this generated real-time or dumped after the game? Quote Link to comment Share on other sites More sharing options...
Yves Posted November 10, 2014 Report Share Posted November 10, 2014 turn 14 200endturn 15 200cmd 1 {"type":"walk","entities":[7079,7080],"x":620.8948974609375,"z":839.1896362304688,"queued":false}endturn 16 200endturn 17 200endYou 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. 2 Quote Link to comment Share on other sites More sharing options...
bridgar Posted November 11, 2014 Author Report Share Posted November 11, 2014 This is exactly what I needed. Thank you! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.