Skip to content

Add actions, failed actions, and collisions to saved game state. #123

Closed

Description

@weseldridge

This is a request that came in through Discord from @suphoff.

Activity

  1. changed the title [-]Add actions, failed actions, and collisions too saved game state.[/-] [+]Add actions, failed actions, and collisions to saved game state.[/+] on Jul 31, 2018
  2. suphoff commented on Aug 4, 2018

    @suphoff
    Contributor

    I propose reversing the order of the calls to env.render() and env.act() in run_battle.run._run().

    This way env.act could just stash the last actions in the environment for env.render to display/store as json, ...

    With actions and states recorded everything else (Failed actions, and collisions ..) can be deterministically determined.

  3. cinjon commented on Aug 5, 2018

    @cinjon
    Collaborator

    Yes, let's do that. I had actually already made this change in the research we had been doing (that led to Backplay).

    @suphoff , it seems like you had another motive for this re recording actions. Does that mean you have already made the change along with that extra recording?

  4. suphoff commented on Aug 5, 2018

    @suphoff
    Contributor

    @cinjon - Don't have any code (and very happy not to have to write any) - was just planning ahead to prevent pipeline stalls.

  5. suphoff commented on Aug 8, 2018

    @suphoff
    Contributor

    @cinjon : Any chance you can cherry pick those changes from your research branch?
    Do you also have code to compare two states (for #108 )?

  6. cinjon commented on Aug 9, 2018

    @cinjon
    Collaborator

    I'm actually a little confused now. Is it the case that in totality you just want the actions recorded along with the game state?

  7. cinjon commented on Aug 9, 2018

    @cinjon
    Collaborator

    And what do you mean wrt code to compare two states? Is a "state" here the info in a game state file?

  8. suphoff commented on Aug 9, 2018

    @suphoff
    Contributor

    State as in:

    • S(t+1) = forward.model.step ( S(t) x A(t) ) .... well the current recording of the states in json.

    My main reason is that just recording all the states S(0) .. S(T) does not really describe what actually happened in a game. (Example: Agent A actively colliding with Agent B to prevent a move in contrast to both Agents just not moving). ( For a given states S(t), S(t+1) the set of Actions A(t) : S(t+1) = forward.model.step ( S(t) x A(t) ) may have multiple members ).

    The recorded action could be used for improving visualization of a recorded game (showing collisions, failed kicks ...) using an enhanced step function or actions could just be displayed (as arrows) in a state transition animation.

    It could also be used to replay a game with a new or changed step functions and verify that the resulting states are as expected. (A nice and easy code regression test)

  9. cinjon commented on Aug 10, 2018

    @cinjon
    Collaborator
  10. suphoff commented on Aug 10, 2018

    @suphoff
    Contributor

    I believe the action requested is all that is needed.

    ( If anyone really needs the action taken it can be easily extracted from state changes (unless the agent is dead in the next state) or calculated from start state and requested actions)

  11. cinjon commented on Aug 14, 2018

    @cinjon
    Collaborator
  12. cinjon commented on Aug 15, 2018

    @cinjon
    Collaborator

    0017eef should handle the issue by including an "intended_actions" in the json. Let me know if this is insufficient.

  13. suphoff commented on Aug 15, 2018

    @suphoff
    Contributor

    It is sufficient - however would it not be nicer to group S(T) with A(T) instead of S(T+1) with A(T) ?

  14. suphoff commented on Aug 16, 2018

    @suphoff
    Contributor

    On second thought - for human players we definitely need to render before asking for actions.
    So unless save_json is split out from render in the environment we can only report the previous actions.
    ... and actions can be reordered anyway as part of processing the game file without changes in the env api.
    @cinjon : Happy with the current solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions