Slashdot Mirror


Building a Procedural Dungeon Generator In C#

Nerval's Lobster writes Procedural dungeon generation is a fun exercise for programmers. Despite the crude interface, such games continue to spark interest. A quarter century ago, David Bolton wrote a dungeon generator in procedural Pascal; now he's taken that old code and converted it to C#. It's amazing just how fast it runs on a five-year-old i7 950 PC with 16GB of RAM. If you want to follow along, you can find his code for the project on SourceForge. The first part of the program generates the rooms in a multilevel dungeon. Each level is based on a 150 x 150 grid and can have up to 40 rooms. Rather than just render boring old rectangular rooms, there are also circular rooms. "There are a couple of places where corridor placement could have been optimized better," Bolton wrote about his experiment. "However, the dungeon generation is still very fast, and could provide a good programming example for anyone exploring what C# can do." For C# beginners, this could represent a solid exercise.

4 of 83 comments (clear)

  1. Are you freaking serious? by DigitAl56K · · Score: 5, Insightful

    Have we slipped so far down the performance-orientated slide that we are impressed by *how well a dungeon generator runs on an i7 with 16GB of RAM*.

    I am genuinely curious. That is an outrageously high spec for a dungeon generator.

    1. Re:Are you freaking serious? by l0ungeb0y · · Score: 5, Funny

      Have we slipped so far down the performance-orientated slide that we are impressed by *how well a dungeon generator runs on an i7 with 16GB of RAM*.

      It's C# -- so it's likely that's the minimum requirements for a compiled .NET App to run

    2. Re:Are you freaking serious? by Anonymous Coward · · Score: 5, Interesting

      I have been running C# ASP.NET on Raspbian Apache/ModMono for a solid 3 years. No problems.

  2. Alternate Link by Anonymous Coward · · Score: 5, Funny