Home    LittleBigPlanet 2 - 3 - Vita - Karting    LittleBigPlanet 2    [LBP2] Help!
#1

Enemy AI - Predatory pack animals

Archive: 2 posts


In my top down level, one of the first enemy types you encounter is a pack of hostile wolves. I could go the whole "always aggressive, always mindlessly attacking the player" route, but I'd like the wolf-pack fight to be exciting. I'd like for the wolves to almost be a separate character in the story. So I need some advanced, pack animal-like behavioral AI. Before I try to cobble some random pieces of logic together until I have something that kind of works (which is what I usually do) I thought I'd post the question here to see if anyone has any brilliant ideas on how to begin. Here's a few questions for your consideration:

-Should I incorporate an Alpha Male? A slightly larger wolf that hangs out in the back while his pack does his dirty work? Then when you kill him the pack could scatter.

-How do I even get them to independently circle a moving, dynamic player character?

-Assuming the above is possible, should I have a finite number of attack patterns (which could have specific audio cues to warn the player) or should I try to go for completely random, unscripted behavior.

I'm a big fan of this community, and of these boards in particular (some of you guys are nothing short of genius!) so I'm hoping someone has some epiphany concerning this problem. Thanks in advance for your help
2011-02-18 02:18:00

Author:
bloomchild
Posts: 74


Sounds very similar to my starbase defense AI, where units circle the base, defending against enemies, and when the number of defenders meets a threshold, they start moving out in packs to other starbases. Both of us have the units circling the central unit, and the units moving in packs.

I'll tell you how it goes. My idea requires the base to 'target' random units when at max capacity, and this sends a tag to a unit, which turns off the 'circling' logic, and turns on the pack AI. The units then move within a certain range of each-other, and then when the capacity of the pack reaches its max, it targets a nearby enemy base to attack and moves towards it. Upon arrival, they units then circle the enemy base at a further range than the defenders until they are either destroyed or destroy all the defenders, in which case they target the enemy base until captured or the base defenses destroy the attacking units.

Each unit has a tag (or multiple for the more advanced units), which activate the sensor for capacity. The targets are just hologram with the logic to modify the AI of the units.

__________

My suggestion for your design

For you, all that needs to be done is have the pack use a follower with range of the distance you want to circle, and use a mover perpendicular to the pull of the follower. When you want them to attack, just use a sequencer to turn off the followers and mover, turn on a player follower and then have a sensor for when in range of attack. This way, the units will only go so far as the sequencer allows them to by having the other 2nd follower activated for 'X' amount of time, then they go back to circling the central unit.

Hope this helps. Haven't done it myself yet, but 'should' work.
2011-02-18 02:49:00

Author:
SSTAGG1
Posts: 1136


LBPCentral Archive Statistics
Posts: 1077139    Threads: 69970    Members: 9661    Archive-Date: 2019-01-19

Datenschutz
Aus dem Archiv wurden alle persönlichen Daten wie Name, Anschrift, Email etc. - aber auch sämtliche Inhalte wie z.B. persönliche Nachrichten - entfernt.
Die Nutzung dieser Webseite erfolgt ohne Speicherung personenbezogener Daten. Es werden keinerlei Cookies, Logs, 3rd-Party-Plugins etc. verwendet.