Procedural Dungeon Generation: Difference between revisions
Jump to navigation
Jump to search
m Talad moved page PCG Procedural Generation to Procedural Dungeon Generation without leaving a redirect |
No edit summary |
||
Line 1: | Line 1: | ||
=== Unreal Engine PCG - Tested = No thank you === | |||
* You need to position your initial volume with snap to grid 100, otherwise if you are in non step position you will get a different number of points generated. | * You need to position your initial volume with snap to grid 100, otherwise if you are in non step position you will get a different number of points generated. | ||
* We need to use Transform Points to move the offset of our generated points back to the 0,0,0 position of our volume. In our example we had to use 50,50,50 as both min and max offset. | * We need to use Transform Points to move the offset of our generated points back to the 0,0,0 position of our volume. In our example we had to use 50,50,50 as both min and max offset. | ||
Line 6: | Line 7: | ||
* If you want to do it in an actor, you need a Collision Box inside the actor , so the engine can determine the overall actor size. | * If you want to do it in an actor, you need a Collision Box inside the actor , so the engine can determine the overall actor size. | ||
=== Homemade random generator === | |||
'''Good ideas:''' | |||
* pre-made rooms with explicit connection points | |||
* build offline, save the rooms coordinates, then recreate online | |||
* use overlap with filter on class (being the room class) to see if you can spawn it or not | |||
* lights all already placed in the pre-made room | |||
* (for now) one connection type | |||
* for each connection left open at the end, add a wall to close it. Can also be a special mesh for closing connections. | |||
'''Placeholders:''' | |||
* furniture that can be searched (shelves, tables, ...) | |||
* chests | |||
* traps (GetRandomPointInNavigableRadius ? ) | |||
* secret passages | |||
'''Algorithm:''' | |||
* place the starting room (with at least 2 connections) | |||
* add all connection points to a list, and randomize, get one | |||
* randomize the next room and the connection you will use | |||
* attach it to the previous room's connection | |||
* check for overlaps, if it overlaps try another room, max number of tries, then change connection | |||
'''To check:''' | |||
* Navmesh generation. Spawn one navmesh covering the total area where we generated the rooms, and trigger the recalculation. |
Revision as of 22:32, 14 January 2024
Unreal Engine PCG - Tested = No thank you
- You need to position your initial volume with snap to grid 100, otherwise if you are in non step position you will get a different number of points generated.
- We need to use Transform Points to move the offset of our generated points back to the 0,0,0 position of our volume. In our example we had to use 50,50,50 as both min and max offset.
- In the chart we use:
- Get Actor Data -> Volume Sampler -> Transform Points -> Static Mesh Spawner
- Volume Sampler has 100,100,100 for Voxel size
- If you want to do it in an actor, you need a Collision Box inside the actor , so the engine can determine the overall actor size.
Homemade random generator
Good ideas:
- pre-made rooms with explicit connection points
- build offline, save the rooms coordinates, then recreate online
- use overlap with filter on class (being the room class) to see if you can spawn it or not
- lights all already placed in the pre-made room
- (for now) one connection type
- for each connection left open at the end, add a wall to close it. Can also be a special mesh for closing connections.
Placeholders:
- furniture that can be searched (shelves, tables, ...)
- chests
- traps (GetRandomPointInNavigableRadius ? )
- secret passages
Algorithm:
- place the starting room (with at least 2 connections)
- add all connection points to a list, and randomize, get one
- randomize the next room and the connection you will use
- attach it to the previous room's connection
- check for overlaps, if it overlaps try another room, max number of tries, then change connection
To check:
- Navmesh generation. Spawn one navmesh covering the total area where we generated the rooms, and trigger the recalculation.