You are here

Effect List Overflow

24 posts / 0 new
Last post
GCoyote
Effect List Overflow

I've run into this problem a couple of times. Effects on a party member, usually the PC, fail to clear/expire until no more can be applied. I've seen this happen in a couple of modules now.

  • Any idea what causes this?
  • Can all effects be cleared from the console?

<b>"Please VOTE on the content you play."</b>

  • up
    50%
  • down
    50%
kevL's

that's interesting, never run into it -- I'm curious about how many ?

there's not a standard console command for it, but a script is fairly straightforward:

// cleartargeteffects
void main()
{
    object oTarget = GetPlayerCurrentTarget(OBJECT_SELF);
    if (GetIsObjectValid(oTarget) && GetObjectType(oTarget) == OBJECT_TYPE_CREATURE)
    {
        int i;
        effect e = GetFirstEffect(oTarget);
        while (GetIsEffectValid(e))
        {
            ++i;
            RemoveEffect(oTarget, e);
            e = GetFirstEffect(oTarget); // sic
        }
        SendMessageToPC(OBJECT_SELF, "cleared effects : " + IntToString(i));
    }
    else SendMessageToPC(OBJECT_SELF, "target a creature");
}



It's conceivable that effects weren't removed before similar ones were (re)applied ... or more likely someone slipped up on a loop somewhere

 

- compile it in /Override, then run from the console in debugmode (right-click target)

rs cleartargeteffects

  • up
    100%
  • down
    0%
GCoyote

Thanks kev. It's come up in projects from two different builders in works published years appart. I can see your point about a script being reapplied multiple times as I first noted the problem in a big end of game battle with dozens of combattants and a lot of custom scripts running. I figure it just overloads the game engine at some point. If I still have a save from the last game I'll run this to verify.

  • up
    50%
  • down
    50%
GCoyote

https://neverwintervault.org/screenshots/action-list-overflow-bug

Action List Overflow Didn't work.  sad (Either I didn't make a note of the actual problem last time or this is a different issue.)

But I got a screenshot this time so it's definitely "action list" now.

I'm playing v2 of Umbral Abyss, currently in the Dale area but it may have begun earlier.  When I go into debug mode to check the location of a trigger I see this in the dialog box:

  • Action List Overflow: (243 > 75) OID: 80001e22
  • Action List Overflow: (255 > 75) OID: 80001df3
  • Action List Overflow: (257 > 75) OID: 80001df8

It got up to (311 > 75) when I stopped the game to do more detective work so it looks like more effects are being added, but not executing in-game.

Edit: so after a few hours of sleep and half a cup of coffee it hits me that I could possibly replace effect in the above script with action, recompile and try again? 

More coffee first. angry

  • up
    50%
  • down
    50%
kevL's

I'm not familiar with "Action List Overflow" - maybe an Nwn1 coder can shed some light ....


But if "action" is an IG action, like walk or attack or cast spell, that goes on the action-queue, then it sounds like a script is trying to assign an action to a Mob over and over. a creature's action-queue can contain only so many actions


