Question about procedurally generated content efficiency

Hi!

I am developing a 2’5d beat’em’up - rpg game with procedurally generated content, the basic system is working pretty good, i can generate isolated rooms (connected by teleporters to other rooms) and enemy spawners that spawn enemies you have to kill, some items (a very basic inventory system is in place) and a basic AI that follows you around and attacks you (will change the AI system to a FSM in the near future).

The system works like this:

  1. First create some empty rooms:
    • Create a room object
    • Add a number of mesh chunks to that room
    • Create the room “terminators”, rocks or walls at the sides of the room
  2. Second create the teleporters
    • For each room create a minimum of two teleporters
    • Connect the teleporters to other teleporters in different rooms (no teleporter can connect to a teleporter in the same room).
    • Select a random room and create an additional teleporter to connect to the player start room (this room is not created procedurally, for the moment).

The thing is that i don’t know if this is a very efficient way to handle the level creation. Right now every room chunk is a mesh created in 3ds max (a very simple mesh, btw, less than 200 polys) with a collider attached (also created in 3ds max). The chunks are quite big, like 15 meters long. I was wondering if it will be more efficient to “merge” all the meshes into one new big mesh for every room once the room has generated, or else split the meshes into smaller ones (so the occlussion culling culls more meshes).

Any idea will be appreciated.
Thank you!

I don’t see a problem with your way. Combining all meshes into one doesn’t make much sense unless they all share the same material. If it’s one mesh even frustum culling won’t work.

Occlusion culling can’t be applied since the occlusion data has to be:

  • static
  • Generated in the editor

I guess the game uses a 3rd person view? in this case occlusion culling won’t even help much. If the map is large (many rooms) frustum culling is much more effective.

btw: The only conceptual problem i see is that it’s possible to create isolated “room chains” with no connection to other rooms. The simplest example are 3 rooms in a ring structure.

---R1---R2---R3---        ---R4---R5---R6---    
|                |        |                |
------------------        ------------------

The game is 2d’5, kind of like a side scroller but with rpg elements (inventory, items, skills, etc), the actors (players, enemies, npcs) are 2d and the scenarios are 3d (you can move in all directions X, Y, Z).

I had the isolated rooms problem but i solved it adding a minimum of two teleporters to each room and forcing that each teleporter must point to a different room, this way the teleporters send you to random rooms :slight_smile:

Thanks for your answer!