Spellcaster Studios

Make it happen…

Oh no, more pathfinding problem!

I was looking for a planet to test the “no oxygen” text, and I found an asteroid… I dropped down and… nothing happened… Just a blank screen for ages, until I gave up and closed the game…

Found out I was stuck in the navigation mesh generation… For those that don’t follow my blog often, I‘m using an awesome external library called “Recast”… This library is done by a dev working for Unity (and I think he worked on Crytek as well), and is a very good one, since it’s relatively isolated, easy to use and very powerful…

But apparentely, it was having problems generating the navigation mesh for a simple terrain like:

screen252

Even more strange, is that it wasn’t having any issue with a more complex terrain, like:

screen253

Even simplifying further the terrain yielded no results… The system was stuck simplifying the mesh…

In despair, I decided to upgrade my one-year old version of recast… Ah, progress! Now it generated something, it was just rubish:

screen255

So, maybe it’s just a display problem, some layout thing that changed… That would be weird, since the navigation mesh on the Skydancer was working properly, but yet…

So I went to see how enemies behaved… I got to some enemies, and they weren’t able to do any pathfinding… they’d just stand in their position, not moving at all!

After a bit of looking around, I remembered I did a “change” in the Recast code… I enabled a flag that allowed for “virtual query functions”, so that I can have different rules for movement, recompiled the code and now the enemies seemed to work properly, although the display of the mesh was still wacky…

So, I went to Recast’s code and copied his display code, and although it looked a bit better, it was still a jumble:

screen256

You can see no navigation mesh to the north, all the colors are a jumble…

After some minutes, I actually tracked the problem to my triangle renderer… This mesh has too many triangles for a single mesh, so it was overflowing the buffer!

The end result was this:

screen258

Way better!

So, problem fixed by upgrading Recast… That’s great, but it took me too long to get here, unfortunately! Sad smile

Oh well, there’s always tomorrow!

Now listening to “Reroute to Remain” by “In Flames”

Now playing: Just finished “Assassin’s Creed IV: Black Flag” yesterday (which I enjoyed very much, nothing too new for the series, but I liked the whole storyline thing, both real world and Animus, and the gameplay was as good as the series has used us to… I enjoyed it more than Assassin’s Creed III, in any case, which I thought was boring)… so I’m back playing Halfway, a turn-based pixel-art indie strategy title.

Link of the Day: I haven’t played “Planetary Annihilation” yet (bought it today on Steam), but the guys at Uber can really make amazing trailers that get you really pumped for their games! Here’s their new game’s trailer:

Comment