Pathfinding AI Improved

So many rats, it's almost unbelievable
So many rats, it’s almost unbelievable

Pathfinding on the pixel level works great now.

As you can see in the above screenshot, the rats will find their way to you really fast. It’s so much better than the tile based pathing that it’ll take some rebalancing. If an interior room full of fast moving monsters suddenly gets opened, they’ll swarm you really fast if they have a path to you. One archer or knight is not going to be able to take them out. AOE attacks from the bomber will be a bit more effective though, and maybe even necessary if you face something like the above scenario.

A new dimension in balancing will also be the monster AI. The red rats above are using omniscient pathing, meaning they have a psychic awareness of the summoner’s location, and will find the fastest route there. This type of behavior might need to be used sparingly, because it’ll get overwhelming. A lot of lower level mobs will wander aimlessly, use Gauntlet style movement, or need vision to be aggroed. Boss creatures can also affect the AI of the lower level mobs, for example granting them awareness of the player’s position.

We’ve Achieved High Resolution

I could post a screenshot, but you wouldn’t be able to tell the difference… but today was entirely focused on getting ready for the move to HD. I have decoupled the tile pixel dimensions from their world dimensions. With the change of a single line, I can set the world up to use tiles of any size (32×32, 24×24, or 64×64 like Escape Goat 2). The move speeds and hitbox dimensions are calculated independently of this.

I still need to figure out a good native grid size: how many tiles are visible on screen at once. Soulcaster II had a visible size of 22×16 tiles. I’ve currently got the tiles scaled to 40×40 pixels, which at 1280×720 gives me a maximum visible grid of 31×17.  Here’s what that looks like:

maxsize_31x17Right now that seems a bit larger than I want. Bringing in the width a bit, here’s 29×17:

29x17A bit more manageable, and I think the aspect ratio is a little nicer.  Narrowing it a bit more, to 27×17:

27x17The beauty of this game being procedurally generated is that I don’t have to decide on a visible tile size (default room size) right now. I can make patterns of a variety of sizes, and have the game arrange them in larger rooms. Since the game will have scrolling in two dimensions, there will be some enormous rooms, where you can’t see all the enemies and obstacles at once.  The engine also supports variable room sizes, and will center the room in the viewport with optional zooming. (Escape Goat 2 did this, and would zoom in up to 25% larger than default size).