Black Noise

Veteran
Veteran
Joined
Aug 23, 2012
Messages
94
Reaction score
20
First Language
English
Primarily Uses
RMMV
Hi.
For my RPG Maker MV project, I'm developing a rather elaborate Day/Night cycle.
Unlike most games that run on condensed in-game hours that consist of maybe half or so minutes,
I'm trying out a more realistic Day/Night Cycle that runs on actual 60-minute hours.

To elaborate on this, I took a similar event-based time system from SumRndmDde... ...and expanded on it.

I created a parallel-running common event that runs like this...
  • Wait 1 Frame
  • Add +1 Millisecond variable
  • When 60 Milliseconds are added, add +1 Second and reset Milliseconds.
  • When 60 Seconds are added, add +1 Minute and reset Seconds.
  • When 60 Minutes are added, add +1 Hour and reset Minutes.
  • When 24 Hours are added, reset Hours.
Meaning, literally time runs as slow as in real life.
I had the cycle to also process milliseconds because, especially when using events that skip time (i.e. resting at an inn or fast travelling) by adding extra units of time, since I found to allow the game to processes the change considerably faster
Now that was the easy part.

The hard part is getting the game to change screen tints according to the time of day right.
The game would transition to a brightly yellowish tint in the morning, gradually subside for no tint at all when daytime comes
and get darker as night time arrives.

The first problem I came across, which I easily solved is tied to events that would allow the player to skip time (i.e. resting to restore health or fast travelling). I divided the whole day into six phases...
  1. Dawn: 03:00 to 06:00
  2. Sunrise: 06:00 to 09:00
  3. Day: 09:00 to 15:00
  4. Sunset: 15:00 to 18:00
  5. Dusk: 18:00 to 21:00
  6. Night: 21:00 to 03:00
I wanted the game to gradually transition between screen tints when the clock strikes the very first hour of the phase.
For example, as soon as the clock hits 18:00, it starts getting dark.

While testing it out, I found that this gradually change happens when the clock is already far into the phase. You would still see gradual change to a dark tint when you skip to 23:00 when it should already be dark by then. I fixed that by creating a conditional branch that will only gradually change the screen tint as long as the minute count is 0. Any further than that, then any skips you make will make the tint change instantaneous.

Although I did discover a little problem in which, even if the screen tint is in the middle of a gradual change, it will instantly change to the next tint as soon as the clock makes it past 1 minute.
Another problem I encountered, which I tried to fix but to no avail is that if you were to skip time by several hours (Let's say skipping hours from 09:00 to 18:00), the game would display the screen tint it showed then before changing to the new current phases screen tint.

When the game should've been showing the warm, reddish tint of Sunset, it shows the bright, clear tint of day when you skip from 09:00 to 18:00 before it starts getting dark. I tried to fix it, in this case, by getting the game to instantly change to the Sunset phase's tint before gradually switching over to Dusk but then it instantly flips back to the Sunset and replays the transition to Dusk in an endless loop until the first minute of the hour is up.
One last problem I found is that because the Day/Night cycle is run by events, the process stops while a message box is opened and yet I found that screen tint changes continue to play while that happens so that begins to run out of sync with the time system.
There has to be a way to get parallel events running even during conversations (and battle).
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,419
Reaction score
1,434
First Language
Spanish
Primarily Uses
RMVXA
count a number of absolute frames instead of minutes and seconds.

also, 1 frame is NOT 1 millisecond..
double check the game's frame rate.
 

Latest Threads

Latest Posts

Latest Profile Posts

just when I thought one of the greatest game of all time couldn't get any better, they announce a new dlc for it.
For anyone interested: there's another huge humble bundle with JRPG assets + a game jam starting next month - it's for a good cause, so check it out <3
Turning a specific vibe into reality is incredibly difficult. For instance, this song is one of the ones I listen to when working on my post apocalyptic project, and getting it's "feeling" into the game has been a real challenge.

I don't just wanna regurgitate the numbers I see, I wanna actually understand the calculations I'm making so I'm probably gonna make a post later with some calculations and what I THINK they mean to get some advice and corrections.

Edit: All (Most) of these will be tested in game prior. I just wanna make sure I understand what's going on under the hood if you will.
my girlfriend calls all my little chibi art cute lol... funny considering that wasn't the original art style of the game.

Forum statistics

Threads
113,778
Messages
1,077,366
Members
147,808
Latest member
traviscot
Top