Event Scheduling

by Stephen001
A library to provide global and local game events management and scheduling. [More]
To download this library for your Linux/Mac installation, enter this on your command line:

DreamDownload byond://Stephen001.EventScheduling##version=13

Emulator users, in the BYOND pager go to File | Open Location and enter this URL:

byond://Stephen001.EventScheduling##version=13

1001 downloads
Version 0.6.2
Date added: Jan 28 2011
Last updated: May 17 2014
19 fans
Event management deals with the problem of having recurring "events" in a typical game. These might be day/night cycles, timed buff effects, auto-expiring traps etc.

Commonly in BYOND you would implement these by using spawn(), delaying appropriately. The issue this has is this places the procedure into the care of the BYOND scheduler, where it cannot be subsequently cancelled until it executes. Many spawn()ed procedures place an un-necessary burden on the BYOND scheduler, which has other duties to perform.

Having a separate event scheduler (or many) written in DM allows the programmer more flexibility on what gets executed, what can be cancelled, freezing all events that are scheduled and so on. This library provides a general mechanism to do just that.

Please bear in mind this library is new, and will develop a more rounded set of features as time progresses.

The library currently supports the following:
  • Scheduling events
  • Cancelling events
  • Starting and stopping schedulers, to "freeze" event firing
  • Events scheduled in multiple schedulers at once
  • Re-scheduling events
  • Event priority (the higher the priority, the more important the event)
  • Some common event types, such as Periodic Timers


Dependencies

This library depends on the following libraries, and requires that you download them first. An include.txt file is provided, so if you download via the BYOND pager, these are automatically included:

Comments

Stephen001: (Jun 7 2013, 6:09 am)
I suppose I could provide something of a testimonial's section also http://www.byond.com/members/ Valekor?command=view_post&post=110521&first_unread=1
Magnum2k: (Jun 7 2013, 6:02 am)
You should also make a post on how to properly use this library and the benefits you get from it, with maybe a demo portraying everything you've talked about?
Stephen001: (Jun 7 2013, 5:58 am)
Mmm yeah, but you wouldn't use the library as that, particularly. It's implementation contains a priority queue, which isn't really the same as providing one to library users.
Magnum2k: (Jun 7 2013, 5:57 am)
You can add a 'data structure' tag. Since events are priority-based, you can essentially say it can serve as a priority queue, which is a data structure.
ExPixel: (Jun 28 2011, 3:18 pm)
Great.