duyminh1998 / pycmo

Command Modern Operations Learning Environment
Other
50 stars 23 forks source link

Game recording #6

Closed MorganeAyle closed 2 years ago

MorganeAyle commented 2 years ago

Hello, Thanks a lot for your great work! Do you know if there is any way of recording the game while an agent is playing to be able to visualize it later?

duyminh1998 commented 2 years ago

Hi,

Thank you for your interest!

From my experience, Command does not support any sort of game recording. However, there are alternatives. If you have the professional version of Command, you can:

  1. Export the data in real-time to an SQL database and then run a separate program to visualize the game.
  2. Export the data to TacView, a third party software that Command supports interfacing with and which would render the scene in 3D.
  3. Play the game in Interactive mode with a TCP/IP port open. I remember testing this but it was buggy and did not work as intended. First, ensure that the game has IO enabled. Then, launch the game as you would normally play it. Launch the scenario you want to play. Then, open up a separate terminal and run your agent, where the agent is supposed to be sending commands to the game via the TCP/IP port. In this way, you could theoretically see the game being played out as the agent is playing it. However, there was an issue with a particular function (namely VP_RunForTimeAndHalt or something like that) and it did not work for me. If they ever fix that function, this is the most viable option to visualize how the agent played the game.

Hope that helped!

MorganeAyle commented 2 years ago

Thanks a lot, your 3rd suggestion worked well!