Author Topic: Need Some AI Help  (Read 331 times)

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Need Some AI Help
« on: November 27, 2011, 09:09:23 pm »


               One of the areas I am designing for my module is to be illuminated by magical lights that move randomly throughout the area. To this end I have designed a creature that has a light VFX applied to it.

I am currently using the OnHeartbeat event with ActionMoveAwayFromObject to keep it moving away from the PC to a distance of 60 meters. However, the default AI is proving quite troublesome - it keeps cornering the little orbs whenever the PC comes near or ignores the action command all together. I'd much rather use ActionRandomWalk, but that didn't work much better.

Essentially the lights just have to move randomly over the area map. I'd use WalkWaypoints, but the pattern is too linear. Any ideas - that aren't too CPU intensive - I know someone out there has to have done something similar...
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Need Some AI Help
« Reply #1 on: November 27, 2011, 09:38:50 pm »


               You could jump the creatures to a random waypoint whenever you determine that they are stuck.
               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Need Some AI Help
« Reply #2 on: November 27, 2011, 09:45:11 pm »


               Unfortunately they only get stuck in sight of the PC...so that option won't work for me.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Need Some AI Help
« Reply #3 on: November 27, 2011, 10:01:27 pm »


               Do the creatures have a cutscene ghost effect so that other creatures can't corner them?
               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Need Some AI Help
« Reply #4 on: November 27, 2011, 10:03:50 pm »


               Well it would appear I found a pretty reliable workaround that doesn't require an OnHeartbeat event and so far is pretty stable - I wrote a custom AI that drops the same four lines of code into each of the custom AI required events:

OnPerception
OnSpellCastAt
OnPhysicalAttacked
OnDisturbed

Since its essentially a moving lightbulb, the creature won't fight back so I don't need to worry about anything fancy...
               
               

               


                     Modifié par Pstemarie, 27 novembre 2011 - 10:05 .
                     
                  


            

Legacy_Rolo Kipp

  • Hero Member
  • *****
  • Posts: 4349
  • Karma: +0/-0
Need Some AI Help
« Reply #5 on: November 27, 2011, 10:12:45 pm »


               <offering a little...>

What I did with my SummonPack code, where I wanted the pack to melt out of the shadows at some distance away from the Alpha, but *didn't* want to just randomize the spawn point or accidentally put them somewhere where "ya cain't git thar from heah"; I created a number of invisible sprites who sped at DM speed away from the Alpha for a short time. At the end of that time, they self-destructed and spawned in (vice versa) the pack.

So, an option for you is to create an invis Searcher, have it jump to a spot in the clear and forcemove your light to the searcher.  Move to object uses much better pathfinding than move to location.

Alternatively, put waypoints around the area, and when it get's stuck, have it head for the waypoint farthest from PC - again, moving to object.

<...help>