AI (Not that kind)

I got a bunch of the animations for the enemy (now I’m calling a “patrol bot”) together to handle it’s movement.Then while I was on a role I threw in some basic AI. Essentially what the robot does is:

  • Looks for player (not implemented)
  • Runs towards the player
  • Starts shooting
  • Moves around to random points in a circle around the player (Within 20 deg of where it currently is, assuming the player is the center of this movement circle) That white ball is a quick representation of where the robot chose to move next.

Nothing to crazy here, the bigger issue (like most of unreal) is knowing what won’t back you into a corner and force you to undo everything you’ve made. Here I have two custom tasks and one custom decorator. The “PatrolBotShoot” task was originally executing a fire function but I flipped the bot to a simple “if Has target then shoot every 1 seconds” mechanism to allow for firing at any moment. The “PatrolBotStrafe” Selects a random point around the player and keeps the patrol bot focused on the player as it moves around. The “PatrolBotKeepFacingTarget” decorator does exactly what it sounds like.

The animations are still the hardest part of all of game dev in my opinion:

The sequence below took five individually made animations (The strafing still looks too timid to me) and pushed the limits of my patience when dealing with imports to unreal (unreal seems to have weird issues if you import ONLY the animations from a .glx file).

In other news I also started reworking the muzzle flash for weapons but I’m still working the kinks out.

My goal here (if I didn’t say it before) is to swap in the rifle on the back of the robot for different weapons, then I dont have to do any more work on animations and I can just focus on environment art (which I’m sorely lacking experience for) and gameplay.

Leave a Reply