Dec 31, 2013

Daily Life Project (part 1 - time and lighting)

It feels a bit strange that, after all this time, I finally get to repost the script that started this blog, a long while ago, long before I had made myself a name - that is, long before the ACMS. :p The loop is getting looped, and it feels like a nice parting gift with all of my faithful RMXP followers.

The Daily Life project initially is my own attempt as a day/night system. If you would like a day/night system and...
  • you think most of those look ugly or otherwise unrealistic
  • you would like to control the flow of time
  • you would like to make variations on events based on the time of the day or day of the week
  • if you would like a realistic, dynamic lights system
Then it is exactly what you need.


Event-controlled time.

  • time does not advance automatically - unless you command it to with a parallel event. You get to control how time changes with game variables, down to the second.

  • a wide range of variables and switches allows you to set event to appear/occur only at specific times - specific hours and/or days in the week and/or months and/or years...

Natural-looking day and night.
  • progressive transition between dawn, day, dusk and night
Progressive change in daylight on a summer solstice
  • progressive change of daytime duration according to the season (daytime lasts longer in summer)
Progressive change in daylight on a winter solstice
  • fading overlay effects according to time of the day (sunbeams at noon and haze at night)
  • events named "Shadow" automatically fade out as night gets closer
  • day/night can be disabled when inside closed spaces, and luminosity set manually
Closing the curtains forces the luminosity to zero despite the fact it is noon

Realistic, dynamic lights
  • any number of light sources can be set and blend naturally into each others
  • real-time calculation allows light sources to flicker and even move around
  • adjustable radius and strength
  • lights tear through darkness but do not overlay ambient light

Known issues

  • This script is known to make the interpreter lag, depending on the user's machine. It is not the script's fault. RPG Maker's graphic engine has such poor performances, that how the script works will necessarily confront it to its limits sooner or later. It is pointless to ask me for an optimization, since there's absolutely nothing more I can do to address this issue. However, here are a few guidelines to avoid lagging:
  1. More light sources mean more calculations - do not make too many of them
  2. Map scrolling requires recalculation at each frame - avoid making maps that exceed the screen size
  3. Having light sources flicker or move around also requires frequent reclaculation - do not overuse those effects
  4. The darkening overlay which gives the illusion of night is arranged in small blocks. The DARKNESS_PRECISION constant in the Constants - Custom entry controls the size of said blocks - the smaller they are, the better the quality and the worse the lagging. It is set to 2 by default, which I found to be the best quality/performance ratio. Setting it to 1 will make the overlay appear blocky but will cut the load in quarter.
  5. The DARKNESS_FRAME_SKIP constant in the Constants - Custom entry allows to force the calculations to wait for a set amount of frames, thus effectively cutting the load. It is set to 0 by default (no skipping) but you can set it to small numbers (like 4 or 5) so that the overlay does not appear too jumpy, and you gain a little performance boost.


The following link provides a script bundle meant to be used along with the Script Manager. Terms of use and instructions are provided within. Please credit me if you use it in your own project. A nice comment is always appreciated.

