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

Gaming update #27

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

ZackaryHoyt
Copy link
Contributor

"Dynamically setting game agent player ids when the game is instantiated (independent of who goes first). Decoupled game agent and game bi-directional dependency. Added templating to reduce object type casting. Added TicTacToeGameAgent abstract class. Updated clients and junit tests with these changes."

The broader change in this update is templatizing the game object to expect a type of game action and game agent. This largely eliminates the need to constantly check object types. Future expansions to the gaming functionality can then have less hierarchical overlap. To this end, I had to decouple the strong dependencies between the game agent and the game, otherwise the templating would be a huge mess. If in the future it is important for players to know who went first, either appending that type of metainformation to the game board or creating a game metadata object would be the best practice to avoid that circular dependency issue.

One potential issue I realized during this is that game search agents are updated every game update cycle (at least as far as I can tell). The issue is that it would scale poorly with a lot of ships as either: 1) multiple new search agents are instantiated every frame, rather than being instantiated on-demand and 2) a single search agent reference is shared across multiple ships, which might behave abnormally if then multiple ships collide with a gaming asteroid on the same update frame (not very likely, but the probability scales as more ships/asteroids are in the environment).

…Dynamically setting game agent player ids when the game is instantiated (independent of who goes first). Decoupled game agent and game bi-directional dependency. Added templating to reduce object type casting. Added TicTacToeGameAgent abstract class. Updated clients and junit tests with these changes.
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.

1 participant