Conversation
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.
Adds functionality to simulate the game without having to run it. This is much faster making it easier to iterate over bot improvements. Also added --seed option to set the random seed for consistent results.
Example:
❯ cargo run -- bots/jojo.rasm bots/jojo.rasm --max-turns 2000 --seed 1337 --simulate Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.03s Running `target/debug/botarena bots/jojo.rasm bots/jojo.rasm --max-turns 2000 --seed 1337 --simulate` 15:11:39.980 INFO botarena: Bot Arena starting... 15:11:39.981 INFO botarena::game: Arena created with 20x20 grid. 15:11:39.981 INFO botarena::game: Simulating for a maximum of 2000 turns. 15:11:39.981 INFO botarena::game: Using deterministic seed: 1337 15:11:39.981 INFO [R01] botarena::game: Loading and parsing program for Robot 1 (Name: jojo) from file: bots/jojo.rasm 15:11:39.982 INFO [R02] botarena::game: Loading and parsing program for Robot 2 (Name: jojo) from file: bots/jojo.rasm 15:11:39.985 INFO botarena::game: Loaded 2 robots. 15:11:39.986 INFO botarena::game: Particle system initialized. 15:11:39.986 INFO botarena::arena: Placing 4 obstacles... 15:11:39.986 INFO botarena::arena: Obstacles placed. 15:11:39.986 INFO botarena::game: Starting headless simulation... 15:11:40.024 INFO [R01] botarena::arena: Robot 1 took 6.30 damage, health remaining: 93.70 15:11:40.073 INFO [R01] botarena::arena: Robot 1 took 10.00 damage, health remaining: 83.70 15:11:40.097 INFO [R02] botarena::arena: Robot 2 took 6.30 damage, health remaining: 93.70 15:11:40.109 INFO [R02] botarena::arena: Robot 2 took 6.30 damage, health remaining: 87.40 15:11:40.110 INFO [R02] botarena::arena: Robot 2 took 6.30 damage, health remaining: 81.10 15:11:40.121 INFO [R01] botarena::arena: Robot 1 took 10.00 damage, health remaining: 73.70 15:11:40.130 INFO [R01] botarena::arena: Robot 1 took 10.00 damage, health remaining: 63.70 15:11:40.130 INFO [R01] botarena::arena: Robot 1 took 6.30 damage, health remaining: 57.40 15:11:40.135 INFO [R01] botarena::arena: Robot 1 took 6.30 damage, health remaining: 51.10 15:11:40.136 INFO [R01] botarena::arena: Robot 1 took 6.30 damage, health remaining: 44.80 15:11:40.139 INFO [R01] botarena::arena: Robot 1 took 10.00 damage, health remaining: 34.80 15:11:40.149 INFO [R01] botarena::arena: Robot 1 took 10.00 damage, health remaining: 24.80 15:11:40.152 INFO [R01] botarena::arena: Robot 1 took 10.00 damage, health remaining: 14.80 15:11:40.156 INFO [R01] botarena::arena: Robot 1 took 10.00 damage, health remaining: 4.80 15:11:40.160 INFO [R01] botarena::arena: Robot 1 took 10.00 damage, health remaining: -5.20 15:11:40.160 INFO [R01] botarena::arena: Robot 1 destroyed! 15:11:40.160 INFO botarena::game: Simulation complete: jojo WINS with 81.10 health after 444 turns 15:11:40.160 INFO botarena::game: Exiting headless simulation. 15:11:40.160 INFO botarena: Bot Arena finished.This should be the same every time it runs and it should also be the same if run without
--simulate.