Friday, February 27, 2009

Random Map Generation #1

Part of the game design requires randomized map that consists of territories that are made of hexes.

This part of the game is something that I'm finding very intimidating. There are probably a hundred different ways to do it and since we are on the iPhone, we do want the fastest algorithm as well as one that can provide a decent amount of balance. All in all, its seems like a pretty tall order. I figured due to the challenge, I'd be better off working on solutions now while still dabbling in tech development.

So one idea is to pick a random point on the hex map and then randomly pick hexes to fill that will make a territory. Once that is done, randomly pick a edge hex to connect a new territory and start filling it out. In that fashion we should have several territories that are at least touching. However, this does not guarantee that we will have interconnected ones. I'll have to figure that out.

I do know that as I'm building the hex map, I can create just a simple graph of nodes (with each node representing a territory) and basically use the hex map for user selection but use the graph to determine valid neighboring territories.

Indeed. We will see.

No comments:

Post a Comment