Spellcaster Studios

Make it happen…

Navigation and bugs

Today I tackled a difficult subsystem: the “make sure you can walk everywhere” system.

I have a system that makes sure the player can walk on all the game area, and usually it would raise/lower terrain to achieve that… That work relatively well, but with the rivers, etc, lowering and raising terrain would sometimes screw up the rivers big time!

So I decided to build a new system… What it does is mark all the areas, find points of interest (boundaries) and then find the closest points between boundaries and join them together with a “bridge” (not necessarily a bridge, but some sort of ramp). The GIF below illustrates this (you can see the green area in the left/middle of the map disappearing in the first frames).

area00

This worked fine, but it created sometimes this problem:

screen500

You can hardly reach the place where the bridge was built (the water tiles)… To avoid this, I had to change the algorithm so that it uses a better heuristic to find the “points of interest”, namely they there has to be a certain number of tiles around it with the same area id:

area01

The selection then became much better, and the bridges are looking great, but it added another issue: the map used the heightmap to display… But the bridges don’t affect the heightmap, which means they aren’t shown… So I had to build another subsystem to take care of that, wasting more RAM and it was tricky to debug (I had a silly error on it).

screen501

Now I found lots of small bugs in the game, which I need to fix before moving towards the next task…

Now listening to “Time of the Oath” by “Helloween”

Link of the Day: Very interesting art style for a game:

Comment