View Single Post
Old 03-05-2005, 10:30 AM   #2
Rhuarc
Member
 
Join Date: Jul 2003
Posts: 50
Rhuarc is on a distinguished road
In MudCore, I decided to have both a game loop, and an event system. The primary reasoning behind this was that many things happen all the time, (such as time passing, getting hungry, etc), and so are not best suited for events, while other things happen only occasionally (you are jumped by a mob), and do make sense to happen as events. So, in MudCore at least, events happen outside of the normal game loop, and may interrupt it, depending on the event.

As far as data structures go, I decided to use a simple list to hold all of the events, as I would be adding and deleting events very often, and lists are best suited for that. Also, I don't have one big list of events to search through, but rather each object that can receive events has their own list, so I don't have to search through a ton of events just to find out that the actor in question does not have any events to act on.

MudCore is also C++, and one important aspect of our event system is that actors can override the event handler, so that two different actors can treat the same event differently.

You can read more detailed information about our Event system in the (outdated, sorry) MudCore doc by logging in as 'guest' (password 'guest') to our perforce web at and opening the //depot/MudCore/Main/Doc/... folder. Select the "MudCore.pdf" file and select "Open head revision in Browser".

(This link should work also...)
Rhuarc is offline   Reply With Quote