Page 1 of 1
Simulating the passage of time
Posted: Fri Jan 29, 2010 9:07 pm
by OldRod
My game is growing slowly and becoming more than I thought it would. I would like to add a calendar now, so that I can simulate the passage of time.
Characters will age (although you won't die of old age) and certain events will happen as time moves, etc.
I'm assuming this will require the implementation of a tick system and probably a cron to update it? Or is there another way?
Re: Simulating the passage of time
Posted: Fri Jan 29, 2010 10:07 pm
by Jackolantern
Could you not figure out a formula to truncate the real-world time into the format you want it in? This could be done with the time() function and some formatting, and would be much less taxing than implementing a tick with crons.
Re: Simulating the passage of time
Posted: Fri Jan 29, 2010 10:24 pm
by OldRod
That's what I'm wondering... if there's a better way than a cron?
I suppose I could just store a start time for the world calendar some place permanent, and then just update everything from that initial start time...
Re: Simulating the passage of time
Posted: Fri Jan 29, 2010 10:29 pm
by Jackolantern
Ohhh, yeah, I see what you mean for the calendar. You would need to have one master calculation to increment the date. Yeah, I guess a crons would be the best way I can think of. Depending on how you wanted the dates to run in your game, there probably is some way to work it out with a formula on a player-by-player basis, though.
Re: Simulating the passage of time
Posted: Sun Jan 31, 2010 10:50 am
by hallsofvallhalla
you could still use normal time without a cron. Just setup the start time int he database and have everyone's character age checked when they log in.
Example, you start the server at 1pm on Monday. Characters age 1 year every 24 hours. I sign up on tuesday at 5pm. I am 0 years old
so I log in at wednesday 6pm and the log in script checks how much time has past since my first sign up, 25 hours, i am 1 years old. then it checks the server start date. 49 hours, the world is 2 years old. It updates the appropriate settings for the players page.
Re: Simulating the passage of time
Posted: Mon Feb 01, 2010 1:06 am
by towcar
Have a weather forcast that is connected to real life weather forcast. That way in the later months its colder, other months its warmer etc

Re: Simulating the passage of time
Posted: Mon Feb 01, 2010 2:38 am
by ZeroComp
@towcar That is somewhat the idea of some mmorts's but they have random weather like if its raining you get more wheat or if its scorching hot your workers quit early causing resource production to go down and in an rpg I think you could come up with some pretty sweet idea like if its raining or snowing it cost more turns to travel etc etc
Re: Simulating the passage of time
Posted: Mon Feb 01, 2010 5:11 am
by Jackolantern
@OldRod
I may have an alternative for you to use outlined in
this thread. I actually used your case as an example

It is an alteration on the "On view" method.
Re: Simulating the passage of time
Posted: Mon Feb 01, 2010 10:06 am
by OldRod
I just saw that thread. I'll be checking it out, thanks
