Repository navigation
|
@yairm210, hi! A bit of background. I recently wanted to add a replay feature for AI actions to the game. While researching the idea, I came across the Combat History API PR: #15546. I commented there that I’d like to help, but the author said he probably wouldn’t be able to finish it himself and suggested that I take it over, so I agreed. However, even before diving deeply into the PR, I realized that what I actually want is not a replay, but some kind of turn recap at the beginning of the next turn — a quick summary of what happened during the AI turns, something along these lines:
I have a more detailed description of the concept, but I won’t burden this discussion with it yet. Then I finally started digging into the Combat History API, and in its current form I’m not sure I like the direction it is heading in. In my opinion, it couples the history-recording logic too tightly to the battle logic itself. Moreover, that level of detail is not really needed for my potential Turn Recap feature. And after realizing the full scope of the work, I’m no longer planning to implement a full replay myself. At the same time, the current I started thinking about how I would approach this, and because of my background I quickly ended up imagining a fairly extensive refactoring of
Its caller would then iterate over the resulting But again, the scope of such a change is rather daunting, and this approach also seems somewhat out of line with the overall style of the existing codebase. At that point, I decided it would be better to discuss a few questions before going any further:
|
Replies: 1 comment 1 reply
|
A. The final goal is to have each user action be a distinct state transformation. B. I see no problem with attackoutcome, but it will not contain very much information; most of the battle logic is dealing with the state changes (health xp ownership healing city capture etc) C. My main question is what data are you saving and for how long. We want to avoid having the save files explode in size, and large scale battles leave little state effects, but a lot of attack history. |

Okay, then, in my opinion:
So I propose the following plan:
Regarding data storage, I’d keep it the same as in the current PR: stored in
GameInfoand retained for one turn.