Wednesday, May 16, 2012

Infiltrator - Part 22 - Primordial Code

The majority of this session went into one very fun improvement. It's not that great, nor is it something that can be fully communicated via screenshot, but it's awesome anyway.



I was working on the AI code for the fighters, which are the blue enemies pictured here. I had a very simple routine in mind:

1. Plot a path toward the player
2. Set thrusters to move along said path
3. If in the player's shooting line, add needed motion to head out of it to the setting on the thrusters
4. Apply thruster motion

I was having a hard time making this work in code. I could never get all of it to mesh together 100% properly. I essentially had this "primordial code" which contained most of what was needed to work the above steps, but wasn't functional yet. Then finally, I applied the final change and ran the program. The resulting enemy behavior felt so weird in an awesome way. I tried to shoot these simple and idiotic AI enemies who's programs I had spent hours inside of, and they dodged and reacted in a scarily spontaneous seeming way. They're still knuckle-heads, I made sure of that, but I never really pictured myself creating such AI before.

So that's where this whole session went. The fighters don't try to kill you yet, so that's obviously on the list for the next session. I also want to redo the shield indicator on the HUD, as it can get in the way when you're travelling downward.

All in all, this project is becoming significantly more sophisticated, fun, and interesting than I expected when I started it. I still don't think I'll realistically be able to finish it before life catches up with me and makes me stop spending time on fun stuff like this, but at least it's fun while it lasts.

        --LazerBlade

No comments:

Post a Comment