Serious Problem! (I Believe To Be Resolved Now.)

I have tried restoring a backup and the problem persists …

image

Any ideas what causes this … It happens when I try to save a script, which seems to have an issue with something in it … I am trying to work this out, but asking of anyone else has seen this before?

hm, show “Details” pls.

Does everything work okay when the body of the script is commented out ? If so, pls post script …

 
re. details – just the stacktrace

1 Like

@kevL_s

I did not think the details were much help, but if it happens again, I will see what I can copy … EDIT: “stacktrace” … will that be a subsection of that “details”?

Anyway, I also have an update …

I think I have managed to track the issue down to a function I updated on 16th April, which is a pseudo heartbeat script that I added not so long ago. It was hard to track down because the script that was causing the problem did not directly call this library script. The function was within another library that was called from a library that the script used! :dizzy_face:

So, the problem only revealed itself when I just so happened had to edit this script today… i.e. It had not shown itself a problem with any complete compiling I had done to date. Then, when I went to save it, the toolset hung and eventually started giving this feedback. So, I am currently looking at this now, and seeing where it leads.

However, while you mention it: What is that “stacktrace” then? What about it is helpful?

Thanks! :slightly_smiling_face:

EDIT: Well, perhaps not … As I now have this going on … i.e. I managed to reach the point where the script did not immediately crash on saving, but now (on an edit), it comes back with weird information on the save, which cannot be correct as all I did was comment and then uncomment a single debug line.

i.e. It seems like the official campaign include files are throwing errors, which is not possible. :thinking:

P.S. It has not done the main fault to be able to give more details so far … coming out of the toolset and reloading/saving the script again sorted the last problem with the weird x0_i0_position error.

This is effectively how I traced it back to the function in question.

@kevL_s

After moving the “offending” function to a different include script and recompiling a number of scripts, the script with the issue previously, no longer hangs and compiles as normal. Furthermore, the other weird issue (OC position issue) is no longer around.

Honestly, I have no idea why the function would have even caused an issue in the first place, nor do I understand why moving it to a slightly smaller library has helped. :face_with_diagonal_mouth:

I can only add that the library the function was in originally is very large indeed, and I am beginning to wonder if it is possible that I am hitting some kind of limit to include file size, perhaps? I honestly don’t know, but (again) I am going to keep an eye on this function and surrounding includes to see if anything else pops up unwanted.

I am still interested in hearing about this “stacktrace” point, as maybe that is what the issue is, and I am just not understanding what is meant by that. :slight_smile:

I will mark this as “resolved” for the time being …

The exception dialog is usually divided into 2 or 3 parts

  • general description
  • stacktrace
  • modules loaded

a stacktrace is a list of the functions that were being called (put onto the CPU stack) with the one that throws at the top. It’s the section that has a bunch of dots and parentheses and looks like complete gibberish …

eg

DrawRenderer.Draw(arg arg)
DrawPrerequisites.GetStuff(arg arg arg)
Window.Cube.GetCoordinates(arg)
Window.DrawCube(arg arg)
etc
etc

( i totally just made that up )

it means that DrawCube() called GetCoordinates() called GetStuff() called Draw() and then something bad happened in Draw()

The stack is a stack of functions that the CPU is trying to execute in that order. If you have the code, it can be looked at and perhaps debugged. If not then sometimes it still gives us a clue – eg. if it mentions “blueprint” then the issue could be a corrupt blueprint …

 

hm, might be a circular dependency heirarchy … ie, an #include references another #include that references back to the first #include … there are safeguards against that happening but have seen it happen anyway. When it does (or something like it) it’s, uh, nontrivial /shrug

 

idk, could be

1 Like

@kevL_s

OK, that is good to know … and I will certainly try to look at that information if it does that to me again … although I am quite happy if it stays away now. :slight_smile:

Out of interest, do you know if the variables (held on the player PC) can be easily checked outside the game with a util of some kind?

I tried opening player.bic and used GFF, but could not find a variable I was expecting listed on them. Also, in the same manner, is there any way to open the XXXXX.Z file that I assume is the core file for the saved game so that we can check variables stored in that?

In short … a *.bic and a *.Z reader to check for variables set?

I am asking because the same function I am checking works for one saved game and not another … :thinking:

I can also add that the function in question loops through the faction members and then grabs the highest skilled member and records that person *with skill) as a variable on the Main PC … It works fine at the start, but by the time the player has been playing (in one test game I have), the function fails to update this list of variables. I am trying to work out what has happened … In game testing shows that the Main PC still has these variables, but the function no longer updates them in the same way.

