-
Notifications
You must be signed in to change notification settings - Fork 4
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
Newgame #41
Conversation
… worthwhile though
lgtm. but not sure what to look out for. I tested it and looks like nothing is breaking. pushed the result to this branch: bf04905 Looks like it:
|
Yup! Games.toml is replacement for inventory. It can be written do if someone wants to add a game manually. I also updated the getting started with a new game information in docs. |
Games.toml
Outdated
@@ -0,0 +1 @@ | |||
games = [["amidar", "amidar", "Amidar"], ["breakout", "breakout", "Breakout"], ["gridworld", "gridworld", "GridWorld"], ["space_invaders", "space_invaders", "SpaceInvaders"], ["pong", "pong", "PongConfig"]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be a flat array of the capitalized one?
We could call .lowercase()
to get the other two?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do, hoss.
Updated Games.toml format, code generation, and documentation. |
Just added a |
BTW I was going to try to set this up as a cargo subcommand but it's too much of a hassle to get that working. We'll just stick with the instructions for now. Will be ready to merge once the tests are passing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think rolling back the change to 'spaceinvaders' is the only blocker here.
@@ -16,10 +16,10 @@ pub fn get_simulation_by_name(name: &str) -> Result<Box<dyn Simulation>, String> | |||
"breakout" => Ok(Box::new(breakout::Breakout::default())), | |||
#[cfg(feature = "gridworld")] | |||
"gridworld" => Ok(Box::new(gridworld::GridWorld::default())), | |||
#[cfg(feature = "space_invaders")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be OK if we ditched the cfg-feature per game situation. We'd initially envisioned compiling just the games you need, but the rust compiler has gotten faster and we're distributing on pip now...
@@ -29,7 +29,7 @@ def test_breakout(self): | |||
self._bad_json_is_recoverable(tb) | |||
|
|||
def test_space_invaders(self): | |||
with Toybox("space_invaders") as tb: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I vote to restore the tuples so we don't have to break this compat.
serde_json = "*" | ||
serde_derive = "*" | ||
lazy_static = "*" | ||
rand = { version = "0.6.3", default-features = false, features=["std"] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we turn these version numbers into "*" and have it be OK? idk, but it would be nice to be less-specific here...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I copied the other Cargo.toml
s here; presumably you chose a specific version for a reason?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I got paranoid with rand because they don't consider the specific random number generator to be part of semver... and we really want to be as reproducible as possible with a given seed.
// Put the rest of the structs for your game here | ||
|
||
#[derive(Clone, Serialize, Deserialize, JsonSchema)] | ||
pub struct StateCore { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should go into another pull request.
@kclary -- did this break any of your builds? |
@etosch I made the branch/build just to check if the tool worked. Haven't made any changes, and I'd be fine to abandon & rerun the latest version. I no longer remember how to check the build -- is that helpful for debugging or more to make sure there are no lingering issues? |
@jjfiv was concerned that there were breaking changes. I think the issue he pointed out is that every instance of |
It was actually trying to use 'inventory' that broke the build: #37 I think this is orthogonal. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok with spaceinvaders rename since nobody's really using it yet.
mostly kicking off a pull request to get eyes on this.
looking for feedback on how "complete" we want the autogenerated starter code to be.