Please login or register.

Login with username, password and session length
Advanced search  

News:

Forum rules - please read before posting, it can save you a lot of time.

Author Topic: Scheduler  (Read 8839 times)

0 Members and 1 Guest are viewing this topic.

bupaje

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 5
    • View Profile
Scheduler
« 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.
Logged

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Scheduler
« Reply #1 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.
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

bupaje

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 5
    • View Profile
Re: Scheduler
« Reply #2 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.
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Scheduler
« Reply #3 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.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave
 

Page created in 0.02 seconds with 25 queries.