Library above 900 lines starts to gives me a lot of problems.

I had to cut them down into smaller ones.

1 Like

@Shallina

My main include end line … :woozy_face: I looked at trying to break this up at one time, and it got really hard and ugly very quickly.

Did you mean 9000 lines, perhaps?

And here is the end of the supporting one, after I managed to split it a bit …

GeneralGFF is a gff editor for Nwn2.

you’re looking for the VarTable but i believe it gets deleted from .BIC files. It is present in the PlayerList.IFO however.

 

.Z files are just .ZIP files. 7-zip opens them. But it’s been hit and miss for me, trying to repackage edited saves …

Inside the .Z is a “-” file – use Tani’s Nwn2Packer to open it and you’ll get at the savegame files.

2 Likes

@kevL_s

Thanks for this info … I was trying to use the GFF util, but as I say, I could not find the variables and so they must be “deleted” as you said.

In case you missed my edit above, I added some more details of an issue I am looking into … I am trying to ascertain if it is related to the amount of data being stored/updated on the Main PC at time of being called …

I can also add that the function in question loops through the faction members and then grabs the highest skilled member and records that person (with skill) as a variable on the Main PC … It works fine at the start, but by the time the player has been playing (in one test game I have), the function fails to update this list of variables. I am trying to work out what has happened … In game testing shows that the Main PC still has these variables, but the function no longer updates them in the same way.

Anyway, I will try to open up those files as you say and let you know if I figure anything out. I’m offline for a couple of hours now, but will get back when I can. :+1:

1 Like

am pretty sure that thousands of vars can be stored on a creature …

3 Likes

@kevL_s

Something is playing havoc with some saved games, but I’ll try to work it out … I may just be asking too much at one time … I’ll try reporting back later. :slight_smile:

2 Likes

I start having problem between 900 and 1000 line with librairy.

Perhaps it’s linked with the number loops or whatever.

But sometime the functions/instructionx that were further to a certain “line count” in the librairy weren’t correctly processed. (hte function were correctly called, but not processed)

By cutting the librairy into smaller ones, without changing a single line of code the problem was solved.


block functions definitions

block implementations

I think it didnt like at all calling a function which definition was “too far away” in line count from its call or definition.

2 Likes

@Shallina

Well, I have certainly had a couple of weird issues over the last few days… and so will continue to investigate … I just wish that some of these issues did not take so long to show. :thinking:

We are growing a little to confident, NWN2 scripting is not a “proper devellopement tool or environnement”.

Weird bugs can emerge beceause it’s not fully “bullet proof”.

3 Likes

You can say that again. That’s NWN2 in a nutshell, I think. It’s sad that it’s just like…I don’t know…80 % reliable.

Good to know. In the module I’m working on at the moment, I have A LOT of local ints stored on the PC character and sometimes I get worried it’s too much, but if thousands can be stored then I should feel safe. But as stated, NWN2 behaves really randomly at times. I’ve had some really weird issues lately with a custom creature being put into an area, and when playtesting - even though I have baked the area and all - the creature is not in the area anymore, so I have had to place debug scripts checking if the creature is in the the area, and if not, spawning the creature. Then everything has worked.

2 Likes

I nevers got any trouble for storing var anywhere in what ever number.

But I noticed that the lenght of the stored “identified” could not exceed a certain lenght (it’s cut without any warning).

BTW I fully finished SOAR “scripting” a few day ago, now I need to “merge”, “integrate”, “Debug”, “test continuity”, " and just “polish in a real play test environement”.

But all the “heavy scripting” “hair pulling” beceause something “stopped working for no reason” is behind me. I am out of the “trench” (until the next project if there is one).

Also sometime the problems are in the “default game librairies”, some of them don’t compile, the game runs on compiled scripts which we don’t have the real sources all the time.

Pulling out the “source code from a librairy”, and “runing it, testing t, and debugging it” cannot be avoided.

How many did I have something not working beceause the default source code isn’t the real one that is running, and when you call it, it blows on your face. Last time I got this is when I worked on the character.xml in order to complete it. One of the stock librairy was missing an include.

I completed and debugged a lot the “ginc_group” and “ginc_companion” librairies for exemple, I found them to be among the most usefull

1 Like

So the “ginc_group” and “ginc_companion” are buggy/corrupted?

I remember some of the function in “ginc_group” not working.

and for “ginc_companion”, I think it’s one of the librairy involved.

Alright. Good to know.