Level Instance Creation
Last updated
Last updated
The main idea with the level instance spawner is that you can do some small assemblies and then add some custom logic to it using tags. This feature is also available with my other tools, Massive World and Massive Village.
Let's take this table for example...
All of those props are single static meshes, grouped as one level instance. In this example, the table will spawn 100% of the time.
The chair has a 50% of chance to spawn And the candles are randomly rotated with a 50% chance to spawn.
Open the scene L_LevelInstanceBuilder. This scene is a small scene built to make your life easier for building level instances as it comes with a grid generator that can match your dungeon.
What you see here are some examples spawned in the demo dungeon. The tile can be replaced by your own tile mesh. Once you hit "update", PCG will measure your mesh and update the grid size to match your tile.
Now go inside the Massive/MassiveShared folder and open the BP_MassiveTags editor
This will open a small tags widget that allows you to easily edit the tags of your meshes in one simple click. This tag editor is also shared among my other tools Massive World and Massive Village.
If you click on the shield, you can see there a tag applied already "Chance75". This mean that this shield has 75% chance to spawn everytime its added in a dungeon.
Rotate = Rotate in all axis
Rotate Z only = Rotate in the Z-axis
You can ignore project to landscape and "door" as they are mostly used for the other tools.
This forge is already disassembled, so let's make it usable for Massive Dungeon. Right-clickSelect all the meshes and right click to create a new level instance.
A small dialogue will appear to ask about the pivot origin to use. I tend to build the level instance so that the 0,0,0 in the world can be used as the origin. So in this case I can use World Origin.
Give it a name, and save. Once saved, go click on it and create a PCG Asset out of it.
This is the file we need so that PCG can recognize its content and spawn it inside Massive Dungeon. The level instance can now be added to your RoomMesh database, in this case, I will add it inside the DA_RoomForge provided in the demo, and I will add it on the floor like in the screenshot below.
In the example, you can see that sometime the forge spawn with a shield, sometime without it.