Use an event system for paths. One which orders the events by increasing time to run. Store paths as a circular list. Each mob has a pointer into their path. When an item goes off it advances the pointer and adds the next command into the list. The event system we use keeps track of the events to the second so it works pretty well. Just need to come up with a func that transforms the 75SEC RL into 1HR MUD time. 1.25RLseconds /mud minute. You would also have to alter read_mobile or the function calling it to add the first command to the list. --Angus ______________________________ Forward Header __________________________________ Subject: Peditor. Author: INTERNET:CIRCLE@POST.QUEENSU.CA at CSERVE Date: 3/22/98 7:28 PM Okay, the first beta version was released, and shortly thereafter, I discovered a trillion little errors - wihch is really okay because I eliminated them all with a rewrite. Now though, I have a minor problem.. Originally, because I had to aproximate the time of the event going off anyway, I didn't give much thought to running through the entire character_list (all mobs and people if I'm not mistaken). I'd hit all of them to check to see if they had a path to run during that approximation spread. It was run from within the mobile_activity call, so I didn't think any it already runs through that list all the time... But now, I want to run every mud minute - which is pretty close to every second. I don't want to run through the entire list every second and do calculations on each path I encounter. Currently the only thing I can think of is to make a queue (say every mud day) and check direct comparison between hour and minute to run, and then.... we're still stuck with running through every entry in the character list every second aren't we? Any help? PjD +------------------------------------------------------------+ | Ensure that you have read the CircleMUD Mailing List FAQ: | | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html | +------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/15/00 PST