This is a development log showcasing the development of a tower defense engine for RPG Maker. Awhile ago I had shown some previews of an RPG Maker Tower Defense engine in the works. It looked something like this:
Well, it ended up only being a preview and that was it. So now in hopes of actually finishing the system, I’m going to create a dev log to show a tower defense engine being created for RM step-by-step.
Wikipedia has an article on Tower Defense. It summarizes it as follows
The goal of tower defense games is to try to stop enemies from crossing a map by building traps to slow them down and towers which shoot at them as they pass. Enemies and towers usually have varied abilities, costs, and upgrade prices. When an enemy is defeated, the player earns money or points, which are used to buy or upgrade towers, or upgrade the number of money or points that are earned, or even upgrade the rate at which they upgrade.
I’m sure at some point in the history of gaming, the original tower defense game probably involved architectural towers of some sort, but at this point it is just the name of a genre and “tower” can represent anything you (may or may not) control. Such as fire-breathing kitties.
Based on the overview above, the goals of the system is fairly straightforward. At the bare minimum, we just need
- Showing towers and enemies on the map
- Building towers
- Enemy spawn points
- Enemy move routes
- Interaction between units on the map
- Locations that enemies want to go to
Let’s look at how each concept can be represented in RPG Maker.
Towers are the units you control. They can be upgraded through methods such as gaining EXP by defeating enemies, or spending points on them. They can be represented as Actors.
Enemies are the units you don’t have much control over. We can represent them using Enemy objects in RM and set them up through the enemy database.
We already have access to a variety of things such as how much exp they give, how much gold they drop, and basically anything else you can think of with RM.
This is where enemies appear. There can be one or many spawn points. We can simply use an event to represent a spawn point.
This is where enemies want to go. There can be one or many end locations. We can use an event to represent this.
The path that enemies take to a particular location. The event system already support move routes, so we can use that.
Although we know how we want to set up our database, we still need to be able to them on the screen. A custom class can be created that will hold a battler, whether it is an actor or enemy.
Note the significance of this design: by allowing a tower defense battler to hold an existing actor/enemy, if you already have an existing party that you wish to use, you can simply plug them into the system.
Interaction between units on the map
The objective of the basic tower defense game is to prevent enemies from going to a particular location. You build towers to defeat enemies that pass by. We would need a way to provide this kind of interaction between units.
A set of menus would need to be created that allows players to build units and place them on the screen.
Units may or may not be built anywhere you want. In some tower defense games, units cannot be placed in such a way that no path to the end location exists. In other games, this restriction does not exist because the enemies can fight back. We can use regions to restrict where units can be built or not.
After thinking about all of the basic features that are needed, we can begin building our tower defense engine. Some parts of it are relatively easy, while other parts may be more complicated.
Ideally, at the end, we will have a stand-alone tower defense system that can be plugged into any project with no compatibility issues.
Spread the Word
If you liked the post and feel that others could benefit from it, consider tweeting it or sharing it on whichever social media channels that you use. You can also follow@HimeWorks on Twitter or like my Facebook page to get the latest updates or suggest topics that you would like to read about.