Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

eharper256's Dynamic Time System VERSION 5.1!!

Dynamic Time System
UPDATED TO VERSION 5.1!!
By eharper256


Hello all, this is a EVENT Based Dynamic Time System that I created. It was created to meet my needs for an adaptable time system which weren't catered for by the currently available systems, scripting based or otherwise. I wanted the ability to alter the speed of times flow, like Calderons time, the adaptive weather of punkids system, and, most importantly, the ability to fiddle with the time of day at will without screwups and have it tell other events via a simple switch whether it was Night, or bad weather, or suchlike.

Features
  • Keeps track of minutes, hours, days, weeks and years through easily alterable variables. As a result of this, you can easily implement things like Inns that add 8 hours to the clock, and such...
  • Automatically checks if its night-time; and if it is, pulls a switch. You can have things like shops closing at night and such through this.
  • Set up default values for the time, like the AMS; and reset them to this value at will by a simple switch pull (hey I can do a Majoras Mask with this and return to the beginning, LOL).
  • Change the speed of times flow by altering a variable. This achieves an effect similar to Calderons Time; you can have time speed by quicker when on the World Map, for instance, or go slower in the Snowfield of Death. There are 5 settings for time flow by default (Normal, Fast, Faster, Uber-Fast and Slow).
  • Changes screen tone according to the hour; and changes it differently whenever one is inside, or when the weather is bad.
  • But there is the easy option to Switch the screen tone change off whenever you need to, whilst keeping time flowing in the background. Useful for cutscenes and places with unusual light conditions.
  • Support for Ccoa's Weather. Checks the weather every hour of game time based on Seasonal evaluation.
  • Much, Much, Much better weather support in version 2! The weather change is no longer quite so random; but more reliant on seasons and their individual likelihood of generating high/low pressure fronts. The system can be turned off at will.
  • Additionally, the weather now works in the same fashion as the tone changer; running then turning itself off every game hour. This has required an additional switch to be added to the line-up, but as a result the whole affair is much more stable and is also less laggy.
  • A final weather based addition: automatic application of appropriate BGS; which stays on (though lessens in volume) when you go inside. This feature is also easy to disable if you want your own BGS.
  • Also, a stupid bug in the demo was quashed. It continued to rain inside because of my lazy event programming before.
  • Much like the night-time check, theres a check for bad weather that pulls a switch. You can have people react differently to bad weather.
  • No big daft clock hangin' around onscreen all the time. I figure that most fantasy characters don't really have digital watches, in any case. ':| As of 5.1, still no big daft clock, HOWEVER, there is a toggle-able time & date window. See below.
  • However, you can tell the time at any time (tongue twister!) by simply calling a common event. This way, your characters can still look at the town clock or use a personal sundial, or something. This clock calling event has support for Dubealex's AMS by default, so the time shows up in a clear text box rather than a message; but if you don't have that, you can remove dependancy on it easily by a quick event modification. (I'm sure its easily changable to Ccoa's UMS as well, but I don't have that)
  • Finally, because of the separated events and conditionals, it does not lag at all. (At least it doesn't on my old laptop, which is a 1.6 GHz Athlon)

Version 3 Adds alot of cool new features!
  • Due to popular demand, I added a feature called FastTone. People didn't seem to like the fact that the tone change was slow when switching between inside and outside. This feature addresses that; it should detect when it is needed, and then make the tone alter considerably quicker.
  • SpecialLight was added. Previously, when you wanted to use a special kind of light not conductive with the typical day/night effect, you would have to apply the Tint Fixer switch and do it manually. SpecialLight addresses this problem by offering a standard library of unique lighting conditions, defined from within the Tint Changing Common Event. Therefore, you can define your special light type there, assigning it a variable value. Then, whenever you need to use that light type, you call upon it in a snap by simply setting the variable to your desired value, flipping a switch and then raising the Tint changing FLAG as normal. The Tint changer will then recognise the need for your Special Light; and it will usurp the typical Day/Night Tint whilst still letting time run and recognising the difference between day and night.
  • Special Light currently has the following default conditions programmed into it: Dark Cave, Sewer, Crystal Caverns (Blue and Purple), Icy Cavern, Fiery Cavern and Forested Canopy. You can add additional types if you have a reasonable proficiency with event programming.
  • Time Based Lighting was added. This basically allows the system to utilise the unique symbiosis of Time and Tint in ways besides the standard day/night cycle. As a result, you can add considerable amounts of atmosphere to your game with very little effort! For example, you can have a eerie dungeon with a pulsating light effect, or have the effects of thunderclaps with lightning flashes without the rain for that mad professors hideout.
  • Time Based Light currently supports the following unique conditions: Slow Strobe Light, Pulsating Light, Intermittant (Flickering) Light, Disco Lights :D , Battlefield effect with explosions, Underwater effect with bubbles, and Lightning Flashes for interiors. If you can think of other effects you'd like, post 'em here and I'll see what I can do.

Version 4 Adds some pretty funky new stuff also!
  • Now using Ccoa's Tileset swap script, the Dynamic Time system can automatically adjust the tileset for you depending on the season! This allows a switch to new tilesets to show the effects of winter, autumn and such more dramatically. In order to utilise this feature, simply adjust the tileset values for seasons in the configuration event. By default, Spring will use the default selected tileset, Summer will add +50 to this number, Autumn will add +100, and Winter will add +150. Hence, if you wanted versions of the RTP grasslands to change season, the spring version would be Database Tileset ID 1, Summer 51, Autumn 101, Winter 151 etc.
  • As mentioned, better customisation was my main goal for this version. To achieve this, the system now makes use of Script Arrays which are fully customisable in the setup event. For example, previous versions didn't recognise the difference between weekdays, and all months were always 30 days long. But no longer! The arrays allow the system to store both important numerical and string related data like the names of weekdays, the lengths of months, etc. without having to use further variables and switches. In a nutshell, this means the system now fully recognises the Date, the Day of the week and the month, and these things are fully changeable to the game-makers needs.
  • By fully customisable, I mean it! You can decide for yourself how many days are in a week, what those days are named in your world, how many weeks are in a month, how many months are in a year, how long each of those months are, and what each of those months is called!
  • As a result of the above change, the Time-Telling common event from before is a little bit more advanced; incorporating a calendar. Hence now when you call the common event that tells you the time, you not only recieve precise information on the time, but also learn what the date, day of the week and month are. Example: "Its 12:31pm! And its Tuesday the 15th of February, 2009!"
  • Another slight change: I've supplied a couple of fogs for this release, which are utilised by The Weather Generator to create further atmosphere. Like all of the other, similar, features, you can choose to deactivate this at will.
  • And finally, this version incorporates the mod I did a while back for Grimreaper; more extensive day period decision. The system automatically pulls switches when its Early Morning, Late Morning, Afternoon, Evening and Night. While this neccesitates a chunk of extra switches; you can use these switches as a comprehensive basis for creating fully scheduled NPC's (i.e. they go shopping in the morning, then go to work in the afternoon, then to the pub for the evening, then into bed for night)
Version 5 Adds THIS Stuff!
  • Stupid Bugfix Sorry guys, version 4 caused stupid errors with savegames due to '[]' not being defined. I didn't notice this until about 3 months after I released since I was using an outdated version 3.5 in my game until then. Then again, no-one gave me any feedback on the issue either...
  • Its gone partly Script-a-licious Partly in order to more easily quash the above bug, and partly to tidy things up a bit, the global settings of the DTS now have their own script class, $JT_DTS.
  • Phased Lighting. The main new feature. Technically an upgrade for the ol' Special Light thats been with the system since V3. Are all caves universally dark throughout? Do you see the glow from lava even on the next floor? Do rooms stay dark even with the lights on? No, of course not. Whilst it is not truly possible to model the advanced lighting of modern games in base RMXP, I thought of Phased Lighting to be a buffer of sorts. Basically, whilst Special Light may provide a 'library' of effects, Phased Light takes this a step beyond and offers the user controlled change of circumstances.
    Change a variable, raise the usual flag, and the properties of the area's light change to match your predefined options. Got closer to that lava? Then make the red saturation of the screen go up! Close to a caves exit? Then it should be brighter, right? Phased Light should be able to do this to create even better atmosphere.
    The DEMO only includes the Fire Cavern Phases. Since I can't anticipate how everyone is gonna want to use various phases, its up to you to actually make them and place them into the Tonal Change event. So this is an intermediate feature; you'll need a small modicum of event programming skill to make it happen.
  • World-Map-Time An additional setting for the time flow module thats been around since the beginning. This changes how the time flow operates from the usual frame based operation to a X-Y co-ordinate operation. In a nutshell, this means every time you move a square on a map, X amount of minutes instantly pass; but time is frozen when you're standing still. This is obviously meant for maps like world maps, where simulating the time it takes to travel large distances is beyond the capabilities of the normal time flow engine: crossing a country should take days, not minutes, after all.
  • Torches that deplete over time. I've had this one on the back burner for a while. Its still not up to my expectations, however, since it has a tendancy to lag behind the player. Lazy light, if you like, lol. Still, irregardless, I'll probably include it in this release. Its now much better since I made it based upon SephirothSpawns Torches, and changed some of the settings, fogs and graphics. It also supports flashlights at a remove, but you'll have to enable those manually.
  • Pre-defined days (holidays, holy days etc.) A Calender addition. Though we've had days of the week already, what if you wanted special stuff to happen in your game on certain days? So it happens to be a festival day in the game, and you want a market to be in town on this day only, etc.
    That said, its up to you actually take a special day and use it so, making this also an intermediate feature.
Version 5.1 Just adds the watch feature!
  • Watch/Dynamic Time Window Initially created by robot79796, this allows a clock and calender to displayed as a window at the top left hand part of the screen, which dynamically updates itself, and like many parts of the system, can be turned on and off at will with a switch.

The Watch & Calender window
Withthewatch.jpg


Worldmaptime in action
Worldmap1.jpg

Notice the fairly short (map-wise) distance to the junction.
Worldmap2.jpg

A fair while has passed getting there, as travelling a world map should do.
Worldmap3.jpg


Phased Light in action
PhaseLight1.jpg

PhaseLight2.jpg

PhaseLight3.jpg

PhaseLight4.jpg


More seasonal stuff
Seasonal1.jpg

Seasonal2.jpg

Seasons
Spring
DTSSpring.jpg

Autumn
DTSAutumn.jpg

Winter
DTSWinter.jpg

Night
DTSNight.jpg

Disco! (looks better in motion)
DTSDisco.jpg

Underwater
DTSUnderwater.jpg

Get the !Updated! Version 5.1 Demo from RAPIDSHARE here:
http://rapidshare.com/files/119548714/DTS-V5-1.exe
Or Get the !Updated! Version 5.1 Demo from MEDIAFIRE here:
http://www.mediafire.com/?fue1fzmjify

Want more mirrors? Just ask!

Get the !Updated! Version 5 Demo from RAPIDSHARE here:
http://rapidshare.com/files/118540685/DTS-V5.exe

---------------------------------------------------------
--------Using Version 4 is not recommended: It has an issue with Savegames...---------
Get the !Updated! Version 4 Demo from RAPIDSHARE here:
http://rapidshare.com/files/38525076/DynamicTime4.exe
Or get the !Updated! Version 4 Demo from MEGAUPLOAD here:
http://www.megaupload.com/?d=AWO9KRTM
--------Using Version 4 is not recommended: It has an issue with Savegames...---------

---------------------------------------------------------
Get the !Updated! Version 3 Demo from RAPIDSHARE here:
http://rapidshare.com/files/26498482/DynamicTime.exe
Or get the !Updated! Version 3 Demo from MEGAUPLOAD here:
http://www.megaupload.com/?d=ZYNSY6ZX[/SIZE]
Or get the !Updated! Version 3 Demo from the RMXP download manager here:
http://www.rmxp.org/forums/downloads.php?do=file&id=832

---------------------------------------------------------
The Old Version (Version 2) is also still available on Rapidshare Here:
http://rapidshare.com/files/16561109/DynamicTime.exe
OR here from the RMXP.org Download Manager:
http://www.rmxp.org/forums/downloads.php?do=file&id=481
---------------------------------------------------------

Enjoy; and feel free to use it in your games with credit.:thumb:

NEED HELP?? Here's a F.A.Q.
Q: How do actually go about adding this to my RMXP project?
A: Check out the Addition Guide I wrote:
viewtopic.php?f=7&t=14739&p=457573#p457573

Q: What the hell do all the switches and variables do?!?
A: Lots of stuff! Studying the comments I made will typically tell you all you need to know.
But, if you want a quick summary of what each component does, check this below post:
viewtopic.php?f=7&t=14739&p=514866#p514866

Q: Does it work with VX?
A: No, sorry, it probably doesn't. But I can't check since I've not had the moolah to buy VX.

Q: Does it work with the SDK/MACL etc.?
A: Yes. It hardly involves any scripting at all, so it'll co-operate with these scripting devkit things without any issues, as far as I'm aware.

Q: I have another question not listed here!
A: Fire away. I'll probably answer. But I'm a lazy & busy git, so don't expect an awesomely quick reply. Sorry.
 
Yeah its a bit crazy, huh? But there are 999 variables in RMXP. Hehe...

I suppose you ~could~ instead try to make a very clever chain of common events to avert the use of so many variables. But even I wouldn't know quite where to start with that. I could probably figure it out eventually, mind you. It would be easier if it just kept time to the day or something. Or if it tracked 3x3 areas. But I guess it wouldn't properly communicate the Harvest Moon feeling then...
 
I'm sorry if this was already explained and I just didn't see it (I read the mian post pretty well but mostly skimmed the rest).

Is there a way that I can swap between a set time with set weather effects etcetera, and the dynamic time with all the day and night cycles etcetera?
The reason is that the game starts out in the main character's home town, and most of the quests there are rather time specific. For example, you are meant to go and take the exam as the first quest--it wouldn't do to have three days pass as you explore the village before heading to the school house...

After the inital part of the game, I would swap over to the Dynamic time system, replacing detailed charactes who your's knows with strangers who react to the weather and goings on appropriately. However, I may very well wish to turn this off at times during certain quests (and sometimes have it turn on again when you're on the world-map, where you have a set time limit).

Thanks very much. And GREAT JOB with this system!
 
I'm having a problem with this system with the lighting system here. I'm trying to write an event that'll light a torch. It'll do that but it keeps setting the tint to Red. I can't find what's causing it.
 
TheCableGuy":33q497de said:
I'm having a problem with this system with the lighting system here. I'm trying to write an event that'll light a torch. It'll do that but it keeps setting the tint to Red. I can't find what's causing it.
While I'm not really qualified for answering this: Do you mean a orangey-red tint or a crimson-red tint? Torch-light, I would suppose, would have a orangey-red tint to the light it makes.
 
Conners":78qaw3ws said:
While I'm not really qualified for answering this: Do you mean a orangey-red tint or a crimson-red tint? Torch-light, I would suppose, would have a orangey-red tint to the light it makes.

Well, It's Red. not really Orange. All I know, it's not what the code I put in is suppose to do and it doesn't look like Torch-light (otherwise, I wouldn't care.) Looks more like the Lava light.
 
