Make a new module¶
A module is one room of a procedural level: a small level made with the kit, and one Data Asset. By the end of this page the generator can draw your room in L_Procedural. If you have not read How procedural levels work, start there.
- The module levels:
Content/MPFriendslop/Maps/Modules/ - Their Data Assets:
Content/MPFriendslop/Blueprints/DataAssets/Module/Childs/ - The kit:
Content/MPFriendslop/Meshes/Environments/Modular/
Pick which one to start from¶
Duplicate a shipped module of the same type. It already follows every rule on this page.
| Start from | Type | What it brings |
|---|---|---|
L_Module_Hall |
Normal |
An open hall with four pillars |
L_Module_Alcoves |
Normal |
A cross of corridors and four small rooms |
L_Module_Ring |
Normal |
A loop around a small room with windows and a door |
L_Module_FigureEight |
Normal |
Two loops that cross in the middle |
L_Module_Corridor |
Passage |
A long corridor between two side rooms |
L_Module_Chicane |
Passage |
A zigzag with no line of sight between the exits |
L_Module_Vault |
DeadEnd |
A vault behind a double door, opened by a lever on each side, full of loot |
L_Module_Offices |
DeadEnd |
A dead-end corridor and four offices |
L_Module_Spiral |
DeadEnd |
A spiral that ends on a room behind a door |
Step 1, the room¶
- Duplicate the module closest to yours in
Maps/Modules/and name itL_Module_<Name>. Never name a levelModule_<something>: the generator gives that name to each copy it loads. - Build the room with its centre on the level origin. It covers X and Y from
-600to600, floor at Z0, ceiling at Z300: nine floor slabs and nine ceiling slabs. - Add your interior walls, pillars and props, as in How levels are built.
A module holds no NavMeshBoundsVolume, no fog, no post-process volume and no PlayerStart. L_Procedural has them once for the whole map.
Step 2, the rules at the edges¶
The generator builds the outer sides. Your room has to leave room for them.
| Rule | Why |
|---|---|
| Place no wall on the outer sides | The generator puts walls, corners and doorways there |
Keep everything inside -587.8 to 587.8 |
The outer wall is 24.4 cm thick, centred on the edge |
On each exit side, keep the middle cell empty: 400 x 400 cm |
That is where the doorway and its door go. A ceiling lamp is fine, nothing on the floor |
An interior wall may meet an outer side only at -200 or 200 along that side |
That spot is always solid wall. Anywhere else it could land in a doorway |
Keep walkable, reachable floor within 50 cm of the centre of the room, (0, 0). A thin pillar on the exact centre is fine |
The run only starts once the nav mesh reaches it, and the Warden can spawn there |
Keep the centre of every module walkable: the generator only starts the run once the navmesh reaches the centre of each placed module. A module whose centre is blocked or has no floor keeps the run from starting.
The exits depend on the type: Normal on all four sides, Passage on the east and west sides, DeadEnd on the east side only. Build it that way round: the generator turns the room itself.
Step 3, the lamps¶
The project has no bounce light, so a room without a lamp is black. Every closed room needs its own lamp.
- Put a
BP_CeilingLight_02bar in the middle cell of each exit side, along the axis of the exit. Keep it steady: it tells the crew where the way out is. - Use
BP_CeilingLight_01in small rooms,BP_CeilingLight_03over a big room such as the vault, and a floor neon to show the floor of a dead-end corner. - Make a lamp blink only where steady lamps already light the area. With no bounce light, an area lit by a blinking lamp alone goes black half the time. The shipped rooms blink with
Blinking Intervalat0.3andBlink Randomnessat1.
The lamps and their fields are on Place, switch and make lamps.
Step 4, loot and patrol points¶
- Place
BP_LootSpawnPoints and setLoot Tableon each, as in Place loot spawn points and loot tables. A dead end is where most of the loot goes: the shipped dead ends have seven points each, theNormalandPassagemodules two to four. Most points useDA_LootTable_Shelf. Each dead end also has points onDA_LootTable_Salvage, the table with the heavy pieces, the bat and the hammer. - In a
Normalor aPassagemodule, place oneBP_WardenPatrolPointon the floor. Put none in aDeadEnd.
You never fill the Warden's Patrol Points here. The generator collects the points of every module it drew and gives them to the Warden it spawns.
Step 5, the Data Asset¶
- In
Blueprints/DataAssets/Module/Childs/, right click, then Miscellaneous, then Data Asset. - Pick
BP_ModuleDataAsset. Name itDA_Module_<Name>. - Fill the three fields.
| Field | What it does | Default |
|---|---|---|
Level |
The module level, L_Module_<Name> |
empty |
Module Type |
Normal, Passage or DeadEnd. Decides where the generator can draw it |
Normal |
Weight |
How often it is picked among the modules of its type. 2 is twice as likely as 1 |
1 |
Step 6, add it to the generator¶
- Open
L_Proceduraland selectBP_LevelGenerator. - Under
Settings|Generation, add an entry toModulesand pickDA_Module_<Name>.
Nothing goes in the packaging settings: the Data Asset brings the module level into a packaged build.
Step 7, test it with two players¶
- To see your module in most runs, give it a high
Weight, for example100. Keep the other modules inModules: the generator needs every type to draw a full plan. - In the Play menu, set Number of Players to
2and Net Mode toPlay As Listen Server. - Press Play from
L_Procedural. Walk your room in the client window: every exit, every loot point, every lamp.
Next: Tune the generator.