Should commands (translated from user input or from AI) sent to the game logic, be executed immediately? I.e user requests fire weapon, weapon is fired and damage to enemies is applied immediately? Or should it be queued, then processed later?
I was thinking about possible timing issues that could arise. E.g if an AI requests "move actor 5" but actor 5 was already destroyed earlier by the user. How would I sequence commands being generated from the user and AI, and the processing of these commands to prevent this sort of thing from happening?
If it was sequenced like this: send user commands to logic, send AI commands to logic, logic processes commands, this could happen, but then the AI and user are acting on the same information (the previous game state).
I was thinking about possible timing issues that could arise. E.g if an AI requests "move actor 5" but actor 5 was already destroyed earlier by the user. How would I sequence commands being generated from the user and AI, and the processing of these commands to prevent this sort of thing from happening?
If it was sequenced like this: send user commands to logic, send AI commands to logic, logic processes commands, this could happen, but then the AI and user are acting on the same information (the previous game state).