Neverwinter Vault

Expand AllContract All -Site -My Profile -Features

Neverwinter Nights 2

-NWN2 Files -NWN2 Game Info -NWN2 Resources -NWN2 Community

Neverwinter Nights

-NWN Files -NWN Game Info -NWN Resources -NWN Community

Vault Network
RPG Vault
VN Boards
IGN Vault
Vault Wiki
· Age of Conan
· Anarchy Online
· Asheron's Call
· Dark Age of Camelot
· City of Heroes
· D&D
· EVE Online
· EverQuest
· EverQuest 2
· Final Fantasy
· Guild Wars
· Lineage 2
· Lord of the Rings Online
· Middle Earth
· Neverwinter Nights
· Pirates of the Burning Sea
· Rise of the Argonauts
· Star Wars Galaxies
· Tabula Rasa
· The Matrix Online
· The Witcher
· Titan Quest
· Two Worlds
· Vanguard
· Warhammer
· World of Warcraft

Planet Network
Planet Hub

IGN
Games
Cheats
Entertainment

The Web   The Site  



NWN SCRIPTS

- Jump to comments -
Title  Update v0.4 beta for Jasperre's AI v1.3
Author  BePower
Submitted / Updated  11-20-2009 / 11-26-2009
Category  Creature AI
Expansions  HOTU-1.69
Format  Code Only
Type  Type - Combat
Includes  Custom
Description
This is my attempt to eliminate the TMI problem Jasperre's AI had. I've optimized the code and tested up to the limits of my graphics card & cpu and saw absolutely no "too many instructions error".

I really appreciate feedback on any problem as it'll be used to improve the AI. As a quick comparison before/after:
Before:
j_ai_detercombat 70807 msec 5993 calls (average 11,81 msec per call)
After:
j_ai_detercombat 13960 msec 2784 calls (average 5,01 msec per call)

A quick way to test is downloading the mod tub, open it's hakpak and put in the ncs provided.
Original Jasperre's AI can be found at Link

I'm only providing the j_ai_detercombat.ncs and relevant uncompiled script files if anyone wants to check what was done, so the original AI is still needed for building modules.

v0.4 will probably be the last one for quite a while. I have not only optimized but corrected errors and improved it as much as it could be done without a complete overhaul. There are a few things in other files, like the OnPerception and OnSpawn that could be changed but I'm not touching that for now.
I just tested it in 2 really big battles, all npcs level 40 unless standard from the toolset. First was 25 dwarven defenders under Jasperre versus 25 dwarven defenders under bioware's. Sometimes 1 wins, sometimes another. Average execution time of j_ai_detercombat was 5,28 msec.
Second battle I really pushed it. On 1 side there was 30 Exalted sorceresses under Jasperre's plus their familiars (these under bioware's). On the other side 30 Liches (CR28 from toolset), plus whatever they summoned, under bioware's. There was a tremendous lag. Average execution time of j_ai_detercombat was 6,68 msec. TMI free in both cases.
ENJOY!

============================***========================


v0.4 in 26, Nov, 2009
Fixes:
Targetting issue that provoked random walking after killing a target,
even with more targets present, if OnSpawn target type was set
Nearest heard enemy calls corrected
Instead of comparing just discipline, added AC to feats that require
both a hit and a discipline check. My mistake, J only compared to
AC and I had changed to only discipline, now it's both.
Enemies with greater sanctuary needed many more checks, hopefully all
done now
Creature that vanished is treated correctly
Added has spell or item check to all calls to AI_GetBestAreaSpellTarget,
a few were missing, specially those I had removed...
Polymorphed forms abilities
Shifting choice decision (polymorph/shape choice) incongruencies left
Polymorphed creatures previous change only stopped major spells like heal &
mass heal, now should be stopping all of them but potions and feats

Improvements:
Even more accurate decision tree on feats
Added HiPS use to Kobold Assassin shifter form
Default targetting to most damaged in %
Added timer on target for bigby spells, AI should avoid casting multiple
bigby spells on the same target at the same time
Polymorphed forms' abilities' decision much smarter

