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

Fragile moves/items usage #4

Open
rand0musername opened this issue Dec 14, 2018 · 5 comments
Open

Fragile moves/items usage #4

rand0musername opened this issue Dec 14, 2018 · 5 comments
Labels
enhancement New feature or request

Comments

@rand0musername
Copy link
Member

If we're wishing to optimize for the ease of use when defining new strategies, perhaps we should use enums or strings for moves/items in Strategy classes. Ideally instead of returning 0, 1 from choose_action competitors should return PERFORM_MOVE, ATTACK. This is much more readable for complex strategies and I believe will lead to less dumb mistakes.

@rand0musername rand0musername added the enhancement New feature or request label Dec 14, 2018
@rand0musername
Copy link
Member Author

I will add enums for commands in my PR, but let's discuss the rest first.

@rand0musername
Copy link
Member Author

PR #7 for command (I meant action) enums.

@rand0musername
Copy link
Member Author

Also I find strategy-centered indexing (e.g. 2 means "second of my items") to be a bit weird, if we're sticking with numbers let's at least use a global indexing (e.g. 2 always means "cookie) and a table somewhere in a PDF.

@Dreian
Copy link
Member

Dreian commented Dec 14, 2018

I prefer strategy-centred indexing, it makes you focus only on the moves you selected. Also, you will otherwise have to verify that every time you return an action, it is a valid one (so game_engine has to adequately cope with it).

@rand0musername
Copy link
Member Author

I don't think that would be hard to code from game engine perspective, but I see what you mean.

I am still not the biggest fan of raw numbers (especially when you have ~10 items), maybe strategy_gen.py could generate local constants that resolve to those numbers (so nothing changes from game engine perspective)? Like ITEM_TEN instead of 10? It's a bit dumb but less fragile? Idk

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

No branches or pull requests

2 participants