I'm working on placing predesigned tilemap rooms in my procedural dungeons, and I would like to design the items' and monsters' placement in these special rooms as well.
Currently I "compile" my predesigned room scene into a scriptable object, and the map generator loads that tilemap into "gameplay" tilemap.
I already parse the special game objects in the scene (like items and monsters), and store their transforms and prefab paths in the scriptable object.
But this has 2 problems:
Having every item and monster in the resources folder would make my executable huge.
- But this could be solved by making a "MonsterPrefabDictionary" on a manager like gameobject, and drop every prefab into this list in the editor. The map generator would simply use this dictionary to find the object's prefab.
The biggest problem is that every variation of monster would need another prefab (or prefab variation). And by variation I mean the little changes as well.
Want a mob to have only 50% health in the room at start? Make a prefab for this?
Want a monster to start with a specific buff in this room? Make a prefab for this?
Want a monster to start in a different stance than usual in this room? Make a prefab for this?
So as you can see, this scales pretty badly.
But this could be solved by storing the MonsterScript's every data in the scriptable object.
- But this would scale badly as well, because every new information about a monster would have to be added to this serialization process as well.
Is there a built-in, automatic, easy way to just save a GameObject's full state and just load everything with one line later on?