Prefabs
In order to make the level editing process less tedious, I implemented a system heavily inspired by Unity’s Prefab System. Prefabs allows you to create, configure, and store an entity complete with all its components, property values, and child entities as reusable assets.
To improve the workflow, prefabs can be edited at runtime through the built-in prefab editor. Existing prefabs can be dragged into the level editor.
Prefabs made serialization and deserialization of levels significantly more complex. If any changes have been made to the prefab, those changes need to be propegated to the instances in the level as well. My solution to this problem was serializing what the prefab looks like when saving the level. When loading that level again in the future, we can compare the differences; has a component been added or removed, or maybe there is a new child entity?
Resolving all the edge cases was easier said than done, but editing levels and reusing entities across levels had never been easier.
An additional benefit is that 3D models are saved as prefabs, so reimporting them updates all existing instances in levels.
Gameplay became much more modular thanks to prefabs. It allowed us to easily write generic spawners and emitters that could be customised by specfying different prefabs to spawn.
Prefabs became integral to level design and gameplay systems. They not only accelerated content creation, but also allowed for a more modular design philosophy, proving that good tooling is as critical to a project’s success as the gameplay itself.