He's checking, but he is just being a slacker at it...(and yes, I can abuse him...I "work" for him. coughbetatestcough) He's just had a lot of stuff going on lately, but I should be able to help answer your question. the easiest way to do it, would be to get a screenshot of what's going on in your event. Could you post one please?

@ehaper - I'm in another one of your threads, stealing more of your posts!

~xgamexfreakx
 
The problem is, it isn't for a specific event. The first few chapters of the game are about your hometown and quests that generally you can't take all the time in the world over story-wise. For example, you have to go to today's exam as the first quest... If I could just slow down the game time to real life time then it could work out--people are unlikely to take five hours to explore the town.

I will want the system working as it normally does for other towns. Their behaviour in reaction to the environment will replace the detailed characters of your home village--after all, you don't know these people, so why should you be entering their houses and talking to them xD?

So... is there a way to turn off the system then turn it on again?

PS: The link to the Guide thread isn't working. Could you please re-post it?
 
ok, well I have to get off so I don't have time to test this, but, it should work.

*This will require you to make modifications that shouldn't be made to this so if it crashes, replace the script and I'll fix it later.*

In the script,
JT's DTS Setup find the line of code,

Code:
  $timeflowspeeds = [40, 20, 10, 5, 60]

change the number 60 to some massive number. The sixty says that there are sixty frames per minute. So I'd change it to something like 999 to be safe. This should give the player a substantial amount of time to walk around the map and explore.

