terraforming-mars / terraforming-mars

Terraforming Mars Boardgame
GNU General Public License v3.0
701 stars 319 forks source link

Inconsistent Naming of Expansions vs. Extensions, Options vs. Variants in Code #5301

Open d-little opened 1 year ago

d-little commented 1 year ago

There's an inconsistency with naming of both Official and Fan-Made 'Expansions' and 'Options' in the codebase (I'm using Expansions +Options here as that's what the New Game UI uses)

Some are named fooExtension, some barExpansion. Some use neither. Additionally, 'Options' (per the UI) do not have a common naming scheme.

I'd like to propose we decide on a standard name for these, and then work to standarise them. For the sake of discussion, I'll propose:

We can define Expansions as anything that adds content to the game, and Options/Variants as anything that modifies content already selected.

A example sampling of these names via NewGameConfig are:

Current Example Proposed
corporateEra no change
venusNextExtension venusNextExpansion
coloniesExtension coloniesExpansion
preludeExtension preludeExpansion
turmoilExtension turmoilExpansion
promoCardsOption promoCardsExpansion
communityCardsOption communityCardsExpansion
aresExtension aresExpansion
politicalAgendasExtension politicalAgendasExpansion
moonExpansion moonExpansion
pathfindersExpansion pathfindersExpansion
ceoExtension ceoExpansion

NewGameConfig.ts also has all of the following Variants. This is a mixbag of Options and Multiplayer Options:

  // Variants
  draftVariant: boolean;
  // initialDraftVariant: boolean;
  startingCorporations: number;
  shuffleMapOption: boolean;
  randomMA: RandomMAOptionType;
  includeFanMA: boolean,
  soloTR: boolean; // Solo victory by getting TR 63 by game end
  customCorporationsList: Array<CardName>;
  bannedCards: Array<CardName>;
  customColoniesList: Array<ColonyName>;
  customPreludes: Array<CardName>;
  requiresMoonTrackCompletion: boolean; // Moon must be completed to end the game
  requiresVenusTrackCompletion: boolean; // Venus must be completed to end the game
  moonStandardProjectVariant: boolean;
  altVenusBoard: boolean;
  escapeVelocityMode: boolean;
  escapeVelocityThreshold: number | undefined;
  escapeVelocityPeriod: number | undefined;
  escapeVelocityPenalty: number | undefined;
  twoCorpsVariant: boolean,
  customCeos: Array<CardName>;
kberg commented 1 year ago

Mea culpa. I should have just used Extension like the app already had. But it's more work than you might realize.

Besides changing game configurations, it also means that all games in progress have to be kept up to date (at least until all prior games are deleted.) But even more problematic is that many players use the upload feature to take a set of game settings and just re-upload them. Those won't be compatible unless we focus on backwards compatability again.

Does this provide a value for the server? Perhaps. I'm not against clean code, as you can see. But the work for the output might not be worth it. Which is why I never have.

If you have other ideas, I'm happy to listen.