Enemy Movement and Path Layout


This week I worked on the path layout for the enemies to follow during gameplay.

There are eight different paths possible for an enemy to take on their way to the goal. I've defined these paths by segmenting the path into 3 sections, with the top half of the map defined by the letter A, and the bottom half defined by the letter B. Using this notation we have these eight possible paths:

  • AAA (all along the top)
  • AAB (first two segments are along the top and then the path crosses to the bottom for the third and final path segment)
  • ABA (first segment is along the top, second along the bottom, and third along the top)
  • ABB (same idea)
  • BAA
  • BAB
  • BBA
  • BBB

Below is a map of the waypoints (in blue) used the construct these paths, with a few overlapping ones to represent different directions up and down the connecting paths. There are 20 in total. As I've mentioned in earlier devlogs, the starting point is on the right, and the goal is on the left.

Each enemy upon spawning in has a path assigned to it (a three character combination of A and B). This will allow in the future for waves to have enemies that follow different paths from each other or spawn in groups all following the same path.

My next job is to give the enemies a random offset so that they don't always appear right in the middle of the path. I'm also working on improving the corner movement to make it circular instead of angular.

As always, stay tuned for more!

Get Offworld Defender

Leave a comment

Log in with itch.io to leave a comment.