Zanshin's Queued Events System for NWN 1.1 public release Simply put, it's a way to schedule events or scripts to run at a particular time, which uses a database 'queue'. You can specify something to run weeks, days, or seconds ahead, in server or real time, and it will run even if your module is restarted or rebooted. 1.1-Fix for potential overflow.
Posted by Qulauz at 2004-08-01 06:11:33 Voted 10.00 on 08/01/04
Posted by Zanshin_ at 2004-07-03 07:45:00 Voted 9.00 on 07/03/04
1.1-Fix for potential overflow of queue.
(Discovered this problem the hard way :P)
Posted by Zanshin_ at 2004-07-03 07:44:22 Voted 9.00 on 07/03/04
Posted by Zanshin_ at 2004-03-22 00:53:00 Voted 9.00 on 07/03/04
Yes. All the code depends on MySQL. I believe it would work on Postgres, though, but for the field types.
Posted by Zanshin_ at 2004-03-17 11:37:00 Voted 9.00 on 07/03/04
Heartbeats are fine, as long as you don't do a lot of processing in them.
Remember, the -only- time any processing is done is if there's something pending with this system. The SQL server itself actually filters out the pending events from the non-pending events via the query.
Most heartbeats, the execution is simply "Do you have anything for me to process? No? Ok."
I went through your scripts a bit last night, though I have not yet had time to test it yet. I notice you do use a heartbeat event to update the queue. Have you noticed much lag due to this? Just curious.
I'm hoping to find time to play with this a bit over the next week or so. If it works as well as I hope it does, I think I'll be using this quite a bit in the PW I'm creating. I just need to learn how to use it properly. lol...
Posted by Zanshin_ at 2004-03-17 01:41:00 Voted 9.00 on 07/03/04
Yep. Overhead is low, and anything which can be scripted can be triggered. Also, it runs even if your module crashes or is reset.
I'm using it for NPC scheduling, among other things.
It's uses areonly bounded by your imagination, Spider! ;)
If I understand it correctly, it allows you to set up timed one-shot and reoccuring events. This would allow you to schedule when a script is fired. I think it has the potential, depending on the overhead. to replace the heartbeat for some stuff. Especially where it comes to "flavor" stuff. NPC's in towns could now have events fired that run scripts that can have them do specific actions instead of relying on Hearbeats to set the condition. You could setup queued Events that fire scripts to go through your merchants and clean them up to your specifications. You could fire queued Events that spawns creatures or perhaps a boss that only spawns at certain times. The list goes on and on.
Truly you are only limited by your imagination. This could revolutionize PW's as it allows them to add variety through timed events.