Navigation Fix, Enemy Movement


Today I spent some time solving a minor issue with player movement (navigation). Previously it would simply stop moving if you told it to go to a place that was unreachable, and now it will continue moving to the last reachable destination before stopping.

After that I tackled giving the enemy the ability to aggro on the player if walks close enough, which causes it to follow the player around. It will stop when it gets within attack range, but it doesn't have any actual attacks yet. A single hit will still kill it every time.

Making the change briefly introduced a bug where the enemy became unkillable, but would still drop loot with every hit, but fortunately this was easy to fix. I also had to make adjustments so that it wasn't possible to score multiple killing blows that resulted in loot drops before it would actually "die".

Having the enemy simple make a straight line to the player isn't the most thrilling combat movement, so I'm pondering how I'll make it more interesting than that in the near future. I also need to give some careful thought to how damage will be dealt between the player and the enemy units, and that will mean writing some more complicated code than simply reducing health by x when an attack enters the hurt box. Eventually damage will need to be calculated based on stats of the attacker, and then modified based on defensive stats of the recipient. For now, stats do not exist yet.

Enemies will navigate around corners to reach the player, so that part is working now.

Files

movedemo_win_e2932b26.zip 41 MB
Dec 06, 2023
movedemo_linux_e2932b26.zip 38 MB
Dec 06, 2023

Get Action RPG Prototype

Leave a comment

Log in with itch.io to leave a comment.