Conversation
…lve more independently
|
This victory conditions PR is now open for reviews. See first post for changes. Plan is to implement victory conditions and related scaffolding here, and then take on actual game winning wiring in a separate effort. |
stavrosfa
left a comment
There was a problem hiding this comment.
As far as I can tell, without being able to win/lose, it looks ok. I have left some comments.
I would also rather in the future that we split such big PRs into smaller, more managable chunks, so that they can be evaluated better and be easier to revisit in the future.
| // "Power is an amalgam of cities, gold, culture, advances, resources, military strength, | ||
| // nuclear weapons, and wonder." | ||
| // Exact formula is unknown, so we repeat the previous value. | ||
| // TODO: Figure out power formula |
There was a problem hiding this comment.
I would add a TODO here to make this formula/score calculations moddable (where it makes sense)
| } | ||
| } | ||
|
|
||
| private static bool IsDefeated(SavePlayer player, QueryCiv3.Sav.LEAD leader) { |
There was a problem hiding this comment.
Is this really that simple in the base game, or should we add a few TODOs here?
There was a problem hiding this comment.
Added a TODO.
Probably good enough for now. No cities means civ is almost certainly dead, except for the very beginning of the game - hence the unit counter. I think civs that are killed in the original do have their remaining units wiped, so this should be reasonably correct for Civ3 save files.
There was a problem hiding this comment.
The original condition is no cities and no settlers (or more accurately, units with the build city action). All units are wiped on defeat, as well as any remaining cities if defeated under elimination rules, which obviously is a separate case.
|
Yeah, not happy with how much stuff there is in this one. I think I'll slice off some of the util stuff and UI bits in separate PRs. |
# Conflicts: # C7Engine/C7GameData/GameData.cs # C7Engine/C7GameData/Player.cs # C7Engine/C7GameData/Save/SaveGame.cs
|
I've patched up this PR: the game is now winnable. I've simplified things a bit, so that "Turn Limit" is the only supported victory type. The player with the highest score at the end of the last turn wins. End of the game is marked only with a simple popup on the UI side, for now. |
Add support for winning the game. This PR adds victory conditions and some scaffolding to support victory condition evaluation.
Add New Game Player Set widget for selecting games rules, add a couple of victory condition selectors as a demo(--> future PR)Wire score history maintenance into main game loop(previous PR)Add some util fuctions for victory calcs in Tile, TileKnowledge, City, GameData, Player, TerrainType, Building(previous PR)The game now ends when the turn limit is hit. There's a basic UI popup that notifies about game termination and allows you to terminate the game, or to continue without extra score accumulation, with the game effectively in "game over" state.
Per turn score calculation looks pretty good, per turn culture calc is not quite there, per turn power is unimplemented. (We have some info on the power formula, but we might pursue a custom alternative instead).