Graph Theory

Published on 8/25/2011

Moving on to random level generation...

Noise maps are a tricky thing. The theory of it, as with everything, is pretty straight forward. Implementation, on the other hand, proved to be more than a day's worth of frustration. But I did come up with something usefull for generating the levels in Stingray.

NoiseMap.jpg

The second problem is knowing which tiles belong together. Apart from the fact that four tiles at a time share a single texture map, there's no other obivous link apart from the naming of the tiles. This is not something usefull. I've opted to build a tool to link tiles to one another in all four directions. It's hard work up front (read tedious) but it will make it fairly easy to determine which tiles to place where on the map. Considering the number of tiles I already have (and that are still to come), the links of all these tiles would make for some excellent graph theory examples :)

So, to achieve this, I've worked hard on the content set editor to facilitate both the actual linking and testing the linking. These screenshots also show the various elements that the drawing engine supports, although I haven't made maps for any of the slots except the diffuse.

LinkingTiles.jpg

Testing the links is simple - you select the tile in the appropriate direction and it's drawn next to the tile being edited. It's worth while to note that the coordinate system in XNA is different (Y-Up) from the modelling software (Z-Up). So, when modelling you have to remember that north becomes south, and west becomes east... maybe thats the future of world politics as well?

TestingLinks.jpg