Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Record more statistics #155

Open
liqimai opened this issue Jan 11, 2023 · 3 comments
Open

Record more statistics #155

liqimai opened this issue Jan 11, 2023 · 3 comments
Labels
enhancement New feature or request environment development related to the environment

Comments

@liqimai
Copy link
Contributor

liqimai commented Jan 11, 2023

I notice that there is an env.state.stats variable to record some game statistics. This is exactly what we RL trainers need. During these days' training, I really want to visualize some statistics about the gameplay, but most statistics are not easy to get outside env.step, because env.step is the actual place where the game logic runs. Here are some statistics I suggest recording.

Suggested statistics

Resource production statistics

  • ore dug so far by light/heavy
  • ice dug so far by light/heavy
  • water/metal refined so far
  • power generated so far by
    • factory
    • light robots
    • heavy robots

Resource consumption statistics

  • water spent on
    • watering
    • keeping factories alive
  • metal spent on
    • building light robots
    • building heavy robots
  • power spent on each action type, including
    • move/dig/self_destruct
    • updating action queue
    • building light/heavy robots

Action statistics

  • the successfully executed number of each action type
  • for dig
    • rubble removed so far by light/heavy
    • own/opponent lichen dug so far by light/heavy
  • for pickup
    • the total amount of each type of resource picked by light/heavy
  • for transfer
    • for each resource type
      • amount transferred from light/heavy
      • amount transferred to light/heavy/factory
  • for move
    • average rubble in the target tile of light/heavy
    • the number of collisions with own/opponent robots
    • survival light/heavy in collisions
    • destroyed light/heavy in collisions

To be continued

Other proposals are welcome. Please leave a comment if you want other statistics.

@StoneT2000 StoneT2000 added enhancement New feature or request environment development related to the environment labels Jan 14, 2023
@StoneT2000
Copy link
Member

@liqimai
Copy link
Contributor Author

liqimai commented Feb 2, 2023

Thanks. This really helps, especially with dense rewards design!

@Nashgari
Copy link

Nashgari commented Feb 10, 2023

I would like to add there is a place for the power consumption of the units / factories.
But only factories are recording the power consumption.
Env.py contains the code where the units uses power
line 503 unit.power -= self.state.env_cfg.ROBOTS[unit.unit_type.name].DIG_COST
but it is not recorded in the stats in the same way as a factory
line 568: self.state.stats[factory.team.agent]["consumption"]["power"][
"FACTORY"
] += spent_power

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request environment development related to the environment
Projects
None yet
Development

No branches or pull requests

3 participants