Wintermute Engine Forum

Wintermute Engine => Feature requests, suggestions => Won't implement => Topic started by: bupaje on December 09, 2007, 06:55:58 PM

Title: Scheduler
Post by: bupaje on December 09, 2007, 06:55:58 PM
I just finished the scene tutorial yesterday so probably premature for me to suggest anything, but hopefully you'll forgive it if its dumb ...

One feature I liked, from a non-adventure game called Tropico, for scripting events was its events scheduler. The system kept track of years, months and days and you could simply add events to any one of the lists (monthly events, weekly events, yearly events) and they'd run. It was something like

CheckFrequencyYearBegin
CheckFrequencyYearEnd
CheckFrequencyMonthBegin
CheckFrequencyMonthEnd
CheckFrequencyWeekBegin
CheckFrequencyWeekEnd
CheckFrequencyDayBegin
CheckFrequencyDayEnd

So you could simply add stuff like this (pseudocode)

CheckFrequencyDayBegin
  Call NightToDay
  Call TurnOnStreetLights

CheckFrequencyDayEnd
  Call DayToNight
  Call TurnOffStreetLights
  Entity1.ChangeColor

CheckFrequencyWeekEnd
  Call AddGold

CheckFrequencyMonthBegin
  If Month > 9 < 12 && PlayerIsOutside
    Call RandomWinterStorms
  Else NormalWeather


CheckFrequencyYearBegin
  If Year 2 Then Call TeleportToHiddenRoom

Hope this makes sense.
Title: Re: Scheduler
Post by: metamorphium on December 09, 2007, 07:05:21 PM
it's easy to script through game daemons. If you're seriously considering implementation of this into your game we can help you here.
Title: Re: Scheduler
Post by: bupaje on December 09, 2007, 07:21:53 PM
Thanks I'll do a search for 'game daemons' and am downloading other code samples from the forum to test out today.

I will probably take a crack at the event scheduler as I get more experience. It appealed to me, for some of the same reason that WM seems interesting, it is possible for a artist type to actually create some interactivity even with limited programming experience. In fact even a total noob could drop self contained "snow" script into their program and call it from an event scheduler like this and be able to walk through their world and view some interactive elements before they even hit the programming very hard.

Looking forward to seeing what this can do.
Title: Re: Scheduler
Post by: Mnemonic on December 09, 2007, 10:12:19 PM
A "daemon" is basically a script which runs in the background all the time and periodically does some work. In combination with the built-in game timer, such daemon script can check if certain amount of time passed and trigger some action.

I know it may sound too complex for a newbie, but it really shouldn't be that hard to implement and therefore such functionality doesn't need to be hardcoded in the engine.