OBS: since now creatures that vanish from sight/hearing are treated correctly
(I think) the special code for buffing when an ethereal (greater sanc) enemy
is present will probably not fire as the default for invis/stealth creatures
will take over


v0.3 update, 24, Nov, 2009
Fixes:
Shifter shifting
wrong spell call (mindblank instead of mindfog)
spells: some area/single target corrections
Horrid_Wilting friendly fire
Checking spell capabilities & items
(both were not working, seems you can't set it onspawn)
spell ball of lightning was being cast without a target
AI was not casting some spells for unknown reason, if we are sorceror or wizard
it gets a global check before casting cantrips

Improvements:
Shifting choice decision
Greater sanc use
Greater sanc check when casting
if enemy is using greater sanc and we can see or hear then we buff
Black blade of disaster check (changed AI_SetUpUsEffects so it exits at dazed level)
Buffs, if we are invis, comes before any hostile action
(should lighten the invis/offense/invis/offense/invis/offense behaviour)
Added check on healing to stop polymorph casting, adaptation of Jasperre v1.4beta3
Added true check for items that cast spells, potions don't count
Added GlobalAttemptAll (spells) for a chance of not going into AttemptAllSpells
Pure melee classes without items that casts spells will benefit immensely
Added Timer in AttemptAllSpells if we hit bottom and cast nothing it'll check again
only in 2 rounds
Melee targetting: lowered random chance to change targets so they actually finish off
the enemy instead of fooling around with them (unless set OnSpawn)


Update of 22,Nov,2009:
Fixes:
turning undead on ally's summoned undead
ultravision/darkness issue
Blackguard's, Palemaster's & ShadowDancer's summonning
Red Dragon Disciple's breath
All summons set summoned_level

Improvements:
Arcane Archer feat use
(improved)Whirlwind vs (improved)Knockdown use
Feats that require a Discipline check now actually take Discipline into account (was AC)

Files

NameTypeSizeDownloads
j_aiUpdate.7zj_aiUpdate.7z
Submitted: 11-20-2009 / Last Updated: 11-26-2009
7z203.11Kb316
j_ai_detercombat.ncs & .nss, + j_inc_generic_ai.nss
Updated 26, Nov, 2009
SCORE OUT OF 10
10
2 votes
View Stats
Cast Your Vote!

PORTFOLIO
Add this entry to your portfolio so you can track it
Manage your existing portfolios or create a new one.
SCREENS
No Images




You Must Be Logged In to Participate.
Comments (9):

Posted by loinne at 2010-08-14 10:41:00    Voted 10.00 on 08/14/10
Thanks

Posted by JustAnotherEDiot at 2010-04-17 14:34:01    
How do you put this into your module?

Posted by BePower at 2009-11-30 14:03:13    Voted 10.00 on 11/26/09
J, I'm glad that you're really set on rewriting the entire thing or nothing at all... specially because of my "butchering" (I could try to think of a lighter word, but it is what it is) of the code.
Basically the 2 things that stop tmis are the data sharing code (search for iExtSetup) and the re-use of targets gotten through AI_GetBestAreaSpellTarget. This last one I think was the major influence on tmis but since your logic in acquiring targets was so spot on I didn't want to change how it was done, just how often.
And thanks for the kind words in your site, even though my update is minor compared to your work in this. Thanks for the great AI.

Posted by Jasperre at 2009-11-30 10:30:24    
I'm going to have to check this out when I reinstall Neverwinter Nights! (been off my PC for a fair few months!), see how well you've updated my code!

I must admit my latest bug-fix release basically made me swear to rewrite it (which I partially did but the lack of good NWN2 scripting support - ie; it was mainly broken support - made me go off it). The 1.4 beta 3 version worked (and fixed, I think, the TMI crash you mention?) but frankly I wasn't going to release it as anything other then a beta. Totally unsatisfied with the code!

I've linked to this from my AArmstrong.org hosting page just to let people know.
_________________________
Jasperre

Scripter. AI builder. Not Jassper.

Posted by BePower at 2009-11-27 12:40:37    Voted 10.00 on 11/26/09
Hmm, strange. I don't know why mine is different but instead of the var you guys said the original has AI_TIMER_EFFECT_SET there. So you have 2 options: in the j_inc_generic_ai change AI_DEFAULT_AI_COOLDOWN_EFFECT_SET to AI_TIMER_EFFECT_SET; or in the j_inc_constants do the opposite. Both are the same string.

Posted by foy at 2009-11-27 07:32:36    
I'm having the same issue as pnfyr. The constant does not seem to exist and j_ai_detercombat won't compile because of it. I'm assuming you added it to j_inc_constants but didn't include it in your submission.

Posted by BePower at 2009-11-26 10:32:45    Voted 10.00 on 11/26/09
Both are welcome. Enjoy it!

@Ponfyr: I don't recall having such issues, then again I saw so many things that if I recalled that I'd be amazed at myself :)

