Zania Day 17: AI 3

Completed work:

Removed planets, gravity , discovered  a weird constant acceleration that pushes all objects towards the 4th quadrant.

Turns out that I removed gravity in the wrong way and I ended up killing all possible force application. Making the initial number the predominant force in the world. AI is still not tracking the player correctly.

Added some public static function to DebugHUD so I can monitor variables real time in the game world and inject numbers from any classes.

Removed gravity and planets

WTF? TextField in Flash cannot be static. Spent the whole afternoon finding out why I can’t see the number I needed.

Incomplete work:

Inventory display at Player.as Line 93 is done through debug GUI right now, so compilation is not possible without DEBUG::MODE on.

AI class will make movement decision on each frame update.

AI Targeting (Do this first):

  • Get Player position
  • Get Current position
  • Face player? (Done)
    • ApplyTorque (Done)
    • Radian calculation using atan2 (Verify)
    • Problems
      • Limit radian range to one circle only and redo the calculation (Done)
      • Limit angular velocity for now
      • Create a test system where there are no gravity nor planet to test the AI (Done)
  • Distance from player?
    • ApplyForce?
  • Player in weapon range?
    • Attack
  • AI’s simple first iteration algorithm
    • Define player position, approach player, shoot when within range.

Need to change actor creation to be based on sol.xml loading. (See Sol class)

Need to bring shooting action to the SolarSystem spawner and create a new constructor for bullets.

  • Right now it’s the ship that spawns the bullets.
    • Do I want ships to spawn the bullets?
  • Bullets does not need interaction with the rest of the system besides the physics
    • Physics already linked.
  • OnCollision event? Bullet upate? Or the solarSystem’s job?

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>