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

Convert to TypeScript and multiple improvements #48

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

Conversation

Alan-Hinton
Copy link

Hi @jankeromnes. I saw your project and thought it was really interesting. I see you haven't done anything with it for ages but I thought I would show you what I have done in case you still have interest. I have taken the great initial work you did and improved it it multiple ways:

  1. Updated to latest version of the underlying terraforming mars repo
  2. Converted to typescript and used the types provided by the underlying repo
  3. Updated the evaluation of income to be based upon the number of turns left (so early income is worth more than late income)
  4. Improved the evaluation of tiles, taking into account some placement rules and adjacent tiles
  5. Separated evaluation of playing effects from evaluating playing cards in the first place
  6. Probably lots of other little tweaks
  7. Streamlined the logging

The bot can now win in solo mode about 20% of the time. It isn't very strong in multi player, but isn't totally idiotic either.

I intend to keep working on this but it would be interesting to hear your thoughts.

Create model to represent the responses from the server, don't include any references to the server code
Make the server response immutable (remove the annotate methods and find related objects on demand)
Remove the use of exec for start game to make the code simpler
Refactor the card parsing code into functions
Remove duplication in the standard project parsing code
Add some setup details to the README
Use types from the underlying common folder
Sort out the build
Standard projects are represented as effects so this should evaluate them correctly too
Also add more detailed logging
Handle more events
More logging
Beat the existing score
Fix bugs relating to precedence of `===` operator
Handle initial research like any other move
@gitpod-io
Copy link

gitpod-io bot commented Apr 3, 2023

This doesn't result in more wins in solo mode, but it does prevent very bad scores
Also use heat as a last resort when playing Helion, this also fixes a bug with Local Heat Trapping
Handle the Land Claim card better
Log the score for each available option, don't log multiple times in a turn
Improve evaluation for microbe event cards
Don't buy cards with unmet requirements
Sell any cards that become negative in value
If the total cost of the cards we have in hand is more than the cash we have, only buy cards that are better than any card we might play this turn
Improve evaluation of cards with 'or'
And a few little bugs
Don't fund awards by mistake
Don't steal resources from myself, don't play stealing cards if there isn't another player with enough resources/production to steal from
Don't play event cards that we don't have the resource production to play the event
Handle events that create oceans and have resource costs other that microbes
Create a second bot that is better at estimating when the game will end
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