Mark Sachs (ksleet) wrote,
Mark Sachs

  • Mood:
  • Music:

A bit more AI work.

Did some more AI work on Neon Galaxy tonight. No flashy pictures, sadly.

Basically, I got it working so that an AI can be stored in an XML file on disk. So the test AI I've been using, which pursues any closely approaching players for 3 seconds before losing interest, ends up looking like this...

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<behavior name="pursue" type="ram" />
<behavior name="ram" type="ram" />
<behavior name="idle" type="idle" />
<condition target="ram" type="circulardetection" radius="100" entity="PlayerShip" />
<condition target="idle" type="inbehavior" behavior="pursue" time="3" />
<condition target="pursue" type="and">
	<condition type="circulardetection" radius="300" entity="PlayerShip" />
	<condition type="or">
		<condition type="inbehavior" behavior="pursue" />
		<condition type="inbehavior" behavior="ram" />
<condition target="idle" type="true" />

While XML will never be accused of being pretty, this is still worlds easier to fool with than hand-crafting each AI in code. It also strikes me that as long as we're loading the AI for the enemy from an XML file anyway, I might as well specify the rest of the enemy's characteristics -- its graphics, abilities, hit points, movement type, et cetera -- in the XML file as well. Every step I follow down that road makes it a little easier for me, or I suppose any potential modders, to tweak out the enemies in the game.

Of course, before I get ahead of myself specifying abilities, hit points, and movement types in an XML file, I should probably give the enemies some... you know... abilities, hit points, and movement types. That might help.

At any rate: if you'll excuse me, all this dedicated hard work deserves a reward. A delicious brownie awaits!
Tags: neon galaxy
  • Post a new comment


    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.