# Tag Info

0

This is going to depend on your game and what you're going for. Until you can answer that in detail, it's best to keep it simple, and tweak once you see issues. The only thing I'd pre-empt is that with user-generated content, you want to curate it. You might maintain a collection of pre-approved maps that are allowed in random match-ups, unless the ...

0

Following on vrinek's idea, how about growing the land (or shrinking the water) so parts you would originally be connected would be disconnected after the land is grown? This could be done like so: Define how much do you want to grow the land: 1 hex? 2 hexes? This value is n Visit all land nodes, and set all their neighbors up to depth n to land nodes ...

4

Here's a complete algorithm that I think should produce good results. Perform morphological erosion on the water area — that is, make a copy of the map on which each tile is considered water only if it and all of of its neighbors (or a larger area, if you have rivers wider than one tile) are water. This will result in all rivers disappearing entirely. ...

4

A quick and dirty way to identify a separate but connected body of water would be to shrink all water bodies and see if gaps appear. In the example above I think that removing all water tiles which have 2 or less water tiles connected to them (marked red) would provide you with the desirable result plus some edge noise. After you have labeled the bodies, ...

1

Why make it any harder then it needs to be? Just add a boolean to the entity state right next to the 2D position. Then during rendering you will need to offset when try depending on the tile, some logic will also depend on the true false value like line of sight calculation. But you can mostly short circuit that if you assume the amount of object like that ...

1

In my online-game that I'm tinkering on as a hobby, I plan to split the map up into tiles that have only a 2D coordinate inside each tile. The vertical coordinate for a player or NPC inside its particular tile-cube will then simply be decided by the ground level underneath it. Since each tile has arbitrary connections to other tiles in 4 directions, stairs ...

1

I'm struggling to understand what you're asking, but I'll take a shot at it. I'm assuming what you're talking about is an "area graph" or "zone graph", a concept for AI. In an area graph, parts of the map are linked logically in a sparse graph to make it easier for AI to understand what's going on. If that's the case, why not just add a 3rd coordinate to ...

0

Do you have an rough idea of where the gulf is? If so, you can modify your flood fill to track the number of neighbouring but unexplored cells (along with a list of visited cells). It starts with 6 in a hex map and whenever that value drops below a certain point, then you know you are hitting a "opening".

8

What you're describing is the Segmentation Problem. I'm sorry to say that it's actually an unsolved problem. But one method I would recommend for this is a Graph-Cut based algorithm. Graph-Cut represents the image as a graph of locally connected nodes. It subdivides connected components of the graph recursively such that the border between the two ...

4

Yes, there's a reason to do this. The user might want to play the map again, and if so having all (or at least most of) the map already resident in memory means it doesn't needed to be loaded from disk again, thus reducing load times in that (often typical) case. Purging something from memory is not free, either, as there may be references to loaded that ...

Top 50 recent answers are included