The following link provides a demo for said script.


  1. Very nice :D. I know it will be very hard to do but it will go great with this script. A script that lets you setup where npc's are during certian times of the day. As a bonus maybe they could pathfind there way to their house at night and go to bed and in the morning they get out of bed and pathfind there way to where they work/play/hangout/etc....

    1. Thanks Polraudio.

      Individual schedules for NPCs might be featured in part 2. There will be no pathfinding stuff however, not because I cannot program it but because this is not the way I want it to work. Time does not advance automatically and while it makes sense to advance the clock when you go from a map to another, there's no point in doing so when you're just sitting around watching the NPCs attend to their own business. Therefore how I see it you would only be able to witness "frozen" states of a NPC, that is either when he's at home or out, but never the transition between the two.

      Do note that you already have the ability to set events so that they appear only at certain times of the day with part 1's code - that includes NPCs. So no need for additional scripts, just put an event which stands for a character at all the places you want him to be, with mutually exclusive time conditions.

  2. So how do I download this? The only download links I can see give me an autosave script and the demo for the party interaction script. I just want the lighting script.

    1. Nevermind, the I used the link on the RMU scripts page

    2. Whoops, my bad. The links are fixed now. Thanks for pointing out the mistake.

  3. Hi!

    First off, this is an excellent script!! Thank you so much for sharing with everyone.

    My question: I was wondering if it is possible to include a lantern system, or allow a light source to follow the player character?

    1. Thanks Charles, I must admit I'm quite proud of it myself.

      There's currently no built-in way to have a light source follow the player character, and also no way to event it that I can think of, that wouldn't be complicated and super dirty. It shouldn't be hard to code though so I might consider adding this in a future version. I hope you're not in a hurry though because I'm quite busy with my life lately and there's little chance I will be able to address your request any soon. I will keep in touch.

  4. Miss Moonpearl, sorry for asking here of all places, but I can't find a way to contact you directly, so I hope you see this and that you still check your blog from time to time, but I am unable to get your character set generator to work, I've found no read mes so I am at a loss, can you provide any help?

    The problem in question I get is when I try and run the application I get a "RGSS102.dll not found." error.

    1. Do you have the proper RTP installed?

    2. Just as Charles said, this is not an issue related to my works. You can also google the DLL and download it from 3rd party sites, then add it to your Windows\System32 directory.

  5. Salut Moonpearl ! Désoler d'écrire ici, mais bon puisqu'il n'y a pas de place sur ton blog pour te contacter (et que je ne vois plus ta présence sur aucun blog) je vais écrire ici ! Bref, Qu'est-ce que tu deviens ? Je regarde ton blog a toutes les semaines pour avoir des nouvelles et depuis 5 mois il n'y a rien... Au dernière nouvelle tu voulais arrêter de travailler sur RMXP. Est-ce que tu travail sur un nouveau logiciel ? Bref j'aimerais avoir de tes nouvelles. J'adore se que tu fais et se serais bien que tu donne des nouvelles sur ton blog peut importe qu'elle sois avec RMXP, un autre programme ou simplement un projet personnel que tu fais. Bref j'espère avoir de tes nouvelles bientôt ! Et lache pas le making !!!

    1. Bonjour Daylights, merci pour tes encouragements. Effectivement, si je n'ai rien écrit depuis tout ce temps, c'est que de fait, je n'ai rien fait. Ma vie personnelle m'a bien occupé ces derniers mois (c'est rien de le dire), et ce n'est pas encore fini. Mais, plus important, je n'ai pas du tout le coeur à programmer dernièrement. Ce n'est pas juste ma propre motivation à créer des jeux vidéo qui est en cause: plus je passe de temps à discuter avec des gens, et plus j'ai la sensation qu'on ne vit pas dans le même monde. Je n'aime pas ce que le jeu vidéo est devenu, je n'aime pas ce que les joueurs sont devenus, je n'aime pas ce que les concepteurs de jeux sont devenus. On pourrait me qualifier de vieux réac' sans être loin de la vérité, mais je ne suis pas anti-progressiste, bien au contraire; simplement j'ai l'impression que là où la technique progresse, l'aspect ludique, lui, régresse. Je m'amuse toujours mieux avec certains jeux des années 80-90 qu'avec n'importe lequel de leurs descendants actuels, et je trouve que ça craint franchement... à part quelques perles ludiques comme Portal ou Braid, mais qui représentent peut-être moins de 1% du jeu vidéo existant... Voilà où il est, mon problème: c'est que j'ai envie d'explorer de nouvelles choses, créer de nouveaux concepts, repenser entièrement la façon de jouer... mais, en définitive, qui ça intéresse? Surtout dans le game-making amateur, les gens sont plus occupés à cloner ce qui existe déjà, à reproduire les schémas qu'ils ont observés dans les jeux auxquels ils jouent pour, je suppose, avoir la satisfaction de retrouver des sensations familières. L'utilisateur de RPG Maker moyen préfère se concentrer sur l'imaginaire, le scénario, les personnages, qui ne sont au final que de la poudre aux yeux, un prétexte pour donner sens au jeu, plutôt que sur le jeu lui-même. Il n'y a qu'à voir le classement de mes propres scripts par popularité: celui qui est le plus téléchargé, c'est le menu animé personnalisé... le truc qui en met plein la vue mais qui dans le fond n'apporte rien de plus au jeu. Je n'ai jamais réussi à m'intégrer à une équipe de développement, car je pense qu'il est là, le malaise profond: nous n'avons pas la même définition de ce qui fait qu'un jeu vidéo est bon... et sans compter le fait que, pour beaucoup, je suis avant tout une machine à écrire des scripts, plutôt qu'une personne avec sa propre sensibilité et ses propres envies créatives. Voilà pour clarifier un peu mon état d'esprit sur le sujet...

      J'ai rajouté mon adresse e-mail dans la présentation du blog, à l'usage de ceux qui voudraient entretenir une correspondance.

  6. Hey there, first of all thank you so much for this post and honestly I was searching for the same information from last few days. Keep posting and keep sharing.
    free slots

  7. Thanks for the amazing scripts!

    One thing I noticed with RMXP is that setting the switch for Display HUD to off won't disable the HUD a lot of times. To bypass, setting move route with the option of switch OFF seems to do so though.

    Thanks again for the amazing scripts!

  8. I love this kind of personal and eloquent posts from you Nick! I enjoyed this film immensely, though the whole time it's clear Pat Sr. is a whole lot nuttier than his son, and the fact that he's so oblivious makes it all the more amusing
    gclub casino online
    casino online
    gclub online