September 18th: Foothold

Okay the navigation problem took me a little while to figure out but I think I got it. Basically, one part of the navigation system assumed the entity would try to jump from the center of the tile, whereas the entity will actually try to jump as soon as it enters the tile. I fixed this for the moment by making it so when calculating which jumps are possible it assumes the entity is jumping from the lowest point on the tile: This is probably not optimal since it incorrectly culls out a few jumps that should be possible to make, but it fixes the problem for the moment.

The reason I went with this not-great solution, though, was that the far edge of the tile isn’t always going to be accessible — a fat enemy, for instance, won’t be able to stand on the edge of a tile at the base of a wall because its body will get in the way. I haven’t really accounted for width in any of the pathfinding calculations thus far, and adding that in would be a substantial undertaking which I don’t want to tackle unless I need it, so I’m going to just ignore that potential issue for now.

The movement still needs some work. The entity frequently overshoots the tile it’s aiming for and then runs back to hit it before continuing on its path, rather than recalculating its path when it overshoots. It seems way too unaware of the player in the middle of combat: Jumping over its head consistently baffles it since to its mind you just completely disappeared. Rather than trying to do something crazy like give it peripheral vision, though, I’ll probably just give it perfect awareness of the player once it’s already alerted and within a certain radius, so you have to be at least a LITTLE subtle to give it the slip. Tomorrow I hope to tackle programming those improvements and also see about making a better turn animation.

Advertisements

About problemmachine

What is the nature of your problem? Can we modify the nature of your problem? Can your problem be touched? Eaten? May we eat your problem for you? May we eat your soul for you? Would you like a replacement problem? We make problems. We eat souls. We crap solutions. We are Problem Machine.
This entry was posted in Daily Update, Programming. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s