Starfleet Pilot - First enemy, AI and pathfinding


A long time has passed since my last update, but a lot has happened as well. I took a longer than usual holiday break, during which I was able to give Starfleet Pilot for playtesting latest improvements I would like to share here.

First enemy - the drone

This is the first enemy type in the game. It has a plasma engine, yellow shields, hovers over the ground and shoots with a red laser.

Drone just sitting there.

Drone just sitting there.

It tries to stay away from the player, change its position to avoid damage, and flank the player when possible. All enemies are independent for now, and they try to kill the player at any cost -- even if they shoot in the back of other drones!

Pathfinding

While flying away from the player, enemies also try to avoid obstacles as much as possible. This is done with a custom pathfinding component, which drones are installed with. All tiles have precomputed grid of obstacle types enemies have to avoid (or can pass through). Then each drone finds a shortest path to the target position with an A* algorithm, and follows the path node by node. In order for the move to look smother, nodes that are along the straight line are removed.

You can see the pathginding algorithm in action here. Purple arrows represent paths along which drones are moving. Paths are recalculated every second in order to accomondate for player movement and level changes.

Pathfinding in action.

Pathfinding in action.

What's next?

Enemy system is in early stage, and the first feedback I got is that currently there are too many enemies (at least for beginners). So there will be some amount of tuning needed before this can be considered done.

Other immediate updates that are planned is new UI look&feel which I will be sending an update soon.

Stay tuned,

Dawid

Get Starfleet Pilot

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.