Posted by ponfyr at 2009-11-25 18:22:02    
Thanks a million for putting this together,

I was compiling j_ai_detercombat.nss and the toolset complained about j_inc_generic_ai having an undefined variable in lines 13330, with the variable AI_DEFAULT_AI_COOLDOWN_EFFECT_SET

I did find the constant AI_DEFAULT_AI_COOLDOWN but no *_EFFECT_SET defined.

Posted by Grymlorde at 2009-11-20 15:56:32    
Very glad to see this! I'll download and try it out.

You must be Logged In to post comments in this section.

 
Most recent posts on the MMO General Boards
Analyst: Star Wars: The Old Republic Could...Analyst: Star Wars: The Old Republic Could Sell 3M: more numbers
- last reply by Acao on Aug 15, 2011 06:15 PM
which class will your first character be
- last reply by Blisteringballs on Aug 15, 2011 05:50 PM
New Community Content!
- posted by Vault_News on Aug 15, 2011 05:00 PM
New Community Content!
- posted by Vault_News on Aug 15, 2011 04:00 PM
NWN Idea Database Update
- posted by Vault_News on Aug 15, 2011 03:46 PM
Missing Votes for NWN2 Hall of Fame
- posted by Vault_News on Aug 15, 2011 03:40 PM
Missing Votes for NWN Hall of Fame
- posted by Vault_News on Aug 15, 2011 03:39 PM
Random Questions and game altering suggest...Random Questions and game altering suggestions!!!
- last reply by ArkadyTepes on Aug 15, 2011 03:22 PM
State of the game?
- last reply by LyricOpera on Aug 15, 2011 01:37 PM
Yesterday streaming, now demanding downloa...Yesterday streaming, now demanding download :(
- last reply by Sinane-tk on Aug 15, 2011 10:23 AM
 

   


IGN Entertainment
By continuing past this page, and by your continued use of this site, you agree to be bound by and abide by the User Agreement.
Copyright 1996-2011, IGN Entertainment, Inc. | Support | Privacy Policy | User Agreement | RSS Feeds
IGN’s enterprise databases running Oracle, SQL and MySQL are professionally monitored and managed by Pythian Remote DBA.


NWN2 Hall of Fame

HOF NWN2 Gameworlds


View all Hall of Fame entries


Neverwinter Nights 2

TOP NWN2 Modules

NEW Modules

NEW Reviews

NEW INTL. Modules

TOP Hakpaks

TOP Gameworlds

TOP Tutorials

TOP Prefab:Areas

TOP Blueprints

TOP Plugins

TOP UI

TOP Other

TOP Visual Effects

TOP Scripts

TOP Tools

TOP Movies

TOP Models

TOP Characters





Hall of Fame

HOF NWN Modules


View all Hall of Fame entries


TOP NWN Modules

NEW NWN Modules

NEW Reviews

TOP Intl. Modules

TOP NWN Hakpaks

TOP NWN Gameworlds

TOP NWN Models

TOP NWN Portraits

TOP NWN Scripts

TOP NWN Prefabs

TOP NWN Other

TOP NWN Movies

TOP Sounds

TOP NWN Textures

TOP NWN Creatures

TOP NWN Characters