cxong / cdogs-sdl

Classic overhead run-and-gun game
https://cxong.github.io/cdogs-sdl/
GNU General Public License v2.0
904 stars 115 forks source link

Building interior map generator #213

Closed cxong closed 3 years ago

cxong commented 10 years ago

As a new map type, check this approach out and see if it creates good C-Dogs levels: http://www.redactedgame.com/?p=106

The overall approach is:

  1. Pick an area somewhere in the middle as the core/lobby/atrium
  2. Randomly subdivide the map into very small pieces
  3. Randomly remove walls to get different room shapes and sizes
  4. Working from the outside, convert walls into corridors, and using pathfinding create the corridors back to the core
  5. Add doors so that all rooms/corridors are connected

By turning walls into corridors, the rooms need to be big enough in the first place. This may cause problems with C-Dogs.

The corridors and core become the "floor" or "exterior" tiles; the rooms become regular rooms which are possibly locked.

Some modifications that may make this algorithm more suitable for C-Dogs:

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

cxong commented 10 years ago

This could be more compelling if the map format is extended to support arbitrary floor tile types, instead of just the two currently (floor and room).

cxong commented 6 years ago

The map generator was implemented as part of https://github.com/cxong/gomapgen but the results aren't great. Need to explore another generator.

Maybe try this one:

cxong commented 3 years ago

paths