The long delay between parts 2 and 3 of this series were due in part to the huge amount of work I’ve been putting into the engine itself lately and in part to my changing my mind about what the topic of part 3 would be. Originally, I was going to continue writing about the scripting system, but it seems to be too esoteric a topic for anyone to care about, so I’m going to discuss something more general.
Specifically, the architecture of Metis and why, even though it is built originally to facilitate the creation of RPGs and visual novels, its structure will make it applicable as a general purpose game engine instead of merely being used for RPGs and visual novels.
Case study: Unity3D
Unity was another game engine from which we drew inspiration in working on Metis. For those who are unfamiliar, Unity is set up with an asset store, from which you can purchase and download extra assets or pieces of functionality. These packages (or, at least, the well-designed ones) can be dragged and dropped into your game and can add huge new features easily.
This ability to easily swap pieces of functionality out and add new ones is part of what makes Unity such a good general-purpose engine.
Taking it a step further
In order to facilitate the building of extra features for Metis, we’re making sure to provide an interface for every feature you could possibly use, major or minor, such that you can swap out the default for an alternate implementation of your choosing. For example, the IDiceService has two built-in implementations: a fair dice roller and a dice roller which uses a normalized distribution. But you could also easily implement your own IDiceService which uses a Poisson distribution, or even an algorithm of your choosing.
This is also used within the individual modules themselves. For example, Metis.RPG (the core RPG module) provides an IMapService which facilitates the loading of map files. A default implementation for Tiled maps is provided, but you could create your own implementation to load from RPG Maker, or another 2D level editor of your choice.
The key idea here is that everything can be swapped out and customized, while still providing enough default behaviors that you don’t need to customize anything to make a game.
Example: Vacant Sky: Awakening
Aside from the Metis core module, there are two modules that are used in VSA: Metis.RPG and Metis.NVL. Metis.RPG is a fairly substantial module which provides generic RPG functionality such as menus, battles, maps, items, and so on (though VSA uses some custom implementations for things like maps). Metis.NVL is the module for visual novel functionality, such as dialog, menu choices, etc and is designed to be a competitor for Ren’py.
The goal is to make game development as à la carte as possible, so you don’t need to get locked into a huge set of features from a module if you only need a few. So far, it has worked out fairly well in the development of VSA, so I’m feeling good about this design choice.