Line of sight demo

Tuesday, 4 September 2007 | Labels: , , , , | |

I've switched track for a bit. This time working on the AI. This demo shows some line of sight testing. The code calculates 3 rays from an eye that intersect with the two limits and centre of an AABB. If the object is visible the the turret calculates a firing solution and fire. At the moment this is all done every frame (30fps). I'll spread this calculation out over a series of frames. The current enemy AI plan is:

  1. Create a list of target candidates within range (1.5x the firing range of the turret)
  2. Prioritize list
  3. Lock target
  4. Check visibility
  5. Calculate firing solution and fire.
  6. Reload
  7. Goto 4

The controls are the same. WASD to move the player, click to fire in the direction of the mouse.