Hello, I’m currently working on a massive SciFi RPG. This is a 15+ hour game that I’ve been working on for 14 months now. Part of this game is actually a full and complete mini RPG inside of it, in the form of a VR simulation that the player can enter as a recreation activity on a space station. I’ve just completed one of them out of the five that will be offered to the player, and I’d like to share what I’ve learned about putting an entire distinct game into a game using RPG Maker MZ. I’m also wondering if anyone has done something similar to this before, and if anyone can see some possible refinements or improvements to the methods I used.
First of all, entirely new actors are used only for each VR simulation. The regular player actor and whatever followers are present are removed upon entry and replaced by simulation-specific actors. This goes a long way to preserve levels, EXP, HP, and MP.
The next most important thing in this are some common events I constructed to handle removing all player inventory and restoring it back again. I have four of these events so far:
1) Global Take Inventory
2) Global Give Inventory
3) Simulation Take Inventory
4) Simulation Give Inventory
When the player enters the simulation, common event 1 is called to strip the player of all “real world” items, armor, and weapons. The quantities and equip state of all these items is recorded by way of visual scripting commands that store these quantities as variables and equip states as switches. Then common event 4 is called, which restores whatever items, armor, and weapons the player had inside the simulation. If the simulation is starting for the first time or has been reset, these variables and switches will be 0 or off.
That handles the transition in to the simulation. The simulation can be exited at one of four “exit points”, which are conspicuous glowing yellow triangles in the simulation game world. These exit points call common event 4 and then common event 2, which reverses the process described above. It took a lot of testing and refining to make this system work perfectly all the time, but I can report happily that it can be done.
Since inventory quantities and equip states are saved before they are called, this makes the exit points and re-entry into the simulation work as sort of a “save” system for the simulation. Progress within the simulation is preserved by default since switches and variables related to progress have to be reset manually. This brings me to the next most important common event, the Simulation Reset common event.
This is called upon a win or a lose condition, making the simulation reset to its default starting state. Every single switch and variable that were used inside the simulation are turned off and reset from this common event. Then some javascript commands are used to reset the state of each actor:
Script: $gameActors.actor(16).setup(16);
Script: $gameActors.actor(16).clearEquipments();
These are much more efficient than using visual scripting commands to unequip armor and weapons and to reset levels and EXP. After this, the possible weapons and armor held in simulation inventory are removed by change weapons and change armors commands that decrease the amount by -9999. This ensures that no matter what quantity of weapons were held in inventory, they are all removed.
After this, recover all commands are used for each actor. So this reset common event will make the simulation feel like a new game if it’s been previously won, or if the player lost by experiencing a game over.
The fake “game over” that happens in the simulation is handled by the show picture command and some in-simulation music. It’s important to not allow a real game over during the simulation. The fake game over returns the player as his regular self on that space station in the main game, whereas the real game over ends the whole game and goes back to the title screen.
It’s because of this that I realized I couldn’t use the default random encounter system for battles. Instead, I have a parallel event on each map with enemies which chooses a random number from 1 to 5, waits a certain amount of time from 60 frames to 300 frames based on which random number was picked, and then chooses a random number from 1 to 2 to select one of the two different enemy types in the simulation. This invokes a battle processing command, and the lose condition will trigger the fake game over screen and the return to the space station.
Meeting the possible win conditions of the simulations is handled in a similar way, with the screen fading to white, showing the win screen through the show picture command, and returning the player to the space station.
To further enhance the feeling that the simulation is a separate game, I used a custom javascript plugin to change the names of the armor slots and currency. This plugin is active only when a certain switch is activated. This switch is turned on when the player enters the simulation and turned off when the player exits, wins, or loses.
The art style, interface colour, and even text font are different inside the simulation, as are the music and other sounds. All can be done with visual scripting commands, except the text font change. I used the excellent Fonts Manager plugin by Pheonix KageDesu:
forums.rpgmakerweb.com
These stylistic changes make the simulation feel very much like its own game.
I think that about covers it for the methods and tools I used to make a distinct and separate game within a game. If anyone has specific questions about what I did and why I went down this harebrained path, just ask. I’m also interested to know if I could have done anything more efficiently. For instance, I used a bunch of nested conditional branches to set the weather effects, screen tint, and background music to what it should be based on player progress when the player enters the simulation again. I realized later that I should have used a system of assigning different certain variable values, and then made a series of conditional branches without having to nest them.
But what does everyone think of this idea? Has anyone included a game within a game in one of their projects before?
First of all, entirely new actors are used only for each VR simulation. The regular player actor and whatever followers are present are removed upon entry and replaced by simulation-specific actors. This goes a long way to preserve levels, EXP, HP, and MP.
The next most important thing in this are some common events I constructed to handle removing all player inventory and restoring it back again. I have four of these events so far:
1) Global Take Inventory
2) Global Give Inventory
3) Simulation Take Inventory
4) Simulation Give Inventory
When the player enters the simulation, common event 1 is called to strip the player of all “real world” items, armor, and weapons. The quantities and equip state of all these items is recorded by way of visual scripting commands that store these quantities as variables and equip states as switches. Then common event 4 is called, which restores whatever items, armor, and weapons the player had inside the simulation. If the simulation is starting for the first time or has been reset, these variables and switches will be 0 or off.
That handles the transition in to the simulation. The simulation can be exited at one of four “exit points”, which are conspicuous glowing yellow triangles in the simulation game world. These exit points call common event 4 and then common event 2, which reverses the process described above. It took a lot of testing and refining to make this system work perfectly all the time, but I can report happily that it can be done.
Since inventory quantities and equip states are saved before they are called, this makes the exit points and re-entry into the simulation work as sort of a “save” system for the simulation. Progress within the simulation is preserved by default since switches and variables related to progress have to be reset manually. This brings me to the next most important common event, the Simulation Reset common event.
This is called upon a win or a lose condition, making the simulation reset to its default starting state. Every single switch and variable that were used inside the simulation are turned off and reset from this common event. Then some javascript commands are used to reset the state of each actor:
Script: $gameActors.actor(16).setup(16);
Script: $gameActors.actor(16).clearEquipments();
These are much more efficient than using visual scripting commands to unequip armor and weapons and to reset levels and EXP. After this, the possible weapons and armor held in simulation inventory are removed by change weapons and change armors commands that decrease the amount by -9999. This ensures that no matter what quantity of weapons were held in inventory, they are all removed.
After this, recover all commands are used for each actor. So this reset common event will make the simulation feel like a new game if it’s been previously won, or if the player lost by experiencing a game over.
The fake “game over” that happens in the simulation is handled by the show picture command and some in-simulation music. It’s important to not allow a real game over during the simulation. The fake game over returns the player as his regular self on that space station in the main game, whereas the real game over ends the whole game and goes back to the title screen.
It’s because of this that I realized I couldn’t use the default random encounter system for battles. Instead, I have a parallel event on each map with enemies which chooses a random number from 1 to 5, waits a certain amount of time from 60 frames to 300 frames based on which random number was picked, and then chooses a random number from 1 to 2 to select one of the two different enemy types in the simulation. This invokes a battle processing command, and the lose condition will trigger the fake game over screen and the return to the space station.
Meeting the possible win conditions of the simulations is handled in a similar way, with the screen fading to white, showing the win screen through the show picture command, and returning the player to the space station.
To further enhance the feeling that the simulation is a separate game, I used a custom javascript plugin to change the names of the armor slots and currency. This plugin is active only when a certain switch is activated. This switch is turned on when the player enters the simulation and turned off when the player exits, wins, or loses.
The art style, interface colour, and even text font are different inside the simulation, as are the music and other sounds. All can be done with visual scripting commands, except the text font change. I used the excellent Fonts Manager plugin by Pheonix KageDesu:
Fonts Manager - custom fonts (colors) anywhere in game [MV, MZ]
Fonts Manager Pheonix KageDesu Features Load any custom font from file to your game. Easy use via control character \F[x] Use OS system fonts by name \F[Arial] and custom by Index (like colors) \F[1] (or also by name) Replace default colors for \C[x] control character Create color...
forums.rpgmakerweb.com
These stylistic changes make the simulation feel very much like its own game.
I think that about covers it for the methods and tools I used to make a distinct and separate game within a game. If anyone has specific questions about what I did and why I went down this harebrained path, just ask. I’m also interested to know if I could have done anything more efficiently. For instance, I used a bunch of nested conditional branches to set the weather effects, screen tint, and background music to what it should be based on player progress when the player enters the simulation again. I realized later that I should have used a system of assigning different certain variable values, and then made a series of conditional branches without having to nest them.
But what does everyone think of this idea? Has anyone included a game within a game in one of their projects before?