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

[1856] eliminates the use of 2', 3', etc trains. #11374

Closed

Conversation

philcampeau
Copy link
Collaborator

Before clicking "Create"

  • Branch is derived from the latest master
  • Add the pins or archive_alpha_games label if this change will break existing games
  • Code passes linter with docker compose exec rack rubocop -a
  • Tests pass cleanly with docker compose exec rack rake

Implementation Notes

Explanation of Change

Currently, 1856 (and its cousin 1836Jr56) use a prime symbol to identify the last train of each rank, effectively creating several new ranks of trains. The reason is that 1856 has a floating mechanism based on the currently available train, rather than the current phase.

There's a better way of doing this, which I've implemented here, where the event is triggered by specific trains in the rank.

The only downside to this update is it will require pinning all current games of 1856. I tried for quite a while to get a script working that would replace all the relevant trains in every active game, but I couldn't get it to work. If someone wants to give me a hand with that, I could add that to this pull request and then eliminate the need for pinning.

Screenshots

Any Assumptions / Hacks

@philcampeau philcampeau added pins PR that will require some games to be pinned 1856 1836jr56 labels Nov 22, 2024
Copy link
Collaborator

@ollybh ollybh left a comment

Choose a reason for hiding this comment

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

This looks reasonable. A couple of things to think about:

  • Would it be better to add events like 3_train_available on the last 2-train and changing the float percentage from those events, instead of overriding the buy_train_action method?
  • Would it be clearer to remove the facing_X statuses and put this information in the game timeline?

I would say that this definitely needs a migration script before it is deployed, this is going to affect 300+ games. It should be fairly simple to do, it just needs to change some train names in the actions. I can help with this.

@@ -15,7 +15,7 @@ class Game < G1856::Game
include Entities
include Map

CURRENCY_FORMAT_STR = '%s F'
CURRENCY_FORMAT_STR = '%s F'
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is changed here? Pasting the strings into a unicode inspector doesn't show a change, but the Github web UI might have mangled something.

@@ -357,9 +310,9 @@ def game_trains
' Presidents may contribute personal cash but may not sell shares.' \
' CGR does not form if all corporations pay back their loans'],
'remove_tokens' => ['Remove Port Token'],
'no_more_escrow_corps' => ['New Corporations are Incremental Cap',
'no_more_escrow_corps' => ['New Corporations are Incremental Cap ',
Copy link
Collaborator

Choose a reason for hiding this comment

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

A trailing space has been added the the string here. I don't think that should be there.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

weird. Not sure how those happened. I'll fix that right now.

'Does not affect corporations which have already been parred'],
'no_more_incremental_corps' => ['New Corporations are Full Cap',
'no_more_incremental_corps' => ['New Corporations are Full Cap ',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Another trailing space added.

@philcampeau
Copy link
Collaborator Author

There are still more changes to do, after some testing. Will close for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1836jr56 1856 pins PR that will require some games to be pinned
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants