Friday 14 July 2017

Remaking level generation

Since the map holds Tile objects it doesn't make a lot of sense to create objects for each map tile, but only those you can see. This idea led to another one when I was thinking level generation from a new perspective. In short you start from a level of null tiles and create open areas first (floors). Things like caves and passages between them, rivers and other natural areas. Walls don't exist yet, in fact they could be created after everything else is done, for rooms too. So the generation scheme would be two stages: first floors (and other tiles that are on floor level) and then walls/obstacles on top and around floors on empty areas. Also, I guess that way you could always make sure that everything is connected, other than areas you would later seal off with obstacles etc.

When digging to an empty area tiles would be generated around that place to avoid the player to reach null tiles. The only downside is that this will take some time... but I think it will be worth it and it's only a kind of minor shift in paradigm from carving stuff out from full rocky level to creating floor areas first on empty void and then building walls later in places they should go.

No comments:

Post a Comment