Temple of The Roguelike Forums

Development => Programming => Topic started by: Shaggy on March 21, 2010, 07:59:52 AM

Title: Scheduling Systems
Post 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?
 
Title: Re: Scheduling Systems
Post by: Z on March 21, 2010, 09:10:23 AM
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).
Title: Re: Scheduling Systems
Post by: Etinarg on March 21, 2010, 04:29:50 PM
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
Title: Re: Scheduling Systems
Post by: george on March 21, 2010, 05:18:48 PM
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?
Title: Re: Scheduling Systems
Post by: Z on March 24, 2010, 06:48:07 PM
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 ;)