Environment System Lite 1.3.2 (MV3D 0.6.3)
Smoothness and Battle Update
3D Battlebacks Update (v1.1)
Major Update (v1.3)
This demo does not include the mv3d-patreon.js plugin, as this is a premium feature of the creator of
the MV3D plugin, Dread_Nyanak.
The lack of this plugin will make the sunlight system not work, since it was developed using the plugin
mentioned above as a base.
(v1.3) The Environment System automatically detects whether mv3d-patreon.js is present and applies
the appropriate ambient color.
If you have the mentioned plugin, remember to activate it in the Plugin Manager.
A copy of this tutorial was added to the tutorial folder in the Environment System Demo.
I came to introduce you to the Environment System, a system that creates a dynamic atmosphere for the
game that deals with several factors, such as time, day phases, rain, sunlight (and moonlight), camera
control, dynamic BGM, among other factors; and it affects both maps and battles.
The system was created using MV3D as a base, which is the plugin that makes RPG Maker become real 3D.
I know that several of these systems are common, but I created them all by common events to ensure
compatibility with the mentioned plugin.
In addition, the compatibility between them is perfect and bug-free as well.
To summarize better what it is about, follow the list of all the systems included in the Environment System:
The Environment System works as a game core, a set of systems that serve as a basis for creating games.
The ideal is to start building your game using the demo as a base, but if you already have a project and
want to use the system, you will have to take some precautions:
Don't use fade in / fade out effects, except those of the transfer map.
Don't change any file names in folders.
Don't change any settings in the DhoomParallaxUtils plugin.
Do not use pictures number 1 to 8.
Copy the files mentioned in the Credits to the respective folders of your project.
Don't use any switches until number 84.
Don't use any variables until number 77. (78, 79 and 80 are just for demonstration of the Yanfly Save
Core. So you can use it.)
If you used any switches or variables from the ones mentioned above, bugs may happen in your game,
so you will have to change the switches and variables you used in your game.
(v1.3) The new features will have the version number in which they were included next to their
respective paragraphs, exactly the way you are seeing it now.
Having said the important things, let's move on to the parts of the system.
Don't Use & Don't Change
The Time System has seconds, minutes, hours and days.
All of these values are controlled by the following variables:
Variable 1: Second
Variable 2: Minute
Variable 3: Hour
Variable 4: Day
You can use the variables above to create conditions in your game based on the game clock.
There is also a variable to define how much a minute equals in seconds, Variable 53: Minute - Value in
In the demo, the default value is 1 Minute equals 1 Second, but you can change it.
The Clock HUD is totally made by pictures and displays Hours and Minutes, as well as showing the
phase of the day and the weather forecast.
This has 2 modes: 24h and 12h (am/pm). These modes can be changed freely by the player by pressing
the Control key.
The HUD can also be moved (by the 4 corners of the screen) by pressing the Tab key.
To start the clock, you have to call Common Event 27: Clock HUD - Start. This command is included in
Common Event 2: Define Start Commands.
If you don't want to allow the player to change the clock modes and position, just turn off Switch 24:
Clock - Key.
You can also forbid only changing the position of the HUD via Switch 77: Clock HUD - Locked. In this
way, modes can continue to be changed.
If you want to HIDE the Clock HUD, perform the routine in the image below:
If you want to SHOW the Clock HUD, perform the routine in the image below:
Regarding the modes, change Variable 30: Clock HUD - Mode to:
Any value other than these can cause bugs, so be careful!
Regarding the positions, change Variable 47: Clock - Position to:
0 - Upper Left
1 - Upper Right
2 - Bottom Left
3 - Bottom Right
(v1.2) The Clock HUD automatically adjusts to all resolutions.
You can continue to change the positions of the Clock's HUD using the Variables mentioned above.
(v1.3) If, for some reason (making a cutscene, for example), you need to disable the Clock HUD, you can.
To do this, simply call the Commom Event 20: Clock HUD - Disable.
Once that event has ended, just call Common Event 21: Clock HUD - Enable to get everything back to normal.
It is recommended that you only use this feature at a moment when the player cannot control himself
(during the execution of an automatic event, for example), otherwise some bugs may occur.
You can also stop refreshing all Systems, if necessary.
To do this, simply turn ON the Switch 21: Systems - Refresh Disable.
Remember to turn OFF this so that all game systems are refreshed again.
Day and Night
From 18:00 to 05:59, it will be night; from 06:00 until 15:59 it will be a day; from 16:00 until 17:59
it will be afternoon.
Depending on the period of the day, there will be a change in the tone of the screen, in the color of the
fog and in the displayed parallax, creating an impression of day, afternoon and night on the maps.
The change will not only affect the maps, but will affect the battlebacks too.
Obviously, the system will not affect the internal maps.
To define the IDs of the internal maps, go to Common Event 7: Map - Check and include the IDs of the
internal maps in the respective array:
There is a way to temporarily disable the system so that you can apply your own effects to specific maps.
Turning on Switch 8: Special Panorama, the Day and Night system will ignore all self programming so
you can apply your own parallax. (It will continue to change the tone of the screen, even if you have
activated Special Panorama)
This can be used if you want to make a specific map with a different Parallax, like a boss map, for example.
When leaving the special map, just turn off the respective switch.
(v1.3) Now Day Phases have default BGS: Sound of birds singing for Day/Afternoon and Sound of owl
and crickets for Night.
They can be activated easily by including the Map ID in the respective array.
If you want to activate Day Phases Default BGS on all maps in the game, you can do this easily by
including the number 0 in the array, as shown in the image above.
On maps whose IDs are not included in the array, no BGS will play for Day Phases, but Rain BGS will
continue to play normally.
If you try to play your own BGS on these maps (Wind sound, for example), it will not work, as silence is
being forced on that maps.
To do so, you must turn ON the Switch 59: Use Own BGS before playing.
This will also allow you to play your own BGS even over the Rain BGS, so if you want the Default BGS to
be played normally again, remember to turn OFF this Switch.
Whenever a day passes, the game will define whether it will rain on that specific day or not, which day,
hour, minute and second it will start to rain; which day, hour, minute and second will stop raining and
which day, hour, minute and second will be cloudy.
It may be cloudy up to 6 hours before it starts to rain.
Staying cloudy will directly affect the map, turning the day into a cloudy day, the afternoon into a cloudy
afternoon or the night into a cloudy night.
This will change the tone of the screen, the color of the fog and the parallax. In addition, battlebacks will
also be affected, applying cloudy weather to battles as well.
Regarding rainfall, there can be 2 different types: rain and storm.
This will affect the thickness of the raindrops and the BGS played.
There may also be thunder or not, and if there is, thunder can have 3 different powers, which change
the sound effects and the duration of the flashes on the screen.
The frequency at which lightning strikes is also random, with one lightning strike after another, or it may
take a long time before the next falls.
Obviously, rain will not happen on the indoor maps, but you will continue to hear the rain BGS and the
You can temporarily disable rain using Switch 10: Special Rain, in the same way that Special Panorama works.
They can also be used to apply different rain-related effects to specific maps.
You can disable the BGS from the rain without having to disable the rain itself. To do this, you will use
Switch 75: BGS Rain - Disable. This will prevent rain from automatically playing its respective BGS.
You can disable BGS from rain automatically when entering Dungeons as well. This can be done via
Switch 76: Rain - Disable in Dungeon.
Doing so will only prevent the rain from playing its respective BGS, but will not allow you to play your
own BGS normally, as the BGS break will continue to happen, according to itself programming. To play
your own BGS normally, you must activate Switch 59: BGS - Use Own BGS, so the BGS will not stop
automatically when it is not raining (or at night).
If you activate Switch 76: Rain - Disable in Dungeon and Switch 75: BGS Rain - Disable simultaneously,
every time you are out of a dungeon, Switch 75: BGS Rain - Disable will be turned off.
To turn off BGS from rain on an external map, you need to turn off Switch 76: Rain - Disable in Dungeon
and turn on Switch 75: BGS Rain - Disable.
How to define if a map is a dungeon will be shown a little later.
If you want to create a condition in your game in case it is raining, you should use Switch 18: Rain - Raining.
You can also create a condition in your game in case it is cloudy. In that case, you must use Switch 13:
Rain - Cloudy.
In the case of thunder, use Switch 5: Thunder.
(v1.3) The Cloudy Sky graphics have been reworked for all the Day Phases (Cloudy Day, Cloudy Afternoon
and Cloudy Night).
Now the Environment System is even more beautiful!
The old Cloudy Sky graphics were kept in their respective folders in case the developer wanted to use
Sunlight and Moonlight (Requires mv3d-patreon.js)
The sunlight system will generate a dynamic shadow on the map, whose shadow angle will vary
according to the time of day.
The sun will rise at 06:00 in the east, casting a shadow to the left of the map and will set at 18:00. At that
very moment, the moon will rise in the east, casting the shadow to the left of the map again, restarting
During this time, the projected shadow will rotate around the map as time passes. The shadow position
will be updated every 2 minutes in game time. This gives the impression that the sun (or moon) is
rotating around the map, giving an impression of a 3D effect with greater depth.
Sunlight will not affect indoor maps. In this case, a standard shadow effect will be applied, which will not
vary according to the game time.
Sunlight can be temporarily disabled by Switch 9: Special Sun. This can be used for that same idea of
applying a proper sun effect to a specific map.
Camera routines define default camera settings for specific types of maps.
There are 3 map specifications: Outdoor Maps, Indoor Maps and Dungeon Maps.
To define a map as Indoor Map, you must place the desired map ID inside this array:
To define a map as a Dungeon Map, you must place the desired map ID within that array:
Anything that is not defined in one of these 2 arrays will be considered Outdoor Map.
In this demo, the Camera Routine for an outdoor map, applies a view from above, from a reasonable
height, creating a slight 3D effect, while passing the 2D game impression.
The Camera Routine for an indoor map looks like the first one, but the camera is placed a little closer to
the character, as well as a little more tilted.
The Camera Routine for Dungeon Maps will be in first person.
Finally, it is also possible to disable Camera Routines temporarily.
This is done through Switch 11: Special Camera.
(v1.3) Dungeon Maps are now referred to as First Person Camera Maps.
See the First Person Camera section for a better understanding.
The Flashlight System makes the light of a flashlight automatically appear at night.
The flashlight behaves differently indoors, not appearing at all.
In dungeons, it applies a different angle from the outside maps to the light.
The player's flashlight is activated via Switch 19: Flashlight - Item. You can turn it on automatically, the
way it is done in the demo, or you can turn it on only when the player gets the Flashlight item during
gameplay. Use your creativity!
If you don't want to turn the flashlight automatically, turn off the Switch 19: Flashlight - Item in Common
Event 2: Define Start Commands.
The Dynamic BGM System makes the BGM vary according to the phase of the day, playing a different
BGM for the day, another for the afternoon and another for the night.
To enable, first you have to define the map IDs that will have Dynamic BGM in this array:
Copy and paste the entire section, as indicated there.
In Variable 5: Map - Current ID, you will define the ID of the map you are configuring the BGMs for.
Under this condition, you will define the song that will play day, afternoon and night for that specific map.
The Dynamic BGM applied to battles will randomly draw a Battle BGM from the playlist.
Battle BGM will never be repeated.
In this demo, there are 5 different BGMs. You can include more by changing Variable 61: Random Battle
BGM - Randomizer and adding a new condition in case the Variable obtains this new result that you just
added, placing the new BGM.
Dynamic BGM also applies to vehicles, and you can define a BGM for each vehicle at each stage of the day.
Thus, a boat can have 3 different BGMs, a ship can have 3 different BGMs and the airship too.
In this way, you can have a total of 9 different BGMs for vehicles, making it possible to capture the
atmosphere of the moment better in each situation.
Smooth Transitions will make the transitions between phases of the day happen in a very natural way,
applying a slight fade effect between parallaxes.
Otherwise, the transitions would happen too suddenly, which causes an unnatural aspect in the changes
between phases of the day.
For this to happen properly, you need to define any parallax in the map editor to turn on the system.
Besides that, copy and paste the following tags on your outdoor maps: (KEEP THE NAMES IN THIS
EXACT WAY, IN PORTUGUESE!!!)
<parallax: Noite Nublado, CloudySky5>
<parallax: Tarde Nublado, CloudySky4>
<parallax: Dia Nublado, CloudySky3>
<parallax: Noite, StarlitSky2>
<parallax: Tarde, Sunset>
<parallax: Dia, BlueSky>
Don't change any settings in the DhoomParallaxUtils plugin!
Day and Night and Rain Systems affect battles through Battle Integration.
Thus, if it is afternoon, for example, the parallax for the afternoon will be displayed on the battle scene; if
it is raining during the night, the cloudy night parallax will be shown and it will also be raining (including
touching the rain BGS) in the battle scene.
In short: The day phase and the weather will affect battles in the same way as maps.
To enable this, you will need a battleback with a transparent background.
That done, you will go to the map properties and define your battlebacks like this: battleback1 = none
and battleback2 = your transparent battleback.
I created some pseudo 3D battlebacks with transparent parts to be able to show the parallaxes at the
bottom of the battle scene.
On an outdoor map, battleback1 will be defined automatically based on the day phase.
On an inner map, this will not happen. In that case, you need to define a battleback1 for that specific map.
If no battleback1 is defined, battleback1 for none will be displayed. In this demo, the battleback1 for none
If you want to add new battleback1, they need to be loopable, otherwise there will be a visible cut in the
The Moghunter plugin that I used to make the parallaxes appear in the battle scene does not scale the
battlebacks, just keeping the original image size.
So if you are going to include a battleback2, you have to resize the image to the size of the full screen.
The resolution of the demo is 1280 x 720p and this is the resolution of the pseudo 3D battlebacks that I
If you want to use the standard RPG Maker MV battlebacks, you need to scale them to 1280 x 720p or
lower the resolution to the standard RPG Maker MV resolution.
3D Battlebacks Support (v1.1)
I created a 3D battleback generator so that a huge variety of 3D battlebacks can be created with just a
few clicks. To learn more and download it, click here.
There is also the Colossal Pack available for download, it contains 2537 different 3D battlebacks ready
to use, including all possible combinations of RTP battlebacks.
To obtain it, access the link mentioned above.
Included in this demo is the entire package of 3D Battlebacks - Best Matches, this contains the best
combinations of all, in my opinion, for each RTP's battleback2, plus some original battlebacks.
To use 3D battlebacks, do as explained in the Battle Integration section.
It is possible to use outdoor battlebacks1 on indoor maps.
For example: You are inside a house, but you want the sky to appear behind the scenery, depending on
the phase of the day that is happening outside.
To do this, you need to define this indoor map as one of the maps that will use outdoor battlebacks.
Go to Common Event 7: Map - Check and define the map IDs in the respective array, as shown in the
Including the map ID in the array shown, an outdoor battleback1 will automatically be shown on these
To use a specific battleback1 on a map, it is necessary that the ID of that map is not included in the above
array, otherwise, a outdoor battleback1 will be shown instead.
HUD Adjustment Menu (v1.3)
It is now possible to configure the Clock HUD through a Menu.
It can be accessed via the Main Menu, in the HUD Adjustment section.
In this way, the Ctrl and Tab buttons, used previously for this purpose, are completely free for the
developer to use for other functions again.
With the HUD Adjustment being done through the menu, the old way of configuring it using the keys is
However, it is still possible to use the old way for HUD Adjustment.
To do this, just go to Common Event 27: Clock HUD - Start and turn ON the Switch 24: Clock - Key.
When you do this, HUD Adjustment Menu will be disabled, disappearing from the Main Menu.
It is not possible to use both ways simultaneously. You must choose: either one or the other.
To lock the Clock HUD and not allow the player to change its settings ingame, just go back to the old way
and turn ON the Switch 77: Clock HUD - Locked, as shown in the Clock HUD section.
HUD Adjustment Menu is a Live Menu.
This is a Menu that is activated in the $Scene_Map, with the normal game systems in full operation.
If you have an event on the map that can significantly affect the game while running the Menu and would
like to fix this problem, create a condition in the last tab of the event with the activation of Switch 23:
That way, the event will do nothing while the HUD Adjustment Menu is activated and will not affect the
Finally, it is also possible to call the HUD Adjustment Menu.
This is interesting in case you want to call the HUD Adjustment Menu in a special scene, like a cutscene
or tutorial, for example.
To do this, you must turn ON the Switch 84: Call HUD Adjustment Menu and then call Common Event 22:
Clock HUD - Adjustment.
For this to work, Switch 24: Clock - Key must be OFF.
Otherwise, the HUD Adjustment Menu will not be called, even if you do the above procedure.
Dynamic Camera (v1.3)
Dynamic Camera is divided into 3 features: Camera Colision, Indoor Maps Behavior and Outdoor Maps
Camera collision works as follows: Every time the camera's view focuses on the wall, the camera will
focus on the actor instead.
This avoids camera's view problems during gameplay.
This feature was recently included in the MV3D and I decided to apply it dynamically to the Environment
System as well.
There are 2 distinct forms of Camera Collision: Type 1 and Type 2.
Type 1 will focus on the actor whenever his sprite is covered by an object or the wall.
This is applied absolutely, which ends up not being ideal for Outdoor Maps, because if you pass behind
only a small tree or any object, the Camera will focus on the actor and this will create an unwanted
For this reason, I decided to apply Type 1 only to Indoor Maps, in which the actor will usually be covered
by the wall, which ends up making this type of Camera Collision ideal for this situation.
Type 2 will focus on the actor only if the camera's view is completely obstructed by the wall.
This is a more subtle form of Camera Collision and will not focus on the actor if he passes just behind a
small object, unlike Type 1.
Therefore, I decided to apply Type 2 only to Outdoor Maps, in which the actor will be covered by small
objects several times, but we do not want to apply Camera Collision in these situations, only to extreme
situations in which the actor is totally covered.
That said, let's move on to the next topic: Indoor Maps.
Upon entering an Indoor Map, the Camera will enter Perspective Mode, a view closer to a First Person
Camera, but which still shows the actor.
Camera Yaw will always focus on the actor's back, regardless of the direction he will be looking at when
entering an Indoor Map.
In this way, the Camera gives the impression that the player really is inside that Indoor Map (weapons
shop, in the example image above), being able to see extra details like the ceiling.
Finally, let's talk about Outdoor Maps.
When entering an Outdoor Map, the Camera will enter Aerial Mode (as seen in the example image above).
When leaving an Outdoor Map for an Indoor Map, Camera Yaw will be memorized. Then, on returning to
Outdoor Map, the same Camera Yaw that was memorized before entering Indoor Map will be restored.
Moving from an Outdoor Map to another Outdoor Map will keep the current Camera Yaw.
With this Camera Mode, we can have a wider vision of the Outdoor Map.
These Camera behaviors will be applied independently if Yaw and Pitch controls are ON in the MV3D
Leave these controls ON, if you want the player to have full control over the Camera or turn them OFF, if
First Person Camera (v1.3)
The concept of Dungeon Maps has now been changed to First Person Camera Maps, to give a more
comprehensive idea, since any map in the game can feature First Person Camera.
You can easily set up a Map that will display First Person Camera, just add the desired Map ID to the
If you want to create a game entirely using First Person Camera, just enter the number 0 in this array
and ALL maps in the game will use First Person Camera.
Note that, regardless of whether it is an Indoor Map or an Outdoor Map, the Camera will be in First Person
if the respective Map ID is inserted in this array.
First Person Camera takes priority over the default Camera behavior.
In addition, it is also possible to control the use of Flashlight in First Person Camera Maps with greater
You can force the use of Flashlight (you still need to turn ON the Switch 19: Flashlight - Item) in First
Person Camera Maps, regardless of whether it is an Indoor Map or an Outdoor Map, or the current Day
Just insert the desired Map ID in the respective array.
Inserting the number 0 in this array will also force the use of Flashlight on ALL maps in the game.
This way, it is very easy to create a game entirely in First Person with Flashlight always in hand (as long
as the Flashlight Item related Switch has been turned ON).
If the current Map ID is not inserted in this array, Flashlight will adopt default behavior.
Indoor Maps will not have Flashlight and Outdoor Maps will have Flashlight only at night.
This is useful for creating dark dungeons, as in previous versions, but you have full control over it now.
Yanfly Save Core (edited version by CoopNinjask)
Yanfly Save Core is now compatible with the Environment System.
The differences between the version edited by me and the original are:
When the party has less than 4 members, their faces will be aligned to the center instead of being
aligned to the left.
Despite being a small change, this offers a better layout for games that have small partys or that are
focused on just one actor.
It is now possible to insert Icons in the Save Core panels, either in the default panels (Playtime,
Save Count, Gold, Map Name), or in panels that contain variable values.
To insert Icons in these Panels, just include the Icon message code in the respective field.
In the case of Variables, the Icon message codes must be inserted in their names.
Example: Variable 100: \i Variable Name
It is worth remembering that this is a free Yanfly plugin and the purpose of editing is only to ensure
greater compatibility and support the needs of the Environment System.
All credits must continue to be given to Yanfly.
Define Start Commands
After you have adjusted everything according to what was instructed in this tutorial, you will have to
define the initial commands to start the systems.
In this demo, this is done through Common Event 2: Define Start Commands.
mv3d rotationMode auto sets the camera rotation mode to automatic.
mv3d ambient #222222 defines the respective color for the environment.
Allow Followers = OFF turns followers off.
Switch 1: Time System = ON turns on the Time System.
Common Event 23: Flashlight - Automatic enables the flashlight for the player and for all vehicles. (Removed)
Switch 19: Flashlight - Item = ON enables the flashlight for the player automatically.
Common Event 27: Clock HUD - Start starts the Clock HUD.
Switch 29: Dynamic BGM Vehicles = ON enables the Dynamic BGM of vehicles.
If Switch 29 is ON
Common Event 29: Dynamic BGM - Vehicles starts Dynamic BGM for vehicles. This common event
depends on the activation of Switch 29 to work.
Common Event 5: Rain - Define makes the Rain System set up its configurations for the first time.
Any initial configuration regarding the systems in your game, must be done by this Common Event.
This should be called at the beginning of your game via an auto-start event to give the starting trigger
for all systems in the demo.
Default Script Changes
The changes made to the Default Scripts can be found in the Default Script Changes txt, in the notes folder.
Commercial & non-commercial use.
Do not repost, link to this site instead.
The credits are in credits.txt, which can be found in the notes folder.
Version 1.3.2 - MV3D version updated to 0.6.3, obtaining several improvements.
A house was added to show an example of use for 3D models.
Some bugs were fixed, the most important ones being:
A bug that ocurred when trying to manipulate the time directly on an external map.
A bug that ocurred in the maps transition while the phases of the day were changing.
A bug related to Day Phases BGS.
Version 1.3.1 - MV3D version updated to 0.6.1, with the most prominent new feature being the possibility
to import .obj files.
Version 1.3 (Major Update)
MV3D Version updated to 0.5.4.2: New MV3D features as Diagonal Movement and Camera Collision are
Automatic detection of mv3d-patreon.js and application of the correct ambient color.
Day Phases default BGS.
New Cloudy Sky graphics for all the Day Phases.
Sky parallax scrolling is now smoother.
HUD Adjustment Menu.
Yanfly Save Core is now compatible. A version edited by me was included in Demo.
Clock HUD can now be forcibly disabled/enabled.
System Refresh can now be disabled.
Dynamic Camera: Camera Collision based in Map Types (Indoor/Outdoor).
Indoor Maps behavior for Camera mode and Yaw.
Outdoor Maps behavior for Camera mode and Yaw.
First Person Camera: First Person Camera Easy Setup.
Total control over Flashlight when in First Person Camera Maps.
Version 1.2.1 - Minor clock correction in am/pm mode.
Version 1.2 - Clock HUD position now automatically adjusts to any resolution.
The Clock HUD position can now be locked via Switch 77: Clock HUD - Locked.
Flashlight now is bug free.
Vehicle lights have been removed due to lag and bugs.
Some minor bug fixes.
Chests and Scarecrow have 4 direction sprites now.
Version 1.1 - 3D Battlebacks Support included.
Version 1.0 - Environment System's launch.