actions are completely different than effects (so rewriting the script above won't work.)

  • up
    50%
  • down
    50%
kevL's

// clearareaactions
void main()
{
    object oDebug = GetFirstPC(FALSE);
    SendMessageToPC(oDebug, "\nRun ( clearareaactions ) " + GetName(OBJECT_SELF) + " ( " + GetTag(OBJECT_SELF) + " )");

    object o = GetFirstObjectInArea();
    while (GetIsObjectValid(o))
    {
        if (GetObjectType(o) == OBJECT_TYPE_CREATURE)
        {
            SendMessageToPC(oDebug, ". clear actions on " + GetName(o) + " ( " + GetTag(o) + " )");
            AssignCommand(o, ClearAllActions(TRUE));
        }

        o = GetNextObjectInArea();
    }
}


this should affect all creatures in the area that your PC is in, when run from the console. Am thinking that it might reset the Action List Overflow incrementor. That'd give a clue ...

  • up
    100%
  • down
    0%
GCoyote

Thanks kev, I hope to give this a try tonight. 

In looking at the screenshot again, I'm seeing tags on those last few overflow messages that don't seem to pertain to the party. So now your point about clearing actions on all creatures is starting to make sense.  

  • up
    50%
  • down
    50%
kevL's

updated the script w/ some debug... it's good to know if/when the script is actually doing its job...

  • up
    100%
  • down
    0%
GCoyote

Nope, "Virtual Machine reports unsuccessful execution of script clearareaactions for object Kern Dunadan" (the PC)

Just to be thorough I also tried it with a companion selected and with and without an NPC targeted.

Q: If this problem persists in a saved game, doesn't that mean it's stored on the PC's data file in the save directory? Maybe I can get more info using TalkEdit2?

  • up
    50%
  • down
    50%
kevL's

the script ran fine fer me, dutifully cleared actions on ~10 npcs. there's nothing special about it, *


...i doubt the issue persists. It looks like a runtime error (actions don't get saved, afaik) and it likely has nada to do with the PC, only NPCs. I'm guessing - totally guessing - that there's a script(s) that assign actions to NPCs, and does so with a loop that isn't incrementing/exiting properly ...

If you really want to get your fingernails dirty, try enabling LogRunScript. Then look through any suspicious scripts that show up in the logfile, after your PC has entered the suspect area

 

* i'm guessing you got a typo in the scriptname (or forgot to compile..)

  • up
    50%
  • down
    50%
GCoyote

Well it is staying with the PC from area to area. I'll try the log and see what else I can find.

  • up
    50%
  • down
    50%
kevL's

that's probly maybe because the AI tends to run only on areas that the PC is currently in -- remember I don't have a testcase atm, am just throwing spaghetti at a wall.

  • up
    50%
  • down
    50%
GCoyote

It compiled first try, I copied the ncs file to override, I've checked the spelling (because I know I need new glasses). I've already spotted two other instances where the party hit a trigger, a message displayed, and an associated item or placeable failed to spawn. So it looks like something broke at an earlier point in the game that is affecting multiple scripts? 

I see what you mean about the log file. Less than ten minutes of game time generated dozens of pages of output. In the image I linked to, some of the overflow messages include an object tag. I can't find a matching blueprint for one of those objects. The caveat to this is my toolset stopped twice with error messages while opening the module for examination. 

I sent a message to Kevin (MERP UK) to see if he can shed any light on this. 

If nothing else, I'm learning more about what goes on under the hood so thanks for that. yes

Edit: specifically I'm playing Umbral Abyss 2.0, currently in the Dale module.

  • up
    50%
  • down
    50%
kevL's

note on adding files (scripts) to /Override, the game needs to be reloaded from desktop.


If it's convenient for you to upload & link me to a save, where I can just load into the module/campaign, turn on debugmode, and start getting error messages ... i'd likely give it a shot myself out of curiosity.

regardless, it sounds like the engine is handling things okay so it's not a pressing issue, eh

 

 

  • I'm learning more about what goes on under the hood so thanks for that.

it's quite fun ain't it  :^_~

  • up
    100%
  • down
    0%
GCoyote

It's different and it's a chance to create new content and help keep the game alive.

Had to recapture my old Dropbox account, here is the link to the save I've been using to study the problem: https://www.dropbox.com/s/tawxm5rm3j19izv/000037%20-%20Action%20List%20O...

As I was doing this it dawned on me that by the time I started noticing game bugs, the action list problem could have been going on for some time. So tonight I may try to work backwards through my saves to see if I can find the earlies occurrance of the problem.

  • up
    50%
  • down
    50%
kevL's

got it.

module loaded. error confirmed. investigating ...

  • up
    50%
  • down
    50%
kevL's

okay it's happening in area "Dale" tag: u4a2_dale2

the creatures affected:
tag: Figg
tag: DaleC

"DaleC" looks like it stands for dale-commoner (male and female)
"Figg" appears to be unique.


this script stops the error

// clearareaactions
void main()
{
    object oDebug = GetFirstPC(FALSE);
    SendMessageToPC(oDebug, "\nRun ( clearareaactions ) " + GetName(OBJECT_SELF) + " ( " + GetTag(OBJECT_SELF) + " )");

    object o;

    object oArea = GetFirstArea();
    while (GetIsObjectValid(oArea))
    {
        SendMessageToPC(oDebug, ". area= " + GetName(oArea) + " ( " + GetTag(oArea) + " )");

        o = GetFirstObjectInArea(oArea);
        while (GetIsObjectValid(o))
        {
            if (GetTag(o) == "Figg")
            {
                SendMessageToPC(oDebug, ". . found Figg - " + GetName(o) + " ( " + GetTag(o) + " )");
            }

            if (GetTag(o) == "DaleC")
            {
                SendMessageToPC(oDebug, ". . found DaleC - " + GetName(o) + " ( " + GetTag(o) + " )");
            }

            if (GetObjectType(o) == OBJECT_TYPE_CREATURE)
            {
                SendMessageToPC(oDebug, ". . clear actions on " + GetName(o) + " ( " + GetTag(o) + " )");
                AssignCommand(o, ClearAllActions(TRUE));
            }
            o = GetNextObjectInArea(oArea);
        }

        oArea = GetNextArea();
    }
}


and strangely the fix persists after saving+reloading, or loading to another area (the city). The errors spew out more slowly in the tavern but much faster once in the city; which is an indication that it's related to AI-driven events.



i guess the next thing to do is the LogRunScript thing ..........

  • up
    100%
  • down
    0%
GCoyote

Thanks Kev! I"m out "playtime" for a bit. I give this a try the next chance I get.

  • up
    50%
  • down
    50%
kevL's

apparently, actions are (or can be) persisted in the savedgame files. I used TlkEdit2 (as per..) to hunt down Figg the merchant inside the saved .Git for Dale city. His "ActionList" has **300** entries.

But after running the pseudo-fix script above (then saving), it clears.


however, finding exactly what assigned ~300 actions to Figg + 2 dale commoners is beyond my inclination :|

Ps. note that running that script could break something like a unique, pre-designated dialog start. Here's a safer version:


// clearareaactions
void main()
{
    object oDebug = GetFirstPC(FALSE);
    SendMessageToPC(oDebug, "\nRun ( clearareaactions ) " + GetName(OBJECT_SELF) + " ( " + GetTag(OBJECT_SELF) + " )");

    object o;
    string tag;

    object oArea = GetFirstArea();
    while (GetIsObjectValid(oArea))
    {
        SendMessageToPC(oDebug, ". area= " + GetName(oArea) + " ( " + GetTag(oArea) + " )");

        o = GetFirstObjectInArea(oArea);
        while (GetIsObjectValid(o))
        {
            if (GetObjectType(o) == OBJECT_TYPE_CREATURE)
            {
                tag = GetTag(o);
                if (tag == "Figg" || tag == "DaleC")
                {
                    SendMessageToPC(oDebug, ". . clear actions on " + GetName(o) + " ( " + tag + " )");
                    AssignCommand(o, ClearAllActions(TRUE));
                }
            }

/*          if (GetTag(o) == "Figg")
            {
                SendMessageToPC(oDebug, ". . found Figg - " + GetName(o) + " ( " + GetTag(o) + " )");
            }

            if (GetTag(o) == "DaleC")
            {
                SendMessageToPC(oDebug, ". . found DaleC - " + GetName(o) + " ( " + GetTag(o) + " )");
            }

            if (GetObjectType(o) == OBJECT_TYPE_CREATURE)
            {
                SendMessageToPC(oDebug, ". . clear actions on " + GetName(o) + " ( " + GetTag(o) + " )");
                AssignCommand(o, ClearAllActions(TRUE));
            } */

            o = GetNextObjectInArea(oArea);
        }

        oArea = GetNextArea();
    }
}


you could adapt the tags it checks, if need arises

But, the ball's in MERP's side of the field now ...... (it *might* be in the Commoner AI but don't quote me)

  • up
    50%
  • down
    50%
GCoyote

Well a couple things have already broken in that at least two items I know should have spawned in a location failed to appear. Since I have not had chance to find the earliest instance of the overflow I'm not yet sure if there is causality here.

Thanks for the new script. I'm saving this one with a different file name, clearareaactionsNPC, so I can do some tests later.

  • up
    50%
  • down
    50%
MERP UK

Hey guys, thanks for looking through all this. I'd not of noticed if GCoyote hadn't poked me towards it! I've had issues with action overflow before, in another area. I simply removed the AI from the affected NPCs as I couldn't determine why assigning basic AI routines was causing them problems and not other NPCs with similar setups.

Personally, I would do the same in the Dale Area. In fact, I'm returning to Legends AI plugin for future stuff. Used it for the IP campaign, no issues that time round.

In terms of your existing game... I'm assuming you now have a sticking-plaster solution. My only real response is to update the campaign (which I really want to do anyway) with the AI system removed and replaced.

Interestingly, do errors such as this result in strange behaviour/failure in other scripts? Because UA has a couple of strange goings on elsewhere that I cannot fathom out!

  • up
    50%
  • down
    50%
GCoyote

Hi Kev. Yes there have been two spawn failures of figurines. One on the bench in plaza and one in the Blue Maiden. Working back through my saves, these failures occurred after the overflow begins. 

I also have a separate issue that may be just a bad blue print. Once I get more information I'll post on the UA module page.

  • up
    50%
  • down
    50%
MERP UK

Thanks. There is a grand collection of problems going on for a soon-ish update package. I'm going to continue my own gameplay footage as a joint means of fun and documentation :P

  • up
    50%
  • down
    50%
GCoyote

I have three or four minor bugs/notes I'll forward to you later. 

  • up
    50%
  • down
    50%