- #1
twoski
- 181
- 2
Hello,
I am working on a map generator for a game called Dominions. I plan to make it open source once it's functional. Maps in this game typically wrap vertically and horizontally, so the generator must create maps that seamlessly wrap on the X and Y axis.
Typically (for even player counts), the provinces are randomly arranged in 4x4 chunks. Player starts are assigned to the bottom left province in this chunk.
Representing this grid conceptually is trivial. We construct a grid of nodes (for the provinces) and generate the province connections afterwards and assign data (ie. what sort of terrain the province has).
Here is a screenshot what i have created so far.
This is what i assumed to be half of the work. The other half is generating the actual visual map. The first step here is generating polygons for each province. A polygon belonging to a node needs to connect to all other neighboring polygons such that it satisfies the node's connections.
This is where i am stuck. I have it generating basic polygons but this is not quite where it needs to be.
So my question is this... If you have nothing but a node's position and you know which nodes it connects to, how can you make a nice semi-organic shape that satisfies these constraints?
If anyone knows a cool algorithm or has experience working on something like this before i'd like to hear your thoughts.
I am working on a map generator for a game called Dominions. I plan to make it open source once it's functional. Maps in this game typically wrap vertically and horizontally, so the generator must create maps that seamlessly wrap on the X and Y axis.
Typically (for even player counts), the provinces are randomly arranged in 4x4 chunks. Player starts are assigned to the bottom left province in this chunk.
Representing this grid conceptually is trivial. We construct a grid of nodes (for the provinces) and generate the province connections afterwards and assign data (ie. what sort of terrain the province has).
Here is a screenshot what i have created so far.
This is what i assumed to be half of the work. The other half is generating the actual visual map. The first step here is generating polygons for each province. A polygon belonging to a node needs to connect to all other neighboring polygons such that it satisfies the node's connections.
This is where i am stuck. I have it generating basic polygons but this is not quite where it needs to be.
So my question is this... If you have nothing but a node's position and you know which nodes it connects to, how can you make a nice semi-organic shape that satisfies these constraints?
If anyone knows a cool algorithm or has experience working on something like this before i'd like to hear your thoughts.