The Elder Scrolls Forums

TES Construction Set and Plugins
   >> General TES Construction Set
Thread views: 1250

Pages in this thread: 1 | 2 | 3 | (show all)   Print Thread
wakim
(Layman)
10/02/02 07:32 PM
Flee AI help  

I would be appreciative if anyone could help me with what variables, I suspect either in the "Gameplay - Game Settings - Gameplay" menu or the individual creature/NPC AI settings menu, that could be adjusted to allow creatures/NPCs to flee during combat. I have extensively played through Morrowind and have only seen one NPC ever flee (when I wasn't using invisibility or sneak or chameleon). The quote from TES construction set help file referencing the FleeAI; "This is used in determining how apt the actor is to flee. It is used in a much larger AI strategy that will not be documented in this help file." causes me to chuckle, as nothing ever flees.

I would like to modify the game settings as necessary to allow logically passive in temperment creatures (e.g. guars) and severely wounded critters to seek to preserve their lives by fleeing, much as most PCs do when confronted by a similar circumstance. In the Gamplay Settings variable fields there are entries for fAIFleeFleeMult, fAIFleeHealthMult, and iFlee. I have tried playing with these numbers, but have had no success in creating the behavior I wish from the AI. Without knowing what these variables mean (or the formulas that employ them) I am shooting in the dark. Setting the individual creature's Flee Rating to 100 seems to cause them to always flee from melee, even when at full health, but setting it to 90 causes them to always fight to the death rather than flee. What I would ideally wish to create is a more diverse AI reaction to combat so that creatures can, in general, flee when wounded (set in Gameplay Settings?), and depend upon their individual AI settings to determine the severity of the wounds that would cause them to flee.

I suspect that this single AI modification would add to the diversity of combat (no more standing and clicking till the opponent is dead, now perhaps forcing PCs to give chase, or change tactics, or pursue fleeing creatures deeper into uncharted territory).

Also, on a related note, has anyone ever had the turn undead spell ever cause an undead to flee? At turn magnitude 100 I haven't had any undead ever run. I haven't tried demoralize creature/humaniod extensively, but I haven't had these spells work either. The current never-fleeing NPC AI eliminates the alternative non-lethal tactics that might otherwise be effective strategies and would have a home in a RPG such as Morrowind strives be.

Any help would be appreciated.

Post Extras: Print Post

Horatio
(Curate)
10/02/02 11:39 PM
Re: Flee AI help [re: wakim] 

the only thing you can do is play around with the gameplay settings. there's no other approach. the flee AI could just be broken - which wouldn't really surprise me given the general quality of combat AI.

i think i've had creatures/NPCs attempt to flee from me, but it could have just been a pathfinding spasm (which they seem to have occasionally). the fleeing would only last a couple seconds, then they'd turn around and impale themselves on my sword.

good luck though. post any results you get through tweaking those variables as i would definitely use it in my game.

cheers

h

Post Extras: Print Post

wakim
(Layman)
10/03/02 02:49 AM
Re: Flee AI help [re: wakim] 

Random experimentation has been my approach so far, to no avail. I either get all or nothing. I suppose that eventually I will divine the break points on these variables. I doesn't help that I don't have a clue as to the effects or value of the increments (is the variable scaled from 1 to 100, or as a percent 1.00 being 100 percent, or as a true false 0 being off and 1 being on?).

So far I have determined that fAIFleeHealthMult when changed from its default of 7.0 to 90.0 causes everything to flee when it reaches about 10 percent health. Changing it to a value of 20.0 seems to have no effect though. fAIFleeFleeMult when changed from 0.3 to 10 seems to cause high Flee rated creatures (the 0 to 100 individual scale) to flee earlier, but has no or little effect on low Flee rated creatures. iFlee value, when changed from 0 to 1 seemed to cause no observable difference. How these three variables interact is still a mystery to me.

I will set up a testing cell with eleven guars in it, each having 100 hit points, and each named after their individual flee rating (guar0 through guar10) and blast them each with a custom made ten point damage spell to see if I can get a better handle on how changing the Gameplay settings affects their propensity to fight or flee.

As an aside, you will know when an NPC is fleeing, most have specific .wav files they shout out when they enter flee mode. Once something enters flee mode they exhibit very different behavior. Creatures will run from you, then after a time run back at you to bite or slash a couple of times, then run away again. They seem to enter a harassment mode - hitting and running as it were. In addition, my current test guar, when he enters flee mode will only run out of combat range, then stop. If I switch to a bow from a sword he will start running again...back to sword, and he instantly stops running. Guars are smarter than you think.

Post Extras: Print Post

GhanBuriGhan
(Disciple)
10/03/02 03:28 AM
Re: Flee AI help [re: wakim] 

I could be wrong as I have not myself played extensively with the variables, but I think much depends on the relation of the (Individual) flee and Fight setting. Such that you will have to both lower the Fight setting and raise the flee stting to get a realistic behavior.

In the end however you might have to resort to scripting to achieve the behavior you want, especially if you want something more complex. There you have many more options, as you can specifically control relevant variables (Health, Magic, etc.) and turn combat on/off and change the AIPackage and the settings of the AIPackage. That would be a worthwhile mod.
E.g. I used this aproach to make a "shy guar" for a quest, that always flees to a distance of 800 units, then waits until the player comes closer than 200 units before it flees again etc.



---//Forum Scholars guild\\---

Lecturer on Morrowind natural history
Get the "Modern Adventurer" Morrowinds #1 in-game journal

Post Extras: Print Post

wakim
(Layman)
10/03/02 08:14 PM
Re: The Great Guar Massacre [re: wakim] 

I have spent some time testing out the Morrowind AI. The goal was to obtain more realistic behavior from the NPCs/creatures; specifically by allowing them to flee from combat, at least occasionally, and as an aside to perhaps thusly allow the demoralize and turn undead line of spells to work, and also the frenzy line.

My test set up is this: eleven guars, each with exactly 100 hitpoints, in an approximate 6X6 tile room I built. The guars were named Guar00, Guar10, ..., Guar100. Each Guar had its individual AI Flee setting set to match the numeric quantity in its name. The guar's all shared the same individual AI Fight setting. Initially this was at the default (for a guar) of 70. The second test series changed the individual AI Fight settings to 10. The variable for both series of tests was the global setting found in "Gameplay - Game Settings - Gameplay" menu called fAIFleeFleeMult.

I started with Guar100 and punched him, inflicting no damage. If he stayed and fought me I would cast a 10pt damage health spell on him and observe his behavior. I would repeat this until he either ran or died. Occasionally when a guar ran, he would begin what I term harassing behavior; he would run, but after a period of time run back to me, bite me once, twice, or three times, and then run off again. If he exhibited this behavior I would damage his health 10 points more and observe again. The more damaged a harasser became, the less frequently he would return to bite, and the fewer times he would bite per return. Eventually, as the guar became more damaged, the harassment would stop and the guar would not return. When this happened I would note his health and call him a runner.

This data is supplied in the following post in what I'll try to make a readable table.

Post Extras: Print Post

wakim
(Layman)
10/03/02 09:07 PM
Re: fAIFleeFleeMult. How many more guars have to die? [re: wakim] 

fAIFleeFleeMult: Guar100 Guar90 Guar80 Guar70 Guar060 Guar50 Guar40 Guar30 Guar20 Guar10 Guar00

0.1 : .................. R ....... F ....... F ....... F ....... F ....... F ....... F ....... F ....... F ....... F ....... F

0.3(default):........ R ....... F ....... F ....... F ....... F ....... F ....... F ....... F ....... F ....... F ....... F

1.0 : .................. R ....... R .F/H(80)/R(25). F .... F ....... F ....... F ....... F ....... F ....... F ....... F

1.5 : .................. R ....... R ....... R ....... R ....... R ....F/H(15)... F ....... F ....... F ....... F ....... F

2.0 : .................. R ....... R ....... R ....... R ....... R ....... R .F/H(80)/R(20). F .... F ....... F ....... F

2.5 : .................. R ....... R ....... R ....... R ....... R ....... R ....... R ....F/H(15)... F ....... F ....... F

3.0 : .................. R ....... R ....... R ....... R ....... R ....... R ....... R ....... R ....... F ....... F ....... F

3.5 : .................. R ....... R ....... R ....... R ....... R ....... R ....... R ....... R ....... F ....... F ....... F

4.0 : .................. R ....... R ....... R ....... R ....... R ....... R ....... R ....... R .F/H(80)/R(40). F ....... F

4.5 : .................. R ....... R ....... R ....... R ....... R ....... R ....... R ....... R ....... R ....... F ....... F

5.0 : .................. R ....... R ....... R ....... R ....... R ....... R ....... R ....... R ....... R ....... F ....... F

5.5 : .................. R ....... R ....... R ....... R ....... R ....... R ....... R ....... R ....... R ....... F ....... F



note:
F = Fight till dead
H = Harass
R = Run
(#) = Percent remaining health when guar adopted behavior, so F/H(80)/R(20) means that that particular guar fought until his health was at 80 percent, then switched to harassment (hit and run tactic) until he was at 20 percent health, when he simply avoided me (ran).

All guars for this test have an AI Fight setting of 70

I apologize for the lack of columns in the table, but I am innocent of how to achieve that in this forum. The post seems to ignore however many spaces or tabs I try to insert.

Post Extras: Print Post

wakim
(Layman)
10/03/02 09:28 PM
Re: Interim conclusions [re: wakim] 

I repeated the test with the eleven guars set at an individual AI Fight setting of 10 instead of their default 70, and the results were the same (no, I won't post another table of data). My conclusions thus far are that the AI Fight setting is only used to determine if any given NPC will attack you, and is not used for anything else. Once an NPC has decided to enter combat the setting for AI Fight is irrelevant.

My conclusion so far about the importance of the fAIFleeFleeMult is that it clearly has strong influence on whether or not any given creature will decide to flee, however it seems to be a global slider, i.e.:

at fAIFleeFleeMult of 0.3 (default) only creatures with an individual AI Flee rating of 100 will run.

at fAIFleeFleeMult of 1.0 only creatures with an individual AI Flee rating of 80 or higher will run.

at fAIFleeFleeMult of 2.0 only creatures with an individual AI Flee rating of 40 or higher will run.

at fAIFleeFleeMult of 3.0 only creatures with an individual AI Flee rating of 30 or higher will run.

at fAIFleeFleeMult of 4.0 to 5.5 only creatures with an individual AI Flee rating of 20 or higher will run.

The interesting creature behavior occurred when a creature fell on the cusp and would both fight, harass, and run depending upon its current health. Only creatures that were capable of these three behaviors could be affected by the spell line demoralize (and I assume other AI influencing spells: frenzy and turn). If a creature can not demonstrate fight, harass, and run behaviors then these spells lines are usless.

Now, the question is what influence do the global variables fAIFleeHealthMult and iFlee have upon behavior, and how do they intertwine with fAIFleeFleeMult?

Post Extras: Print Post

Daerk
(Acolyte)
10/03/02 10:03 PM
Re: Interim conclusions [re: wakim] 


extremely cool... notice the values in which a critter will exhibit all 3 states are all (divisible by/multiple of) the number 2...

this should really help in setting far more realistic critters to fight in the game, heh... a new project... LGCPP (Less Generic Critter Personality Project)... I'll be sure to include/experiment with these settings in my own mod... i'm creating a wolf critter atm, if I can find a decent wolf 3ds max model it'll save a bunch of time... i'll use this for my wolf

-- Daerk (scriptin) Ildatch

*.sig file drooling on a Seducer mannequin in his private house.

Post Extras: Print Post

Daerk
(Acolyte)
10/03/02 10:19 PM
Re: Interim conclusions [re: Daerk] 

btw (by the way)...

to make a table format properly in the forum, just place the following brackets before, and then after, the tab-spaced table...


[ code ]
test <tabs> test
test2 <tabs> test2
[ /code ]



(without the spaces between the brackets and the code /code commands)

-- Daerk (testin forum PRE commands) Ildatch

*.sig file nursing sucking chest wound delivered from Titan Skeleton in GIANTS 2.0 (i wish)

Post Extras: Print Post

Horatio
(Curate)
10/04/02 12:19 AM
Re: fAIFleeFleeMult. How many more guars have to die? [re: wakim] 

you should repeat the test for different values of fAIFleeHealthMult. although it would probably get pretty tedious. but those results would probably give a total picture of how the flee mechanism works.

i'd like to know how to encourage the "harassing" behaviour. combine that with a distance based ranged/melee or magic/melee switching script (i've written both) and you'd have a fun opponent to fight.

great work so far, btw. you have incredible patience - you should go into research or something.

cheers

h

Post Extras: Print Post

Leadfoot
(Adept)
10/04/02 12:59 AM
Re: fAIFleeFleeMult. How many more guars have to die? [re: Horatio] 

I really, really want to see more information on this. I wonder if the devs would have anything to say? Hmm, probably not, they wouldn't even come out of hiding for the animation issues.

So Sayeth Leadfoot, Professor of Thaumaturgy
Center of Thaumaturgical Studies
Solitude, Cyrodill

Post Extras: Print Post

wakim
(Layman)
10/04/02 02:36 AM
Re: Gratuitous Guar Guts [re: wakim] 

fAIFleeHealth, now this is a fun variable. First, a little background on individual creature AI Flee settings in Morrowind (and an opportunity for me to try this [ code ] command). Most critters in Morrowind, both NPCs and creatures, have an AI Flee rating falling between 50 and 20 (most creatures and virtually all NPCs (including slaves and vampires)), some critters have AI Flee ratings of 0 (some undead and all guards). I was only able to find one NPC or creature with a flee rating higher than 50 and that was M'aiq the Liar, his flee rating is 100. I presume that a flee rating of zero means that the creature should always fight to the death - never running, and a flee of 100 means the creature should never fight. The lack of AI Flee ratings between 51 to 99 is interesting. Also note that I looked at all the creatures, but not all the NPCs; I only sampled that list due to its size. Here is an opportunity for me to try out a table:



Creature Name AI Flee Rating Creature Name AI Flee Rating

Alit 30 Dremora 20
A. Ghost 0 Dremora Lord 20
Ascender Sleeper 20 Dreugh 25
Ash Ghoul 0 Golden Saint 20
Ash Slave 0 Guar 50
Ash Zombie 0 Feral Guar 50
Atronach, any 20 Pack Guar 20
Bonelord 0 Hunger 0
Greater Bonewalker 0 Kagouti 30
Lesser Bonewalker 0 Kawana Queen 0
Centurian Sphere 20 Kawana Queen, named 20
Centurian Spider 20 Kawana Workers 50
Centurian, Steam 0 Mud Crabs 30
Clannfear 30 Netch, Betty 30
Cliffracer 20 Netch, Bull 30
Corpus Stalker 20 Nix Hound 20
Lame Corpus 20 Ogrim 20
Daedroth 20 Ogrim Titan 20
Ash Vampires (Dagoth xxxx) 0 or 20 Rats 30
Scrib 0 Scamp 30
Shalk 30 Skeleton 20
Skeleton Archer 0 Skele. Champion 20
Skele. Warrior 20 Slaughterfish 0
Vivec 20 Winged Twilight 20

Summoned creatures use their parent creature's flee rating.



Wish I had known about that before, imagine if I could add colors too!

Anyway, from this I divine that the AI Flee setting from 20 to 50 is the meaningful range; the range where one should expect to see an observable difference in critter behavior. So much for the short treatise on AI Flee. Now onto the experimental evidence of fAIFleeHealthMult...

Post Extras: Print Post

GhanBuriGhan
(Disciple)
10/04/02 03:20 AM
Re: Gratuitous Guar Guts [re: wakim] 

Very cool info wakim! BTW you can use colors, just use brackets with the color name e.g. [ yellow ].

A side note: flee behavior seems also to be triggered by the target becoming "unavailable" e.g. NPCs flee when you are invisible (chameleon) and when you levitate and they cant follow you.




---//Forum Scholars guild\\---

Lecturer on Morrowind natural history
Get the "Modern Adventurer" Morrowinds #1 in-game journal

Post Extras: Print Post

wakim
(Layman)
10/04/02 03:43 AM
Re: A Guar has gone to a better place [re: wakim] 

The test conditions for fAIFleeHealthMult were the same as before: eleven guars named guar00, guar10, ... , guar100, set at AI Fight 70 and AI Flee # corresponding to their names. Since the previous fAIFleeFleeMult experiment showed that the default value of fAIFleeFleeMult of 0.3 prevented anything below AI Flee of 90 from running, I set the fAIFleeFleeMult to 1.5 (this should be closer to a meaningful value - see my previous attempt at a table) and varied fAIFleeHealthMult from 1.0 up to 56.0 in increments of 3.5 (default game value is 7.0). I then proceeded to kill guars in the name of scientific testing. Don't tell the people at the Gratuitous Guar web site about this. Here is the data, clipped above AI Flee 60 (guar60), since those always ran, and below AI Flee 10, since those always fought to death, at the fAIFleeFleeMult of 1.5 I had selected for a constant for this run.



fAIFleeHealthMult Guar50 Guar40 Guar30 Guar 20

1.0 F F F F
3.5 F F F F
(default) 7.0 F/H(15) F F F
10.5 F/H(45)/R(10) F F F
14.0 F/H(45)/R(20) F F F
17.5 F/H(65)/R(40) F F F
21.0 F/H(65)/R(50) F F F
24.5 skipped increment
28.0 F/H(75)/R(60) F/H(20)/R(05) F F
31.5 skipped increment
35.0 F/H(80)/R(60) F/H(40)/R(20) F F
38.5 skipped increment
42.0 F/H(80)/R(70) F/R(40) F/H(10)/R(05) F
45.5 skipped increment
49.0 F/H(80)/R(70) F/H(50)/R(40) F/H(15)/R(10) F
52.5 skipped increment
56.0 F/H(80)/R(70) F/R(50) F/H(30)/R(25) F/H(10)






fAIFleeHealthMult allows the current health of a critter to influence its decision to break off combat. From the fAIFleeFleeMult table, a few posts back, it appears that fAIFleeFleeMult sets the point where the individual AI Flee allows a critter to even consider running, then the fAIFleeHealthMult determines what health level a critter will run at. Now, the last question is what role does the Gameplay Setting of iFlee perform, and how does that influence critter AI and these two variables?

However, it seems safe to speculate that the settings for the two variables I have tested so far should actually be in the range of 1.1 to 1.9 for fAIFleeFleeMult and 36.0 to 69.0 for fAIFleeHealthMult in order to allow critters to demonstrate observable differences in combat behavior. iFlee remains to be tested yet, and more experimentation to nail down some better values in these estimated effective ranges is in order. Although, if anyone wants to play with a setting and conduct some trials just to see how the game feels with critters that flee occasionally, I would recommend trying out fAIFLeeFleeMult at 1.5 and fAIFleeHealthMult at 56.0. This would cause tame domestic animals (Guar) to run at 80 percent health and Daedra to fight till at ten percent health. Most NPCs would start running at 30 percent remaining health.

Post Extras: Print Post

wakim
(Layman)
10/04/02 03:45 AM
Re: Flee AI help [re: wakim] 

My last two paragraphs were oddly truncated in the previous post, here they are in entirety:

fAIFleeHealthMult allows the current health of a critter to influence its decision to break off combat. From the fAIFleeFleeMult table, a few posts back, it appears that fAIFleeFleeMult sets the point where the individual AI Flee allows a critter to even consider running, then the fAIFleeHealthMult determines what health level a critter will run at. Now, the last question is what role does the Gameplay Setting of iFlee perform, and how does that influence critter AI and these two variables?

However, it seems safe to speculate that the settings for the two variables I have tested so far should actually be in the range of 1.1 to 1.9 for fAIFleeFleeMult and 36.0 to 69.0 for fAIFleeHealthMult in order to allow critters to demonstrate observable differences in combat behavior. iFlee remains to be tested yet, and more experimentation to nail down some better values in these estimated effective ranges is in order. Although, if anyone wants to play with a setting and conduct some trials just to see how the game feels with critters that flee occasionally, I would recommend trying out fAIFLeeFleeMult at 1.5 and fAIFleeHealthMult at 56.0. This would cause tame domestic animals (Guar) to run at 80 percent health and Daedra to fight till at ten percent health. Most NPCs would start running at 30 percent remaining health.

Post Extras: Print Post

Pages in this thread: 1 | 2 | 3 | (show all)   Print Thread

Jump to

Contact Us The Elder Scrolls Homepage


UBBThreads™ 5.5.1
Click for Privacy Statement 2002 Bethesda Softworks LLC, a ZeniMax Media company. All Rights Reserved.
PRIVACY POLICY | TERMS & CONDITIONS | LEGAL INFORMATION