Sunday, June 8, 2014

Labyrinth generator

I experimented with procedural map generation. The maze below is created completely on the server based on a random seed. I might want to use this algorithm as-is in the finished game to create procedural dungeons, but for now it's mainly a proof-of-concept. I could imagine a lot more kinds of maps which could be created procedurally than just this one.

This, however, begs the question of how much I want to rely on procedural content. While procedural generation is a great way to create huge amounts of content with minimal work, it can never compete with the ingenuity of hand-designed content.




To send the procedurally-generated map to the client, I had to write my own encoding routine for my maps. I used to just forward the original JSON code from Tiled to the client. But because there is no Tiled file for procedurally-generated maps, I had to write a routine to encode the map data myself.

The same routine is now used for the maps made in Tiled. This has the advantage that I only transfer the information about the map which the client needs to know. This saves bandwidth and removes cheating opportunities.




No comments:

Post a Comment