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

Add supernova mode to AI vs AI on demo #35

Merged
merged 7 commits into from
Apr 2, 2016
Merged

Add supernova mode to AI vs AI on demo #35

merged 7 commits into from
Apr 2, 2016

Conversation

donbonifacio
Copy link
Contributor

screen shot 2016-03-27 at 16 20 01

#34

category
displacement
movement-type
movement-cost])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would've loved to understand why using long for the type hint is better from your commit message :p

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad!

A long is a primitive, and with such, the jvm can do primitive very fast math. With the Integer reference type, it has to box/unbox it. If it has no type hint, clojure will use heavy reflection to find out the type.

More details about performance issues: https://www.youtube.com/watch?v=iQwQXVM6oiY

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also updated the commit message.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! :D

@jqmtor
Copy link
Contributor

jqmtor commented Mar 27, 2016

@donbonifacio just finished

Replace Integer for primitive long and add more type hints to the unit.

A long is a primitive, and with such, the jvm can do primitive very fast
math. With the Integer reference type, it has to box/unbox it. If it has
no type hint, clojure will use heavy reflection to find out the type.

More details about performance issues:
https://www.youtube.com/watch?v=iQwQXVM6oiY
Demo was still using the old game-mode/process. Changed to
game-progress/next-stage. We now have a working demo.
Minor change: moved the intro panel with text to the top, and now the
serialized game can be right next to the game. This looks more like a
playground/test zone and will be useful to test the AI.
On the demo page AI vs AI, added a button that restarts the game and
sets the mode to supernova.
Had to rewrite the image to the olf flag unit and have the current mode
always on the state. Created an issue to solve this later:
#36
I was storing on the webapp state the mode for the ai vs ai game.
Whenever a game started, I'd use that mode to start a new game.

Changed that logic to store an actual map with the full game options.
By default it uses `game-progress/default-new-game-options`. For the
supernova mode, it just associates the :supernova mode to the defaults.
@donbonifacio
Copy link
Contributor Author

@quimrstorres ready for a re-review.

@jqmtor
Copy link
Contributor

jqmtor commented Apr 2, 2016

@donbonifacio everything looks great! Awesome job! 👍

@donbonifacio donbonifacio merged commit 26e6f78 into master Apr 2, 2016
@donbonifacio donbonifacio deleted the cleanup branch April 2, 2016 18:13
@jqmtor jqmtor removed the for review label Apr 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants