Civ 7: Undo or backup (turn game mechanic)

DeckerdJames

Warlord
Joined
Nov 1, 2019
Messages
235
When you reload an earlier turn, the game engine knows and it allows the AI players from the earlier save game to inherit the knowledge that it had learned, so it remembers too. The fog of war comes back for AI players, just as it does for human players, for example, but it has some idea of what is in the fog of war if it had revealed them previously. AI players also know anyone's previous objectives for the turns to come, if they had witnessed those objectives. The AI remembers your objectives whether the objectives were "unit moves" or others done on the map or even in the diplomatic and trade screens. So, AI would remember you did need iron if you had bought it, for example. So if you has settled a city and then reloaded an earlier turn, the AI would be able to possibly preempt your moves too, so it might race you to that tile you settled and get there first.


Suppose that instead of always knowing or not knowing where units are located, it knows when it knows for sure, but it can also know when it knows of something's existence, but not where it exists. So every piece of intelligence matches something that it knows. If it think it knows a unit is in the fog of war, it places a intelligence item on the map in that tile. To visualize what I mean, imagine the AI is looking at the map and it sees ghostly transparent versions of all the units that it knows about but doesn't know for sure where they are. So if the fog of war were to be replaced, on the first turn it would know where a player's units are, or not know, depending on the order in which players take their turns. After all of the next round of moves are completed, an AI would have to replace the known units that were back under the cover of fog with the ghostly transparent versions that represent the intelligence an AI player possesses that those units still exists somewhere on the map. It would have to figure out where the units might be, depending on what it knows about the objectives of the civilization that owns those units. Then the AI player would move his own intelligence items (A.K.A ghost units) to the tiles where the AI decides they probably are.
 
Last edited:
I find it helpful to distinguish between "undo" (say, as implemented in Old World) and actually loading a save file.

When a player saves the game, all of the game's states are saved. Build queues, positions of units, cities/districts/buildings, diplomacy.... all saved at that point in time. The player (assuming single player) could load that save file and resume play hours later... days later... or weeks later. I make it a practice -- some others do, also -- of saving the turn 1 save, in case I want to play that world again.
I don't understand how the game would retain "knowledge" from other play sessions that proceeded (or didn't) from a particular save file. Each save file stands alone. The memories that a human player has can't really be represented or reproduced.

In contrast, when I'm in the middle of a turn and misclick, I can undo that move. I could undo all of my moves and steps in that turn, including build orders, diplomatic decisions, and attacks. I sincerely don't know if it's possible in Old World to undo things that go back further than the current turn.
If Deckard is describing a multi-turn undo, during the same session, it might well be possible for the AI to remember some of what was learned in the moves that were "undone." The states of the game would have been retained in a 1-turn autosave. That could get REALLY messy, though. Imagine the situation where an AI has been eliminated. Backing up / undo-ing the game steps that led to its final defeat means reviving it, which could be very clunky.

I do support "undo" within a turn. I support loading a save game and proceeding from that point, whether or not I have ever played further in that game. I'm not excited by the prospect of a "meta game" that remembers whether I've reloaded or replayed the same turns more than once.
 
Old World's undo is the same as reloading an earlier save made at that point actually. We have tests to verify that. Undo goes back several turns and it can do anything, including an AI being eliminated. The system would theoretically allow you to undo the whole game back to turn 1, though we discard undo data after a few turns to keep save size manageable.
 
I find it helpful to distinguish between "undo" (say, as implemented in Old World) and actually loading a save file.

When a player saves the game, all of the game's states are saved. Build queues, positions of units, cities/districts/buildings, diplomacy.... all saved at that point in time. The player (assuming single player) could load that save file and resume play hours later... days later... or weeks later. I make it a practice -- some others do, also -- of saving the turn 1 save, in case I want to play that world again.
I don't understand how the game would retain "knowledge" from other play sessions that proceeded (or didn't) from a particular save file. Each save file stands alone. The memories that a human player has can't really be represented or reproduced.

In contrast, when I'm in the middle of a turn and misclick, I can undo that move. I could undo all of my moves and steps in that turn, including build orders, diplomatic decisions, and attacks. I sincerely don't know if it's possible in Old World to undo things that go back further than the current turn.
If Deckard is describing a multi-turn undo, during the same session, it might well be possible for the AI to remember some of what was learned in the moves that were "undone." The states of the game would have been retained in a 1-turn autosave. That could get REALLY messy, though. Imagine the situation where an AI has been eliminated. Backing up / undo-ing the game steps that led to its final defeat means reviving it, which could be very clunky.

I do support "undo" within a turn. I support loading a save game and proceeding from that point, whether or not I have ever played further in that game. I'm not excited by the prospect of a "meta game" that remembers whether I've reloaded or replayed the same turns more than once.
I like what you have written.

I doubt that this idea would really solve the whole problem anyway. Even if the AI were to remember everything it learned before the game was rewound, it wouldn't stop people from pushing their units forward to see where the dangers were and then backing the game up and making a move after that intelligence was gained. Some dangers are in fixed positions, so the AI would still be greatly disadvantaged since it cannot backup from a bad move and make a different one, but a human player would be able to do that.

As to how it would be done, I think the state of the game world and unit positions would be one part of the save file and another part of the save file would contain the "intelligence" that the AI possesses. So you could change the board position, even to something random, and it wouldn't immediately discard its "intelligence", but it would have to reconcile what "intelligence" it possesses with what it sees on the board and be able to discard "intelligence items" that are certain to be invalid. It would be able to immediately update its "intelligence" about what is visible to it, but for things that are hidden in the "fog" it would have to first gain vision. So an AI would only read the visible hexes and the create its "intelligence reports". ) The certainty of "intelligence items" would begin to degrade as soon as they were no longer visible or verifiable. The certainty about the location of a city might not degrade, or might not degrade quickly, but certainty about a fast moving unit that moved into the "fog" might degrade very quickly.

"Gaining vision" for an AI, in this hypothetical system, is essentially being able to read the contents of the hex. The AI can then create an "intelligence report" for each hex. Possibly, after analyzing all of its "intelligence" an AI would compile its list of board moves, it passes the move list to some other entity that changes the board.

Example: The AI would possess intelligence on turn one. It knows how many players are in the world and what category of map. Could be configurable.

So the "intelligence" part of the save file would not be rewound if you reversed the game a move or even multiple turns. Only the board position would change. The "intelligence" portion is not overwritten or changed at all, or maybe, there would have to be some reasonable way to remove "intelligence items" that disadvantage the AI when the game board or game state is changed.

The AI would have to be able to "vet" "intelligence items" reliably. Without being able to play with such a system, I really don't know what unknown problems there would be with the system. Maybe some are foreseeable, but I don't know if I can foresee them.

I think the system pertaining to intelligence wouldn't be too complex because the game world is divided into hexes and only so many things can be on a hex at one time. So if the game were reversed a few turns, the AI could immediately discard every invalid "intelligence item" that is within its visibility. The unforeseeable problem, for me, is how can humans use that in a consistent way to get an unfair advantage. The AI would have to "vet" their "intelligence items" that are still in the "fog" and humans would learn the process by which the AI does that, and that would create some predictability about the AI after the game was reversed. Maybe, the AI would have to be made aware that the game had been reversed. If it was aware, then it could know that the next turn is on a "revealed board" or "open board" and behave differently. There would probably need to be some way for the AI to narrow down the region that it considers an "open board".

In short, the AI needs to know if it has secrets and when it has them. After a reverse, it needs to know which things are no longer secret. So everything would need a "isSecret = "TRUE" or "FALSE" flag and that flag is one thing that a reverse would change in a previous version of the game. It might not be so simple as a Boolean flag but whatever it was would serve the purpose of dividing what is secret from what is not secret, and for a game like civ, no doubt an AI would have to maintain a different list for what is secret and known to each civilization. For example, one AI might know that YOU know about its secret "Nuke", but it might also know that a different player does not yet know. At best, in the intelligence world, the AI would be 99% certain that its secrets were still secret. Unless you want the AI to be too confident then it can be 100% certain that no one knows its secrets.

That means that all of the "intelligence items" also have an associated list that contains all the other players' names paired with the probability (1 - 99%) of whether each civ knows about this "intelligence item". "Intelligence items" are secrets.

Sorry, I hope I have been able to make it clearer. It is hard to use language to communicate accurately.

I think the idea needs more work for it to be a real solution.
 
Last edited:
Top Bottom