Author Topic: [Sexp Request] ai-scan-object  (Read 4187 times)

0 Members and 1 Guest are viewing this topic.

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Re: [Sexp Request] ai-scan-object
I should clarify my comments to emphasize that creating a new ai goal isn't impossible, just - as Battuta said - annoyingly complex.  There are a lot of things to keep track of, you'd be blazing a trail where few non- coders have ventured before, and you'd run a risk of breaking something in the process.

But it's definitely solvable, especially if you broke the goal into several sub-problems to be solved one-at-a-time.  One way you could approach it is by essentially duplicating the "approach" part of the ai-chase code.  Instead of transitioning into the "attack" or "shoot" sub-goal, you'd just maintain a certain distance until the scan time elapsed.  The AI automatically breaks off an attack if it receives a certain amount of damage, so you could copy that logic without changes (albeit maybe adjusting for importance, since scanning something is less important than attacking a critical target).  But you'd also have to make sure the scan timestamp is reset if the fighter falls too far behind or moves outside of the "view cone" while it's in the middle of scanning.  And if the fighter "loses scan lock", you may find that it crashes around wildly before reacquiring it.
« Last Edit: June 06, 2011, 10:35:00 pm by Goober5000 »

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: [Sexp Request] ai-scan-object
Mjn, you know I think you're awesome, but I can't help but feel this is a lot of work for relatively little gain.

Oh I dunno. I can think of a crapton of uses for this kinda of thing. Regardless, I'd like to hear that from a coder familiar with the sexp system.

I should clarify my comments to emphasize that creating a new ai goal isn't impossible, just - as Battuta said - annoyingly complex.  There are a lot of things to keep track of, you'd be blazing a trail where few non- coders have ventured before, and you'd run a risk of breaking something in the process.

But it's definitely solvable, especially if you broke the goal into several sub-problems to be solved one-at-a-time.  One way you could approach it is by essentially duplicating the "approach" part of the ai-chase code.  Instead of transitioning into the "attack" or "shoot" sub-goal, you'd just maintain a certain distance until the scan time elapsed.  The AI automatically breaks off an attack if it receives a certain amount of damage, so you could copy that logic without changes (albeit maybe adjusting for importance, since scanning something is less important than attacking a critical target).  But you'd also have to make sure the scan timestamp is reset if the fighter falls too far behind or moves outside of the "view cone" while it's in the middle of scanning.  And if the fighter "loses scan lock", you may find that it crashes around wildly before reacquiring it.

Well there, you've got it!