Temple of The Roguelike Forums
Development => Programming => Topic started by: Shaggy on March 21, 2010, 07:59:52 AM
-
How do you, from a programmers standpoint, implement scheduling systems other than simple turn based?
The only way I could think to do it would be timers that count steps, but that'd take up a lot of memory I'd think. Am I missing something?
-
I think this thread (http://www.roguetemple.com/forums/index.php?topic=138.0) might contain some answers... Or this thread (http://www.roguetemple.com/forums/index.php?topic=453.0).
-
I used so called "priority queues" with timestamps as priority. So that the closes future event is first in the queue. Then you only need to pop an even from the queue and react to it, and all newly generated events go into the queue again.
It seems I wrote a bit about this in my library already:
http://www.funkelwerk.de/library/index.php?n=Library.ActionQueues
-
How do you, from a programmers standpoint, implement scheduling systems other than simple turn based?
So you're talking about real-time RLs? Or 'more complicated' turn-based?
-
All major roguelikes have 'more complicated' turn-based systems, I think. If you have a system where each action takes the same amount of time (a turn), and simple haste (x2 speed) and slow (/2 speed) effects, a simple turn-based system is okay. Anything more complicated, and it is probably better to use some "scheduling" system.
Although more complicated systems are richer, a simple turn system might be actually a good idea, since difficult systems are more difficult to reason about tactically -- you just have to put richness somewhere else then ;)