Then in the common event #21, Time Flow, you want to change variable 140 to 4. That should get it to go really slow in your game. Then when you want to change it back to regular time, you want to do an in-game variable of variable 140 back to 0 for standard time.

Hope this helps!
~xgamexfreakx
 
Hmmm... The latter part seems a little complex, but it isn't anything I can't handle. I'll make sure to try it out with the time system. Thanks muchly xgamexfreakx :D!!

This is off-topic, but... I've updated the "Making the XP Combat System Deeper" thread with a new subject. I was wondering if you'd be interested in checking it. Here's the link to save you trouble if you are: viewtopic.php?f=7&t=59456&p=599253#p599253
 
yeah, let me know if it works. I'll look for a way to actually turn it off so that you can use that way instead. If you need any help let me know!

~xgamexfreakx

EDIT: Well, My mind just kinda sparked at something. Do you need the time system at all those first few chapters? If you don't, then just don't turn it on till you need it.

EDIT2: Ok, so while looking back over things, I may have just really messed up something...In the common event, don't touch anything....all you have to do, is when you start your game, change variable 140 to 4 and it should work fine...
 
Haven't tested it yet.


It depends... I could just make the time rate more similar to IRL time so that there's plenty of it for exploring, and give the player a time limit for certain tasks. Or, I could just leave it off then turn it on later... that was what I was originally asking for, come to think of it :p. Is there a specific way to turn it on/off that I should know about?

