C7-Game / Prototype

An early-stage, open-source 4X strategy game
https://c7-game.github.io/
MIT License
33 stars 9 forks source link

Add an Observer Mode #353

Closed QuintillusCFC closed 1 year ago

QuintillusCFC commented 1 year ago

Activated (and deactivated) with Ctrl+Shift+Alt+O.

This is slightly different than Civ3's Observer Mode, modeled more on Paradox's Observer Mode. Specifically, it's different in that the AI will assume control of your civilization while you are in Observer Mode.

This makes it more useful for hands-off observation, and will be yet more useful, especially for testing how scenarios play out, or just if the player wants an advanced start, if an "autoplay" feature is added (which is featured in some Civ4 mods).

Known issue: If you enter Observation Mode immediately, before fortifying your units, each turn ended with the "Enter" key will cause two turns to happen. If you fortify your units first, or use the NumPad enter key, that won't happen.

I've identified that the cause is at least in part that the Godot BlinkyEndTurnButtonPressed event we have is firing right after the Enter key event is processed in this case, but am not sure exactly why or why it happens only for Enter. Presumably somehow it has the focus in that case? But I suspect it's a deep enough rabbit hole that I don't really want to get into it, a good enough Observation Mode is good enough for Carthage.