Drawing territories border in 2d map
Posted
by
Gabriel A. Zorrilla
on Game Development
See other posts from Game Development
or by Gabriel A. Zorrilla
Published on 2011-03-09T16:34:18Z
Indexed on
2011/03/10
0:19 UTC
Read the original article
Hit count: 510
I'm programming a little web strategy game. In the country map I pretend to display each country with a national color. The issue is how to render the borders in a simple and efficient way. Right now I'm planning to set a field to each tile called "border" with values from 0 to 8. The algorithm would check for EVERY tile is its adjacent has a different "owner". If the tile is inside the territory, the border value would be 0, because would not have adjacent any tile with different owner, if not, would vary between 1 (north) clockwise to 9 (north-west) and then draw the border.
I find this simple but too processor-intensive. Are there any other "pro" choices to render territories borders?
© Game Development or respective owner