Jump to content

[S2G/CP1.6/EE2.1/SS,C] Brain Surgery needed, looking for surgeon


Recommended Posts

In 2.43 mage staffs were melee tools. If I would summon my doppelganger he would buff up and tell the mobs close and personal how the Christians did it. No mercy, no questions asked, no wasted time. Just a "Give me your sooooouuuuuul."

But times have changed. In S2G/CP1.6 Mage Staffs are shooting projectiles. When I summon the doppelganger I have to ask him if he is really here. Most of the time he walks around, or just stands there. Every 4 seconds he uses a single CA. Than he falls back into depression. Until the next 4 seconds passes and he remembers to use another CA.

I would like to help the doppelanger onto the bright side again, show him how beautiful life can be and tell him to change his mind to a ranged and/or melee AI behaviour. Does anybody know how to force the doppelganger to a certain AI and/or has a different solution for this ?

Help. Looking for brain surgeon.

Link to comment

This may not be related to magic staves, it could well be something introduced by CM 1.60.  I remember we found his behavior fraught with various bugs.  Does he behave correctly when you summon him with melee weapons?

I know Dmitriy did some work on the Doppelganger in his mod, but I didn't see anything about correcting his AI.

Link to comment
3 minutes ago, Flix said:

This may not be related to magic staves, it could well be something introduced by CM 1.60.  I remember we found his behavior fraught with various bugs.  Does he behave correctly when you summon him with melee weapons?

I know Dmitriy did some work on the Doppelganger in his mod, but I didn't see anything about correcting his AI.

Will check.

Link to comment

@Flix Some tests later.

So to bring this to a general level the AI has 3 reasons to attack.

1. The doppelganger gets attacked
2. The player gets attacked
3. The player attacks a specific mob

Scenario 1: Everybody stands peacefully around.
In this scenario the doppelganger wouldnt do anything because there is no reason to attack

Scenario 2: The player attacks mobs.
First, the specified attacked mob gets the highest priority ( 2 & 3 ). Then, since the player pulls more mobs, all mobs attacking the player are eligible to get attacked.

Scenario 3: The player attacks a boss who is disabled.
The doppelganger targets the boss because of 3.

 

Tests show that there seem to be 3 distinctive AIs.

A. Melee AI
B. Ranged AI
C. Caster AI ( Magic Staff required )

The Melee AI works the best, as it takes all 3 reasons into account when deciding to target mobs. It frequently uses CA and buffs if available.
The Ranged AI has condition 1 and 2 broken. If you dont attack a mob he will just stand there doing nothing.
The caster AI actually gets a 4th condition to attack:

4. Can cast spell

With this the Caster AI casts a spell, and makes a single attack afterwards. Condition 1,2 and 3 are broken for him and he will do nothing until condition 4 is fullfillable again.

 

I dont know how to fix this, or if it always have been like that, but I suggest forcing the AI behaviour of the doppelganger to be always on melee, if that works.

Edited by Charon117
Link to comment

I have to admit I only ever played the Doppelganger as a dual-wielding Inquisitor.  So he may have always been this way for all I know.

Most minion AI is straightforward, and based on spellClass.  For example any minion summoned under the Nether Allegiance spellClass which is "cSpellSkKohorte", would result in hirelings with the "Hireling_brave" AI as defined in behaviour.txt.  The place where the behavior type is linked to the spellClass is actually in the binaries (one of the dll files) so I don't have visibility to that offhand.

I don't know what behavior(s) the "cSpellInqDoppelgaenger" spellclass draws on, but it's likely to be one or more of the following:

newBehaviour = {
name         = "Hireling_coward",
state0       = "name=cCreatureIdleAI",
state1       = "name=cHirelingMoveAI,range=200.0,attitude=coward,mobility=14,fleefactor=1.5",
state2       = "name=cEnemySimple",
state3       = "name=cFleeAI",
defaultState = "cHirelingMoveAI",
}
mgr.createBehaviour(newBehaviour);

newBehaviour = {
name         = "Hireling_brave",
state0       = "name=cCreatureIdleAI",
state1       = "name=cHirelingMoveAI,range=200.0,attitude=brave,fightstate=cEnemySimpleExtended",
state2       = "name=cEnemySimpleExtended,distance=470.0,fearsibility=0,waitingtime=0.5,health_threshold=0,flee_probability=0",
state3       = "name=cSpecialMoveAI",
setState0    = "condition=onGroupMemberAttack,feasibility=1000,state=cEnemySimpleExtended",
defaultState = "cHirelingMoveAI",
}
mgr.createBehaviour(newBehaviour);

