ID:152327
 
The latter part of the title was just for fun, but this is definitely about time.

This isn't under creations because for one thing, I'm not creating time. I'm only showing my implementation of it, in hopes of getting some ideas and fixes.

Right now I'm just making parts of an RPG I'm going to be making in the future. So this is what I have for time so far...

_Time()
while(world)
spawn() update_seconds(1)
sleep(10)
//-----------------------
update_seconds(var/i)
seconds += i
while(seconds >= 60)
seconds -= 60
spawn() update_minutes(1)
//-----------------------
update_minutes(var/i)
minutes += i
while(minutes >= 60)
minutes -= 60
spawn() update_hours(1)
//-----------------------
update_hours(var/i)
hours += i
while(hours >= 24)
hours -= 24
spawn() update_days(1)
//-----------------------
update_days(var/i)
days += i
while(days > 28) //All my months are 28 days long and there are 13 months so a total of 365 days.
days-=28
spawn() update_month(1)
//-----------------------
update_month(var/i)
months += i
if(month == 13)
Sanguine_Eclipse()//Name of the game and a big part of the story.
while(month > 13)
month -= 13
spawn() update_year(1)
//-----------------------
update_year(var/i)
year += i
if(year % 8 == 0)//Don't worry about this.
update_cycle()//Or this...
//-----------------------


I know it can't be perfect, It only took me a couple min...

Anyone see any problems, or have any questions about the way I'm implementing time.
Now for me to ask some questions:

Is it efficient?

Will it have time to update everything with in one tick?

Any loopholes where the code won't work?

I will make these times shorter so that years could pass by quicker than real life. Whats the best way to go about it?(ie seconds happen twice as fast?)

If you reply thanks in advance.

-KirbyAllStar
You are making such simple mathematical adjustments that it can easily do all that within one tick.

As for matching it to real life or not... as much as I like the idea of a real time roleplaying game, consider that everything else in the game world will be "scaled down" somehow, by necessity. How big is your game map supposed to be? A country? A continent? A whole world? If time flows the same as real time, it should take months (at the least) to cross such a map... but it'll probably take well less than an hour, even if you string multiple large maps together and/or institute a reasonable movement delay.

