Using idle time in turn-based (RPG) games for updating
- by The Communist Duck
If you take any turn based RPG game there will be large periods of time when nothing is happening because the game is looping over 'wait_for_player_input'. Naturally it seems sensible to use this time to update things.
However, this immediately seems to suggest that it would need to be threaded. Is this sort of design possible in a single thread?
loop:
if not check_something_pressed:
update_a_very_small_amount
else
keep going
But if we says 'a_very_small_amount' is only updating a single object each loop, it's going to be very slow at updating.
How would you go about this, preferably in a single thread?
EDIT: I've tagged this language-agnostic as that seems the sensible thing, though anything more specific to Python would be great. ;-)