newBehaviour = {
name         = "Hireling_distance",
state0       = "name=cCreatureIdleAI",
state1       = "name=cHirelingMoveAI,range=200.0,attitude=brave,fightstate=cEnemyDistance",
state2       = "name=cEnemyDistance,range=470.0",
state3       = "name=cSpecialMoveAI",
setState0    = "condition=onGroupMemberAttack,feasibility=1000,state=cEnemyDistance",
defaultState = "cHirelingMoveAI",
}
mgr.createBehaviour(newBehaviour);

newBehaviour = {
name         = "Hireling_brave_ex",
state0       = "name=cCreatureIdleAI",
state1       = "name=cHirelingMoveAI,range=200.0,attitude=brave,fightstate=cEnemySimpleExtended",
state2       = "name=cEnemySimpleExtended,distance=470.0,fearsibility=0,waitingtime=0.5,health_threshold=0,flee_probability=0",
state3       = "name=cSpecialMoveAI",
setState0    = "condition=onGroupMemberAttack,feasibility=1000,state=cEnemySimpleExtended",
defaultState = "cHirelingMoveAI",
}
mgr.createBehaviour(newBehaviour);

newBehaviour = {
name         = "Hireling_mage_no_defense",
state0       = "name=cCreatureIdleAI",
state1       = "name=cHirelingMoveAI,range=200.0,attitude=brave,fightstate=cEnemyMagician",
state2       = "name=cEnemyMagician,defense=cEnemySimpleDefence,doDefense=0,forceidle=1",
state3       = "name=cEnemySimpleDefence,numattack=3,distance=400",
state4       = "name=cSpecialMoveAI",
setState0    = "condition=onGroupMemberAttack,feasibility=1000,state=cEnemyMagician",
defaultState = "cHirelingMoveAI",
}
mgr.createBehaviour(newBehaviour);

So just as an experiment (it should not be permanent) we could try to make all 5 behaviors be identical to "Hireling_brave_ex" which is reliable, steady weapon attacks punctuated with combat arts.  Bear in mind that the above is the version from my mod Diablo 2 Fallen where I've made "Hireling_brave" and "Hireling_brave_ex" identical.

The reason I'd not want to make any permanent changes to "hireling_distance" or "hireling_mage_no_defense" is that several quest NPC's and a few summoned creatures use those behaviors, and we'd actually want them to behave as such.

But by testing we could determine if the Inquisitor is actually using one or more of these undesirable behaviors which results in too much standing around.  @dimitrius154 would also probably know.

I say "we" but I really mean "you" as I'm not in a state to test CM Patch or EE right now. My system is currently set up for developing the next Diablo 2 Fallen release.  Once it's released in a week or so I will return to EE.

Link to comment

I can tell you that its the identical AI that also the Cobold Mage Elite uses.

Looking this up we get behaviour = "Enemy_mage",

So its most likely the Hireling_mage_no_defense one.

 

Now the proper solution for this would ofcourse,

1. be desynchronising mage staff from mage AI or
2. fix the actual AI
3. actually adding AI behaviour only concerning the doppelganger

I dont acutally think that making the mage AI attack more often would break any behaviour. Will do some tests.

5 hours ago, Flix said:

I say "we" but I really mean "you" as I'm not in a state to test CM Patch or EE right now. My system is currently set up for developing the next Diablo 2 Fallen release.  Once it's released in a week or so I will return to EE.

Good luck with the release !

Link to comment

 

Carrying a mage staff makes the doppelganger take the Hireling_distance AI.

I fiddled around with the AI for ranged weapons, but none of the Hireling_ AIs seem to apply to the doppelganger when he carries ranged weapons.

 

The results are obvioulsy an immense improvement, so I suggest to incorporate this into either CP or EE. Somebody can try to find the AI for ranged weapons until @dimitrius154can tell us exactly which one of them is being used. If he can.

Link to comment
1 hour ago, dimitrius154 said:

The Doppelgangers' mental problems are not related to the weaponry wielded, but to the fact, that the devs have broken Buff application routines. I believe the current Addendum alpha posted contains the fix.

Here I believe ?

I got more replies to come.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...
Please Sign In or Sign Up