1. Time System & Day & Night
- Posted by Andy <videogamefreak101 at ho??ail.com> Aug 14, 2007
- 502 views
Hey Guys, How would you go about coding a day and night system with a time system, like a time system with day and night that'd you see in an RPG game or the obvious GTA games.
2. Re: Time System & Day & Night
- Posted by Salix <salix at free?ail.?u> Aug 14, 2007
- 495 views
Hello Andy, I'm not sure what you mean. Could you rephrase it? Cheers, Salix
3. Re: Time System & Day & Night
- Posted by Andy <videogamefreak101 at hotmail.?o?> Aug 14, 2007
- 497 views
I wanna make a time system. That has seconds, minutes and hours. It would count to 60 seconds and then start counting minutes, once it 60 minutes the hour would count one, bascilly it would be like real-life time system. Also I need to know how to make it change from day to night and back again. I hope that clear's thing's up.
4. Re: Time System & Day & Night
- Posted by c.k.lester <euphoric at ckl??ter.com> Aug 14, 2007
- 497 views
Andy wrote: > > I wanna make a time system. That has seconds, minutes and hours. It would > count > to 60 seconds and then start counting minutes, once it 60 minutes the hour > would > count one, bascilly it would be like real-life time system. Also I need to > know > how to make it change from day to night and back again. I hope that clear's > thing's up. A time system will work differently based on what type of game you'll be creating. If you are making a turn-based RPG, then obviously time will advance at the interval you set for each turn, whether it's 10 minutes each turn or 1 hour. You will just need to determine at what time you want your sun to rise and set. For a real-time simulation, time will run without interruption, but it doesn't have to mean 1 sec of game time equals 1 sec of game time. You could easily have time advanced at 1.5 times normal. You'll also want to advance time when (if) a character requires sleep. For a RTS, you will use a threaded timer. Displaying "day" and "night" is a whole 'nother question with a whole set of its own variables.
5. Re: Time System & Day & Night
- Posted by Andy <videogamefreak101 at hotmail?com> Aug 14, 2007
- 492 views
- Last edited Aug 15, 2007
Do you guys think you get started get me started, by giving me a small example or at least give me idea with some code, to get me off my feet.
6. Re: Time System & Day & Night
- Posted by c.k.lester <euphoric at ckle?ter?com> Aug 14, 2007
- 498 views
- Last edited Aug 15, 2007
You should probably start by defining your game. :)
7. Re: Time System & Day & Night
- Posted by don cole <doncole at pac??ll.net> Aug 14, 2007
- 508 views
- Last edited Aug 15, 2007
Andy wrote: > > Do you guys think you get started get me started, by giving me a small example > or at least give me idea with some code, to get me off my feet. Hello Andy, See, http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=moredates It has all kinds of time routes. Including count down to an event and and time passed since an event. Run it and see. Don Cole
8. Re: Time System & Day & Night
- Posted by don cole <doncole at pa?be?l.net> Aug 14, 2007
- 490 views
- Last edited Aug 15, 2007
don cole wrote: > > Andy wrote: > > > > Do you guys think you get started get me started, by giving me a small > > example > > or at least give me idea with some code, to get me off my feet. > > Hello Andy, > See, > <a > href="http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=moredates">http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=moredates</a> > > It has all kinds of time routes. Including count down to an event and and time > passed since an event. Run it and see. > > Don Cole Now that I look at it I'm going to have to go back and upgrade. Don Cole
9. Re: Time System & Day & Night
- Posted by Andy <videogamefreak101 at ho??ail.com> Aug 14, 2007
- 496 views
- Last edited Aug 15, 2007
Well I haven't started on the game yet. I just want a game clock, that counts the seconds, minutes, and hours. I need to be something like this. 00:00 like that and it would count and so on.
10. Re: Time System & Day & Night
- Posted by Bernie Ryan <xotron at blu?f?og.com> Aug 14, 2007
- 483 views
- Last edited Aug 15, 2007
Andy wrote: > > Well I haven't started on the game yet. I just want a game clock, that counts > the seconds, minutes, and hours. I need to be something like this. > > 00:00 like that and it would count and so on. Andy: Here are more clocks than you will ever need. http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=digital+clock Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan
11. Re: Time System & Day & Night
- Posted by c.k.lester <euphoric at ckle?te?.com> Aug 14, 2007
- 502 views
- Last edited Aug 15, 2007
Andy wrote: > > Well I haven't started on the game yet. I just want a game clock, that counts > the seconds, minutes, and hours. I need to be something like this. > > 00:00 like that and it would count and so on. You still need to establish a lot more information. DOS? Linux? Windows-based? Cross platform? I guess somebody could make a generic timing lib that simply output a time for you. It would need something like this: type time_sequence(sequence s) return length(s) = 6 end type time_sequence time_now time_now = date() procedure run_clock(time_sequence s) -- start the clock advances at the set interval -- s will be a sequence indicating how quickly to advance each interval -- in one second. for instance, {0,0,1,0,0,0} means time advances one -- day (24 hours) in each second of real time -- use {0,0,0,0,0,0} to stop the clock end procedure procedure set_clock(time_sequence time_to_use) time_now = time_to_use end procedure function get_time() return time_now end function I don't know how to set up the threaded stuff so that the timer advances but allows other funcs/procs to do their thing.