Question - Code structure: Turn-based but parallel actions and how to avoid conflicts in world state
retained text
Turn based grid tactics game (XCOM), but can pick an action then switch characters and let the first one get on with finishing the action. How do I best go about making sure that the next character can't target an enemy who is about to die anyway. Or not move to the place the previous character is moving (which is easier). Calculate results of actions in advance? Or, which sounds less buggy, queue input til the previous character is finished? Then ignore it if there's a conflict? Might even be satisfying as a player to watch a movement area increase as the previous character does its thing. Any idea how this is normally solved?
document fetched 2026-10-24 00:27 · canonical https://reddit.com/r/gamedev/comments/1xd01db/question_code_structure_turnbased_but_parallel