Good thing I decided to wait a while first. Thanks for warning me.
 
Well, if you don't use it at all until later in your game, don't even turn it on. Once it's on though, turning the thing off is another story. I'll look into that in a bit. I'm working on some battle add-ons right now. As soon as I finish, I'll do this. Hopefully tonight sometime...
 
This isn't too difficult to install. Just copy over all the scripts (above main, but below everything else) then copy all the variables (just copy paste the names from one game to the other. [to do this, you would open up a change variable command in both, go to the the variables are and copy them over, and make sure that all the numbers stay the same]) then you would do the same thing with switches (same as variables) then finally copy over all of the common events. Just make sure that when you copy anything over, it stays in the same order and the numbers (like variable 145) stays with the same number. (so when you copy the name from variable 145 over, make sure that it goes to variable 145 in your game). If you really need it, I'll make a new instruction guide with pictures and all and put it up on here. but this really isn't all that difficult.
 
Sorry I've been dead for awhile and only just ressurected. Or something.

arcticprism, I've replied to your PM. Thankyou for pointing out the broken link to the install guide. It was always there, just marooned, since RMXP.net apparently broke a whole swath of links recently.

Conners, sorry about the stupendous delay. Don't touch anything in the Time Flow part of the common event, because there's a huge web of things which point to it.

To slow time, go to the DTS Setup script,
$timeflowspeeds = [40, 20, 10, 5, 60]
Change one of them to a high number, as xgamexfreakx says, then change the timeflow speed Variable (140) in game/with an event/or change the default using the script. The above numbers correlate to 0, 1, 2, 3, 4. So if you want the last speed (60), set that variable to 4.

As noted, this is literally the numbers of frames in a game minute. 40 Frames is roughly 1.2 seconds. So, if you want a minute to literally be a minute, you should set one of those values to 1920 frames (!). Though I've never tried inputting such a large value before, it should be fine.
 
Thanks a lot for the reply(and getting the guide up). I was able to get it working with the guide. I have one more question though. How do I get the clock to work? The window for it appears, but it's empty.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top