1. Time System & Day & Night

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.

new topic     » topic index » view message » categorize

2. Re: Time System & Day & Night

Hello Andy,

I'm not sure what you mean.
Could you rephrase it?

Cheers,

Salix

new topic     » goto parent     » topic index » view message » categorize

3. Re: Time System & Day & Night

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.

new topic     » goto parent     » topic index » view message » categorize

4. Re: Time System & Day & Night

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.

new topic     » goto parent     » topic index » view message » categorize

5. Re: Time System & Day & Night

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.

new topic     » goto parent     » topic index » view message » categorize

6. Re: Time System & Day & Night

You should probably start by defining your game. :)

new topic     » goto parent     » topic index » view message » categorize

7. Re: Time System & Day & Night

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

new topic     » goto parent     » topic index » view message » categorize

8. Re: Time System & Day & Night

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

new topic     » goto parent     » topic index » view message » categorize

9. Re: Time System & Day & Night

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.

new topic     » goto parent     » topic index » view message » categorize

10. Re: Time System & Day & Night

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

new topic     » goto parent     » topic index » view message » categorize

11. Re: Time System & Day & Night

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.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu