Author Topic: Community Patch discussion and development thread  (Read 20379 times)

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Community Patch discussion and development thread
« Reply #345 on: June 20, 2014, 10:13:20 pm »


               


That actually reminds me of an oddity I ran across in the same chapter.  I triggered a rather powerful trap that zapped Linu the elf cleric dead.  I went back to the temple, and she was there and responsive, however she was stil "dead", laying on the floor, tab-highlighting showed her as dead, even though she had full HP.  I took her back to the area where she died, and zapped her myself until she was *actually* dead, and then used a scroll of raise dead on her (She didn't zap back to the temple, she was laid out on the ground as "dead", really dead this time).  When she came back to life, she was still hostile though and stayed as such even after I ported back to the temple and rested, and then let myself get zapped in another area to die myself.  I finally said hell with it and killed her again... that last time her body disappeared as if she were any other non-henchman NPC killed.




 


Yeah the OC has a lot of oddities with henchmen. On my first trip through the campaign I was using Tomi, who, as he is supposed to, kept going and taking care of traps for me. At one point he encountered a trap that was too difficult even for him to disarm and he got killed by it. When I returned to the temple to get him back he refused to talk to me or interact at all - acting as if I was an enemy. However, he was NOT hostile. I eventually gave up and opted for Grimnaw instead. 


 


At certain points, and under the right circumstances, it seems that when a henchman dies they sometimes blame the PC for it and refuse to work for them again. I don't exactly consider this a glitch so much as a neat side-effect. After all, who wants to work for a master that keeps getting them killed.



               
               

               
            

Legacy_MannyJabrielle

  • Sr. Member
  • ****
  • Posts: 275
  • Karma: +0/-0
Community Patch discussion and development thread
« Reply #346 on: June 20, 2014, 10:47:52 pm »


               

Masochist henchmen?



               
               

               
            

Legacy_Bogdanov89

  • Full Member
  • ***
  • Posts: 155
  • Karma: +0/-0
Community Patch discussion and development thread
« Reply #347 on: June 21, 2014, 09:11:21 am »


               

I made a few brand new save games in which the hencmen healing and/or aggression is bugged.


All the 9 saves i made are heavy 186 MBytes, but i used WinRar (free) to compress it down to around 10 (ten) Megabytes - so you will need to uncompress (unzip?) them first '<img'>


I uploaded the same zip on various different websites, hopefully one of these will be fast and reliable for download:


 


https://www.sendspace.com/file/bkn92d


http://wikisend.com/...load/302312/bug complilation.rar


http://www.filedropp...bugcomplilation


http://sharesend.com/7idv1ink


http://www.megafileu...lation-rar.html


http://speedy.sh/94E...omplilation.rar


 


 


Overall description:


 


I made a brand new barbarian/cleric (singleplayer, original campaign, fresh beginning of chapter 2).


 


immediately as my character first spawned, i used the console cheats to enable debug mode and "givegold / givelevel 8" to my character, so she can properly fight in chapter 2.


As soon as i gave my char the gold/levels i disabled the debug mode through console command.


 


After finishing cheat-leveling (lvl9 character) i talked to aribeth and to that black spy-man and then picked the cleric henchmen for my party.


Through talking with my cleric henchmen i set her to "Heal me if i am under 75% health" and "Stay close to me"... i also talked all there was with her about her personal quest/life.


Went out of the building, gathered all quests i know of in the village and went to the "north road" to find that guy's wife that was kidnapped.


 


Through ~90 minutes of playing, my cleric automatically (on her own) cast healing spells on me about 4 times in total.


My character rested at least once every ~4-5 minutes due to the buffs expiring, so my henchmen always had healing spells ready.


I was seriously wounded many times and was near death a couple of times, during which my companion tossed no heals (or maybe just one just once).


 


Most of my saves are labeled clearly, but just to mention:


 


- saves called "test1" is my first save before any combat was done.


 


- saves called "not healing" mean that my henchmen definitely had her healing spells ready, but she did not automatically use them on me - either during combat or when getting hurt by a trap. I had to order her "heal me" through the right click radial menu to get her to heal me, and even then she sometimes used very weak heals. Sometimes i specify in the save's name that it was only a trap that damadged me (took me below 75% hp or even to near death) but my hench did not heal me.


 


- saves called "suddenly heals" are when a companion suddenly decided to do some automatic healing on me (i was wounded)... she casted one or two healing spells on me (without me manually asking for it) during combat (or slightly after it), but after that she seems to resume to her "no healing" behavior.


 


- saves named "passive" are when my companion was not defending/attacking at all, even while i and her were being attacked.


 


- the save called "passive near death" is especially important (i think), since my companion did not fight and she did not automatically heal me... she just stood there (close to me) and i had to drink a potion to not die.


 


 


I tried to give as little (almost none) orders to the companion, so that her automatic AI does all the thinking.


I think i manually told her "heal me" twice during ~1.5 hours of play, and i do not think i ever manually told her "attack nearest" during that play time.


 


If you need more saves or anything else, please do let me know '<img'>


Thank you very much for trying to improve the AI!



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Community Patch discussion and development thread
« Reply #348 on: June 21, 2014, 11:50:11 am »


               

Okay, first impression on the healing issue. This looks as a behavior decision - not to heal outside of combat. Neither TonyK AI allows this Ive checked (though TonyK AI will start healing when you tackle your henchman - vanilla AI will heal only self in such case).


 


I will see what can I do, but there might be reason why this is not done. Outside of combat you might decide to rest instead or use potion/healers kit, to preserve henchman's spell uses. And if you want to being healed by henchman you can use the radial command.


 


As for gettint hurt by a trap, this is problematic because this wont trigger a "combat", neither any script. The solution is to allow healing outside combat or to change trap scripts to run the creature OnSpellCastAt event which I want to avoid for now (might have unpredictable consequences).



               
               

               
            

Legacy_Bogdanov89

  • Full Member
  • ***
  • Posts: 155
  • Karma: +0/-0
Community Patch discussion and development thread
« Reply #349 on: June 21, 2014, 12:15:14 pm »


               


Okay, first impression on the healing issue. This looks as a behavior decision - not to heal outside of combat. Neither TonyK AI allows this Ive checked (though TonyK AI will start healing when you tackle your henchman - vanilla AI will heal only self in such case).


 


I will see what can I do, but there might be reason why this is not done. Outside of combat you might decide to rest instead or use potion/healers kit, to preserve henchman's spell uses. And if you want to being healed by henchman you can use the radial command.


 


As for gettint hurt by a trap, this is problematic because this wont trigger a "combat", neither any script. The solution is to allow healing outside combat or to change trap scripts to run the creature OnSpellCastAt event which I want to avoid for now (might have unpredictable consequences).




 


Thank you for reading all that '<img'>


 


I do agree that traps do not have to trigger a heal from a henchmen if out of combat, but i do have to repeat the fact that over 90 minutes of gameplay my henchmen healed me (automatically) only 3 or 4 times... while i was heavily wounded during combat many many times.


 


So i just gotta point out that henchmen automatic (AI) healing is very unreliable even during combat, and by that i mean that in over 90% of cases where my companion should have healed me - she did not, and i had to manually order her to do the healing.


 


Personally, i would love if the companion/henchmen AI was changed to constantly be in a highly aggressive mode (attack any nearby hostiles on it's own) and that it furiously casted healing spells whenever it's master dropped below a specified % of health.


 


I think an aggressive + fast-to-cast/heal companion/henchmen AI is much much much better and more reliable than a passive, idle, no casting/no healing/no fighting companion AI.


 


Edit: I have prepared 2 more saves for you.


One is i think a good example of the AI henchmen refusing to fight, even when i tell her to guard me during combat.


The other is yet another example of my (fully rested) cleric absolutely refusing to heal me or herself during combat/fighting.


 


http://wikisend.com/...load/988570/New 2 examples of bugs.rar


 


I gotta mention one thing i noticed: sometimes my cleric will start casting a spell (maybe healing) but then she will start running thowards enemies, thus interrupting her own spell.


I don't think she at all attempts to recast that spell once she gets to her enemies, so that specific situation might be a big problem in the AI.


 


Perhaps the AI gets screwed up when i load/reload a game, or when i zone in/out from certain areas or under certain conditions.



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Community Patch discussion and development thread
« Reply #350 on: June 21, 2014, 03:29:21 pm »


               

I find one bug in the code that fixed the issue for me. I prepared an updated version of the 1.71 addon with additional features:


 


download on project page


 


new content:


 


- Find Traps spell on hardcore difficulty will now reveal trap position for everyone in party including all associates and even players in different area

- fixed the switch for controlling old henchman inventory which wasn't included in first release

- new henchman AI improvements:

-- improved henchman AI performancy

-- fixed henchman healing in certain situations where it was broken before

-- improved henchman command for dealing with traps - previously if the nearest trap from master was too far it failed, now in such case henchman will try to deal with traps related to his position

-- henchman will be now able to handle trap that only his master can see

-- when told to deal with trap from radial command, the henchman conversation option to not help with traps will be ignored now


 


NWNX_Patch and NWNCX_Patch updated:

- softcoded the Devastating Critical ability - builder is now able to edit and modify this ability entirely within NWScript, the new script name is "70_s2_devattk".

- fixed bug when Improved Sneak Attack didn't work for assassin's without at least 1d6 rogue or BG sneak attack.

- fixed bug in Deflect Arrow ability that determined the defender's weapon relative to the attacker creature size (thus when there was kobold shooting, if defender had a scimitar in hand this ability didnt worked before etc.)


 


 


 


few notes:


I havent changed the trap behavior because I think it is intented. If its in combat it should work, if its outside of combat (no enemies in sight) you should use radial menu if you wish to be healed by henchman. Because there might be a situation when there is a unlimited ground trap which you will cross and trigger and gets you almost killed - if the henchman automatically run to you in attempt to heal you he will trigger it again and you are both dead '<img'> .


 


I havent yet debugged the passive issue. When I loaded your saves there was no creatures in sight and when I went further in area Linu normally reacted. Havent noticed you two new saves, will try these then.


 


As for your bug with interrupting spellcasting. I really need some savegame where this happens soon after I load game. Currently all your savegames was "after-combat" and thats wont help me spot this exact issue.


 


And as for the disappear/hostile bugs in OC. I dont think I will be able to fix these as they might be controlled within the OC module which I have no intent to modify atm.


 


EDIT: your new saves are perfect, working on this



               
               

               


                     Modifié par Shadooow, 21 juin 2014 - 02:38 .
                     
                  


            

Legacy_Bogdanov89

  • Full Member
  • ***
  • Posts: 155
  • Karma: +0/-0
Community Patch discussion and development thread
« Reply #351 on: June 21, 2014, 05:01:24 pm »


               

Thanks for the super fast updates '<img'>


It will be absolutely awesome if the AI passive bug was fixable as well!


 


I am sorry the first saves were not all that helpful, i thought they needed to be "after combat" so that you can read an AI log or something similar.


 


Next time i record i will make sure to do it during the battle and just as the last monster dies.



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Community Patch discussion and development thread
« Reply #352 on: June 21, 2014, 07:00:03 pm »


               


Thanks for the super fast updates '<img'>


It will be absolutely awesome if the AI passive bug was fixable as well!


 


I am sorry the first saves were not all that helpful, i thought they needed to be "after combat" so that you can read an AI log or something similar.


 


Next time i record i will make sure to do it during the battle and just as the last monster dies.




Ive already looked into it and it wont be so easy. In last save, the character has a "im in combat" flag, that is normally present only during an attack or casting a spell. I dont know how this happened, it definitely shouldnt happen, might be related to saving/loading game or radial commands. Will take some time to find out.


 


Now I am working on further henchman healing AI improvements. Features I plan:


- to choose healing spell based the master lost hitpoints thus not wasting powerful heal spells when not needed


- to use defensive casting when surrounded or when he henchman has granted success based on his concentration skill


- to use harm spells if the master is undead (rare case but I suspect that if that happens, AI will use normal heals)


- possibly heal other henchman too


 


Oh please and after you run with the new AI please tell me your thoughts and results with it.


               
               

               
            

Legacy_MannyJabrielle

  • Sr. Member
  • ****
  • Posts: 275
  • Karma: +0/-0
Community Patch discussion and development thread
« Reply #353 on: June 21, 2014, 07:00:38 pm »


               

For the healing out of combat thing, perhaps this could be added as a switch if possible?  Some modules have limited resting (either only in specific areas, or time-restricted resting) so in those instances it would be better for the henchman to heal outside of combat only when directly ordered to.



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Community Patch discussion and development thread
« Reply #354 on: June 21, 2014, 07:07:48 pm »


               


For the healing out of combat thing, perhaps this could be added as a switch if possible?  Some modules have limited resting (either only in specific areas, or time-restricted resting) so in those instances it would be better for the henchman to heal outside of combat only when directly ordered to.




I think this is not needed. With the bug I fixed the healing should be more reliable now so the situation that you end up combat with low hp and your henchman will do nothing shouldnt happen at all.


 


The problem was in fact that when there was no enemy, the calculating the distance from an enemy failed and thus AI thought its too close to enemy to cast a healing spells. I fixed this so even if you kill last enemy and specially in that case, henchman should immediately heal you as long as he got spells or he heals you over the limit you told him.


 


So healing out of combat shouldnt be needed at all. Try the new AI and we will see.


 


BTW, there was one setting which I found out is not used at all. There was a switch probably intented to be changed in conversation to (dis)allow henchman to cast healing spells if he is in close combat. But the default value was disallow and this switch wasnt added into game at all. So whenever the henchman was in close combat he never healed master. I changed this behavior and now this depends on the combat casting feat. If the henchman has it he will be able to heal in close combat.



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Community Patch discussion and development thread
« Reply #355 on: June 24, 2014, 07:11:24 pm »


               

Some new goodies I made in last days:


 


- softcoded healer's kit


- fixed the healer's kit instant heal bug


- fixed holy avenger enhancement bonus issue


- allowed to place counterspell into quick slots


 


Now I have a question: Would anyone mind if I would changed the scripting in default AI scripts to be more efficient? I previously haven't considered this for a readability/comparable reasons, however since the AI scripts are called so often, the gain in efficiency could be significant enough to prevail these drawbacks.


 


And for now I would stick with small changes such as rewriting lines like "bSomething == FALSE" into "!bSomething", "bSomething == TRUE" to "bSomething".


 


Anyone against?



               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Community Patch discussion and development thread
« Reply #356 on: June 24, 2014, 07:33:04 pm »


               

that sounds great, Shadooow.


 


one question about those examples you give. That tends to be my practice, but I didn't realize it was more efficient to do that. I imagine the gains for such changes would be small, but I could be wrong.


 


One thought I had about these changes you are making… its almost like we need some kind of version control for your project so that we can track changes and more easily incorporate them into our own code. Are you at all interested in doing that? I'm an ignorant newb with setting such things up, but if you set it up for your project I would learn how to use it. Might even contribute if you are interested.



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Community Patch discussion and development thread
« Reply #357 on: June 24, 2014, 07:47:25 pm »


               


that sounds great, Shadooow.


 


one question about those examples you give. That tends to be my practice, but I didn't realize it was more efficient to do that. I imagine the gains for such changes would be small, but I could be wrong.




yes small and unnoticeable but there is like 200 such conditionals almost every AI pass which is in combat very very often, especially on higher levels where both player and creature has more than 4 attacks per round. Multiply this by time that each creature stands alive in combat and a number of creatures that dies in your module until you reset it or it crashes and this small unnoticeable gain might become noticeable.



 


One thought I had about these changes you are making… its almost like we need some kind of version control for your project so that we can track changes and more easily incorporate them into our own code. Are you at all interested in doing that? I'm an ignorant newb with setting such things up, but if you set it up for your project I would learn how to use it. Might even contribute if you are interested.



I dont have a good experiences with such tools. I have used svn once as a user but this github thing... Tried to use that for my nwnx_patch source but its needlessly hard to set it up and given how many peoples (few) are interested in this it seems to me like waste of time. As for incorporating latest news. Most of it is done within the nwnx_patch and nwncx_patch automatically, no setting there. There is only few script fixes now and most of them is included only because they needed to be recompiled. Actual change is done only in three scripts and its quite easy to compare the new files with the scripts in 1.71 builders resources.



               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Community Patch discussion and development thread
« Reply #358 on: June 24, 2014, 08:19:29 pm »


               

no problem on the version control thing. i like it when its set up for me, but since I can't set it up I'm not going to be the one to insist you do it. I still need to set it up for myself….


 


For a project like yours though I can see the advantages for putting the code on GIT and making it collaborative. Until you have several people eager to help however… I agree that it is not worth your time.



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Community Patch discussion and development thread
« Reply #359 on: June 26, 2014, 02:33:24 am »


               

So... I learned henchmans to resurrect their master. The question is whether is this good idea to do as it might make game too easy especially in HotU where the rod of resurrection is first item you get....