Action History Recording & History Playback - #1
Open
Tia-Chen wants to merge 7 commits into
Open
Conversation
use --record_action flag at command line to set recording on. At the end of the game, user will be prompted for a filename to save the action history to.
Player Action Recording: - Added timestamp to record - Added action recording to commands sent through socket as well. This adapts for multiplayer action recording/ Playback feature: - Playback feature added (replay_agent_actions.py). The program takes a file name and sends the action history stored in the file to the game to be played back.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Functionalities Developed:
Format of history: (see 2_agent_test_replay.txt for example)
"agent_id Action_command action_timestamp"
"agent_id Action_command action_timestamp"
...
HOW TO USE:
Run: socket_env.py --record_actions [other option flags]
Then, at the end of the game, at the prompt Please enter a filename for saving the action history., enter the filename to save to.
Takes a filename of action history and sends the actions to the game play through the socket to recreate the game play
HOW TO USE:
Run replay_agent_actions.py [filename]
This assumes that the game is already running and accepting socket connections.
Testings Done:
Notes:
About Future Plans:
We've briefly talked about potentially implementing the "reverse" function as a future plan. My current thought is that we need a series of "state" (or observations) that we can revert back to, and then match that state up to a place file of player actions through timestamp.
There is a save_state function currently implemented, which could be useful. Currently:
In order to use the state as tool to revert back to previous state to reverse playback, it would require us to save the state at every player action, timestamp them, and save them to file for socket input game plays. For keyboard input game plays, we may have to put in another piece of logic to write the observations with every command as well.
Does this sound like a reasonable plan? Each observation will be long. Will space memory be of concern?