Making A JRPG: An Over-Scoped Adventure
Want Code? Check out Making A JRPG: Code Edition
So as a side project, a friend and I decided to make a JRPG in Unity because it was both of our dreams to build the battle system from the Final Fantasy series. It took us a few days to decide the actual specs of the battle system and the character development that we are going to use. After that, we decided to incorporate weapon and armor stats, items, and status effects. Once that was all sorted out, it was surprising to both of us how much help there is to build character stats for any type of RPG. So as far as leveling up the characters and their stats, a good portion is already done. The battle system is progressing well too. Here is when things get complicated:
- How to save the character’s progression easily and efficiently
- How to give the character their moves easily and efficiently
Without talking about the last point (because it is still early in its development and that alone is going to take a very long time), how do we address these issues? We shall start with the first one.
How to save the character’s progression easily and efficiently
We knew right off the bat that we didn’t want to do a saving through player prefs because that would take a lot of keys to make sure we have saved everything we need. It would get messy really quickly and it would be slow.
Initially we had the idea of saving the stats of each of the characters right back into the prefab whenever we deemed necessary (after battles, leaving the item menu, that sort of thing). The funny thing is that this works from scene to scene. It’s actually really simple to pull off too. The big problem arises when you start the game from the beginning. It doesn’t seem to keep the save settings during start up so everything gets reset to the initial settings. As for as efficiency……I don’t really know. If anyone knows the low-level applications of this process, please let me know.
Then we had the idea of doing an XML save/load. It has its own problems with it. Not only would it be a bit slow if we did it all the time, but it would be slow if we are dealing with large amounts of data. The only good side is that we know that it would work. It would be just very tedious work, and something a bit easier to pull off is optimal.
So what did we decide to do? A hybrid.
We decided to keep the prefab idea because it is rather simple, and we have bigger things to tackle. But when it comes to the game start up, we are going to load from an XML into the prefab. And we are going to force the player to save or else they lose their stuff, just like in the good old days.
How to give the character their moves easily
Remember when I said “we have bigger things to tackle?” This would be it. If we are going to have an interesting game, we need a variety of moves for the characters and enemies. How do we have it so we can assign moves to an entity so it will allow characters to swap out moves, unlock new moves during progression, make it efficient, AND try not to repeat our code?
Well it didn’t seem so bad….at first. We just tackled it like anything else. Make a script, put it on a game object, so on and so forth. It didn’t take long before we realized that this was a poor route. If we were going to continue this, then we would have to instantiate all the moves we were going to use. So for the sake of efficiency (and our sanity), we didn’t pursue this idea. What do we do now?
XML, but here’s the deal. We don’t want to create a big sheet with all the moves cause that would cost too much, nor create one for each class because we would get repeats. So we are going to create 1 sheet for each move and within the entity that holds it, tell it what sheet to load ONLY if you have reached its level.
The hardest part of the project can be overlooked at first. I overlooked the fact that we are going to need tons of moves and I was more worried on the character progression. There are lots of pieces to this project, but getting these moves to work is going to be a challenge.
I will probably put this project up as soon as it stops being all code. As always, let me know if you have any suggestions for improvement.