How long would it take to perform actions in the game world like (assuming these things were planned) researching/practicing a new skill, making a sword, building something, etc.? If time flows at a normal rate, then the fact that these things take far less time than they do in real life becomes more blatantly obvious.
In response to Hedgemistress (#1)
Hedgemistress wrote:
You are making such simple mathematical adjustments that it can easily do all that within one tick.
As for matching it to real life or not... as much as I like the idea of a real time roleplaying game, consider that everything else in the game world will be "scaled down" somehow, by necessity. How big is your game map supposed to be? A country? A continent? A whole world? If time flows the same as real time, it should take months (at the least) to cross such a map... but it'll probably take well less than an hour, even if you string multiple large maps together and/or institute a reasonable movement delay.
How long would it take to perform actions in the game world like (assuming these things were planned) researching/practicing a new skill, making a sword, building something, etc.? If time flows at a normal rate, then the fact that these things take far less time than they do in real life becomes more blatantly obvious.


-Well as of now, I only know that it won't be just one map, it will be an entire world that hopefully be big enough to take hours(in real life of course) to cross with a mount/vehicle. I will most likely put restrictions on making items that would string out the time it would take to make a worthwhile sword or piece of armor. There will be a movement delay on the world map, which will have large open fields and spaces which in-game would seem almost too large but I want it to feel as much like your "in" the world as possible even with the limitations of 2D(3D if you include time...).

Thanks for the input.

-KirbyAllStar
In response to KirbyAllStar (#2)
Okay, but a few things to bear in mind:

The maximum individual map size is 1,000 squares across. If you went with an average move speed of 1 tile per second (which is pretty dang slow and a lot of players won't stand for, even though it's what I'm planning on using for base walking speed in Hedgerow Hall), you could still cross a map of that size in 17 minutes. Put four of these maps linked together in a line, and you'd have a map that would take one hour to cross, at that speed... any faster, of course, and it would take less. To maek it take one hour to cross in any direction, you'd have to make it 4x4... that's 4,000 tiles by 4,000 tiles of detail you have to fill in.

You can make a lot of empty space to represent the fact that yes, life is full of deserts and plains that just kind of go on, but players will become incredibly bored moving across it, especially if you have the hefty movement delay.

If the movement delay is less hefty... like every 5 ticks (two squares per second), then you have to double the width of the map to make it an hour across, which quadruples the amount of area you have to fill in.

And that's just for one hour of travel. If you're talking about two hours, you quadruple the size of the map again, and so on.

I love the idea of a big expansive world, but ask yourself if players will find the feeling of "Hey, this world is huge like real life!" is worth the tedium and time involved in traveling thruogh big empty spaces to get anywhere interesting.

And then you have to consider, is your game going to be mostly solo play, or more based on character interaction? If you have a world that's thousands upon thousands of tiles in size, people will either continually miss seeing each other... or they'll just end up clustered around the interesting locations in between the vast open spaces.

Similar concerns apply to making items: if you make it take literally as long as it takes in real life, players are apt to become bored with the process.

These are the reasons why most games abbreviate or compress things... the empty spaces between the interesting locations are made smaller, the time it takes to do long, tedious tasks is shorter... and the world time as a whole flies by faster, in order to reflect the fact that some of the boring bits are being "skipped over."

An example: Hedgerow Hall (my game) makes one day (24 hours) of game time equal to 2 hours of real time. Roughly one hour for day, and one for night (though sunset and sunrise vary from month to month.) This makes 5 minutes in real life equal to one hour in the day... and three 28 months will pass over the course of a real life week, which then becomes a season... four weeks being a year (though not a 365 day year, of course).

It seems like 5 minutes for an hour is short... you can talk to somebody for five minutes and an hour has passed? Where does the time go! But then... making a high quality sword, a task which should take hours, is over in a matter of 15-30 real life seconds. You can assume that at the end of the day, the time "lost" doing things like talking (which can only be done in real time) is "made up" on the tasks that are over too quickly. I call it "semi-abstract time."

Not trying to sell you on my way of doing things... just showing you some things you may want to consider.
In response to Hedgemistress (#3)
Plains and deserts can get boring, but there are ways which you can work around this. If done correctly, you could make a program to produce a forest of varying density, then save it and modify it as you see fit in the map editor (my pif_MapLoader or IainPeregrine's /dmp_writer could be done for this). You could even include forts, cities, caves, ruins, etc. If you were zealous enough you could program it to randomly generate these as well. An easier way would be to pre-design them and the load them in when the program decides it should.
In response to Hedgemistress (#3)
I love the ideas, I may do something similar to yours but of course different. If I did it that way, I could make the "Sanguine Eclipse" happen every 6 years, although my time would need to be faster than yours because I would want the Sanguine Eclipse to happen on a regular basis.

I'll definitely be taking seconds out of the time, because it wouldn't be able to calculate that fast(I don't think), I'll do the math soon on how fast to update the minutes and such.

Thanks for the ideas, love your posts(Always so informative)!

-KirbyAllStar
In response to KirbyAllStar (#5)
Yeah, with my exact time frame, every six years would only be every 24 weeks in real time. There are some things which'll only happen once a game year, but because the season corresponds exactly to 7 days in real life, players will be able to predict when an important date is going to happen.
In response to Hedgemistress (#3)
Hedgemistress wrote:
It seems like 5 minutes for an hour is short... you can talk to somebody for five minutes and an hour has passed?

I get that effect all the time in real life, so it's not that big of a stretch. =)
Aside with the possibility of that being one proc as Hedgemistress pointed out, you don't necessarily have to mimic world time exactly. For example, you could make 30 seconds in real time equal to 1 to 2 minutes in game time, and then you can just assume that your made up time is the same as real time, and give time based events the same amount of time you would in real life (they would actually take less time because of your shorter time system).

For example. Let's saying a sword would take all day to make. Then, let's say an hour in your game is equal to 2 minutes. Your sword would be done in a little more than 1 hour real life time. That's not so bad. But then again, you could make time even quicker, so it takes less and less time.

You can keep the time it takes to make something or go somewhere the same as it would be in real life, just as long as you shorten the amount of time it takes for that time to actually pass so it doesn't piss the players off that they have to wait 24 real life hours for their sword to be finished.
In response to Jtgibson (#7)
Yeah, for instance, five minutes ago it was 8:55 CST and I was saying, "Okay, I'll go check the BYOND boards for five minutes and then start writing tomorrow's installment."
In response to Koil (#8)
Yeah. The ideal point of abstraction is what makes or breaks a video game. If a game is real time, q.v. Animal Crossing, it should be real time in a fashion that is based on the temporality of specific times and dates, not just for perfect verisimilitude.


(I think I need to dumb down my built-in thesaurus a notch.)
In response to Jtgibson (#10)
Jtgibson wrote:
(I think I need to dumb down my built-in thesaurus a notch.)

Nah, Jus Steart Spking Liek Thise.

I think that as far as time goes, I found that if you make one minute real time equal to one game hour, it would make one day around a half-hour (24 minutes exactly).

As far as the sword example, I would say that if they are making something, let them leave it for a while and come back if they wanted to (maybe they have a penalty if they do leave it).
In response to Hedgemistress (#3)
Hedgemistress wrote:
Okay, but a few things to bear in mind:

The maximum individual map size is 1,000 squares across. If you went with an average move speed of 1 tile per second (which is pretty dang slow and a lot of players won't stand for, even though it's what I'm planning on using for base walking speed in Hedgerow Hall), you could still cross a map of that size in 17 minutes. Put four of these maps linked together in a line, and you'd have a map that would take one hour to cross, at that speed... any faster, of course, and it would take less. To maek it take one hour to cross in any direction, you'd have to make it 4x4... that's 4,000 tiles by 4,000 tiles of detail you have to fill in.

You aren't taking into account obstacles. You're just figuring if you took a straight path across. What if he included forsests, mountains, caves, etc? Then the time it takes could even multiply. Fighting monsters along the way? When you're going to the fast food place or the mall in real life, it'd be good if you can just take a straight path there, right? But there are traffic lights, roads, etc, that you must follow on your route to get there. With these things in consideration it doesn't need to be as massive or as slow as you suggest.
In response to Exophus (#12)
He was describing a map with a lot of wide open spaces, so I assumed absolute obstacles would be minimal. Making the equivalent of an organic maze of things like dense trees and mountains (organic in the sense that it looks like natural landforms, and not straight walls somebody set up to inhibit movement) just multiplies the complexity and time of the map design, though.

As for stopping to fight... if by that you mean something like Final Fantasy where you're beset by random combat every N steps... a lot of people just plain find that tedious.
In response to Hedgemistress (#13)
Hedgemistress wrote:
As for stopping to fight... if by that you mean something like Final Fantasy where you're beset by random combat every N steps... a lot of people just plain find that tedious.

*raises hand*

That's one of the things I dislike most about FF7 (the only Final Fantasy game I've ever played, and am ever likely to play). You're wandering along minding your own business, and BAZAM! Suddenly a pack of sentient motorbike creatures teleports to your position and attacks. What the?

To make matters worse, battles were BORING. And you couldn't speed them up because the "active time battle" system (Just like a normal turn-based battle, but now with 200% more tedium!) forced you to wait a given amount of time between moves. Contrary to the name, I was never particularly active during such battles.

The battle animations and sounds were merely ho-hum the first time, but after I'd seen and heard them 50 times (because there are no variations and they're unskippable) I had a mad urge to gouge my eyes out with a rusty nail just to introduce some variety.

Bad game designer. No twinkie.
In response to Hedgemistress (#13)
Hedgemistress wrote:
As for stopping to fight... if by that you mean something like Final Fantasy where you're beset by random combat every N steps... a lot of people just plain find that tedious.

Well, I really had in mind if it was a hack 'n slash RPG, but if it were a turn-based one with random encounters then I would definitely not have a big map, unless it's all filled with content and everywhere players go they have something to do(IE, a boss, a quest, etc).
In response to Hedgemistress (#3)
One thing I will say is that the map doesn't have to be large to take time to cross. Your breakdown involves a player simply holding a direction until they get to their destination.
However something like a forest with rivers and such can take a while to navigate through without a set path (just make sure to give them a map!). If done wrong it's a massive pain in the butt, but if done right you can put all sorts of interesting obstacles in the players way. The key is to make them interesting but not so interesting that they get old. Ie, a swamp thing jumping out with dialogue is interesting the first time but not so much the seventh time when you're just trying to get from point A to point B.



Quick travel is also a must in an super large world. Don't bother avoiding it, it just makes it so that when you eventually break down and add a quick travel system it's rushed and not very good.