Wired Vagrant

Home | Posts | Tags

Polygonal map generation and pathfinding

I put my nose a while ago in the very interesting world map generation via Voronoi polygons by Amit and quickly dreamed to implement such a system for map generation in games.

Around the same time I was also messing around with an A* library for AS3 by Dauntless. So I decided to combine both!

The main challenge was to create actual Sprites to contain each territory, as originally the whole map is just contained in one unique Sprite. Once I had the territories, it was then easy to interact with them and implement a pathfinding solution. If I end up cleaning my code, I’ll try to post it on GitHub… but right now you can already generate maps and play with the pathfinding:

Click to try!

Click to try!

PS: It’s been a while since I posted, for various reasons… Too many good games to play like Space Marine/Shogun 2, got married and I also got a new job allowing me to do what I love, coding video games 😉