Jump to content


Photo

Several problems with BP


  • Please log in to reply
29 replies to this topic

#1 Fennek

Fennek
  • Member
  • 355 posts

Posted 05 February 2011 - 08:27 PM

Hello there, somebody at Kerzenburg encountered serious problems with BP. I attached the debug and also the weidu-log (until the problems start). Maybe you know what's going on. I'm sorry that I cannot provide further information at them moment. TOOLTIP.2DA and some ids-files might be responsible (?)

Debug:
Spoiler


Weidu.log:
Spoiler


#2 Turambar

Turambar
  • Modder
  • 935 posts

Posted 06 February 2011 - 01:01 AM

The main component failed because it encountered problems, caused by other mods, with tooltip.2da. I've had that problem as well, due to item revisions messing up tooltip.2da. could you please ask him and attach change-log of his tooltip.2da, and the file itself? Anyway, I know item revision has been fixed, but the fix must be downloaded separately from its forum, and extracted over item_rev after it has been extracted, and before installing it (I don't understand why they can't just update the file itself, but those things sometimes happen on g3). This means, that he'll have to re-install most mods, as he's installed item_rev so early.
The other option is messing a bit with the .tp2 code, in order to prevent BP from dealing with tooltip.2da (which is already so messed up that it won't work anyway, but it's not an important file). You just have to look for tooltip.2da in the .tp2, and you'll find something like the code attached below.
the things which are in red have to be added, if they are not yet there, in order to allow the installation to proceed.

The other errors depend on the fact that, if the main component's missing, the subcomponents can't be installed.

code:
////////////////////////////////////////////////////////

COPY_EXISTING ~tooltip.2da~ ~override~

SET_2DA_ENTRY 0 0 3 ~ ~

BUT_ONLY



// Dealing with TOOLTIP.2DA **********************************************

APPEND ~TOOLTIP.2DA~ ~HELMLIFE k96738 k96740 25765kkkkkk~

APPEND ~TOOLTIP.2DA~ ~SHADLNTH k99780 -1 -1kkkkkk~

APPEND ~TOOLTIP.2DA~ ~BUCK02 6347 12028 -1kkkkkk~



COPY_EXISTING ~TOOLTIP.2DA~ ~override~

SET required_columns = 10

SET rows=2

SET rows_prev=0

SET col_cnt=0

WHILE "%rows%">1 BEGIN

col_cnt = col_cnt + 1

rows_prev = rows

COUNT_2DA_ROWS col_cnt rows

END

col_cnt = col_cnt - 1

SET ccc = col_cnt - 1



PATCH_IF 1 BEGIN

SPRINT str_add ""

SPRINT str "%ccc%"

FOR(cnt="%col_cnt%"; cnt<="%required_columns%"; cnt+=1) BEGIN

SPRINT str "%str%"^" %cnt%"

SPRINT str_add "%str_add%"^" -1"

END



READ_2DA_ENTRY 0 0 3 "test"

PATCH_IF( "%test%"=1 ) BEGIN

SET_2DA_ENTRY 0 0 3 "0 1"

END

/*

PATCH_IF("%ccc%"<"%required_columns%") BEGIN

SET_2DA_ENTRY 0 ccc ccc "%str%"



FOR(j=1; j<="%rows_prev%"; j+=1) BEGIN

READ_2DA_ENTRY j ccc col_cnt "last"

SPRINT str "%last%"^"%str_add%"

SET_2DA_ENTRY j ccc col_cnt "%str%"

END

END*/

END



REPLACE_TEXTUALLY ~kkkkkk~ ~%str_add%~

REPLACE ~k96738~ ~Life Protection~

REPLACE ~k96740~ ~Chaotic Commander~

REPLACE ~k99780~ ~Summon Shadows~

/*

// Now remove added "0" header:

READ_2DA_ENTRY 0 0 4 "test"

PATCH_IF( "%test%"=0 ) BEGIN

SET_2DA_ENTRY 0 0 4 ""

END*/

//////Fixes it; now it matches the in-game description

BUT_ONLY_IF_IT_CHANGES

Edited by Turambar, 06 February 2011 - 01:25 AM.

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#3 -J Beau-

-J Beau-
  • Guest

Posted 06 February 2011 - 01:57 AM

I believe item revisions is coming out with V3 any day now.

#4 Turambar

Turambar
  • Modder
  • 935 posts

Posted 06 February 2011 - 02:35 AM

I believe item revisions is coming out with V3 any day now.

I hope so. Anyway, that fix dates back to june, and in 7 months someone could have uploaded a v2.5, even though it had just a few fixes, especially as it broke the installation of quite many mods (many were only saved by the fact that they're installed before, but still the tooltips don't work). Once the fix has been written, it's not so difficult to just upload it

Edited by Turambar, 06 February 2011 - 02:35 AM.

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#5 Fennek

Fennek
  • Member
  • 355 posts

Posted 06 February 2011 - 03:20 AM

The fix could/should also have been put into the BWP fixpack, I thnik, but apparently nobody noticed it (or whatever)...

Anyway, thanks Turmabar. I guess the change-log will also be posted here during the next days, just in case...

#6 flight of the swallow

flight of the swallow
  • Member
  • 7 posts

Posted 06 February 2011 - 04:31 AM

Ok, here is the TOOLTIP.2da
Spoiler


And here the changelog( Hope, I did it right):
Spoiler

Edited by flight of the swallow, 06 February 2011 - 07:11 AM.


#7 the bigg

the bigg

    2083 is a prime number.

  • Modder
  • 3331 posts

Posted 06 February 2011 - 04:45 AM

Can I point out that (as already pointed out by devSin) items with more than three abilities in tooltip.2da are innately broken?

Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.


#8 Turambar

Turambar
  • Modder
  • 935 posts

Posted 06 February 2011 - 07:05 AM

Can I point out that (as already pointed out by devSin) items with more than three abilities in tooltip.2da are innately broken?

Thanks, I didn't know that. I actually had read somewhere that those items with 6 tooltips were some which had more than one melee ability + some magical abilities (accessible through magical items button); I thought that worked well

And here the changelog( Hope, I did it right):

Actually, you haven't change-logged any file.
Are you doing it with the change-log.bat or directly through command line?
Have you still all mods coming before BP installed?

Edited by Turambar, 06 February 2011 - 07:06 AM.

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#9 flight of the swallow

flight of the swallow
  • Member
  • 7 posts

Posted 06 February 2011 - 07:13 AM

Changelog is corrected in the Post above.

#10 the bigg

the bigg

    2083 is a prime number.

  • Modder
  • 3331 posts

Posted 06 February 2011 - 07:25 AM

Thanks, I didn't know that. I actually had read somewhere that those items with 6 tooltips were some which had more than one melee ability + some magical abilities (accessible through magical items button); I thought that worked well

It's items with more than 3 extended headers that might cause problems (independently of what those extended headers are); if an item has more than that, when it's added to a store or creature, the engine writes the charge information for the 4+th ability into a section of memory that should hold other data; the effect of this data corruption could theoretically be anything (up to and including erasing your hard drive), but in practice the worse thing that might happen is a non-reproducible CTD (unless a dedicated hacker willfully decided to release a mod to exploit the vulnerability to gain control of your computer, but people with the skill to do so don't waste their time writing viruses for BG2).

Obligatory Wikipedia article: http://en.wikipedia....Buffer_overflow

Edited by the bigg, 06 February 2011 - 07:29 AM.

Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.


#11 Turambar

Turambar
  • Modder
  • 935 posts

Posted 06 February 2011 - 09:14 AM

Ok... so, I get that something should be changed: either those items should have their extended headers somehow reduced in number, or the exe should be patched to reserve more memory for item's extended header (through exe hacks such as tobex)?
I've seen there are many items like this in the old CB mods (TDD, CTB,...), but I don't know what they should do and how they could be fixed; one is in NT as well (and removing some of those headers could be a good thing as some NT items are overpowered); IIRC, the BP items have maximum three EH

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#12 the bigg

the bigg

    2083 is a prime number.

  • Modder
  • 3331 posts

Posted 06 February 2011 - 09:49 AM

Ok... so, I get that something should be changed: either those items should have their extended headers somehow reduced in number, or the exe should be patched to reserve more memory for item's extended header (through exe hacks such as tobex)?

Possibly, but this would cause problems with saves (the CRE and STO format only have space for three charge counts, so you'd have to drop the others); moreover, Asc64 said that adding bytes to data structures (vs. altering the meaning of the currently declared ones) is too troublesome.

Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.


#13 Turambar

Turambar
  • Modder
  • 935 posts

Posted 06 February 2011 - 10:39 AM

Possibly, but this would cause problems with saves (the CRE and STO format only have space for three charge counts, so you'd have to drop the others); moreover, Asc64 said that adding bytes to data structures (vs. altering the meaning of the currently declared ones) is too troublesome.

Ok, I understand. So, the only thing is to correct those items, mod by mod.
I'll open a thread somewhere, if there's none (or none is active), to make a list, so that they can be fixed in any new version

Edited by Turambar, 06 February 2011 - 10:40 AM.

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#14 Miloch

Miloch

    Barbarian

  • Modder
  • 6573 posts

Posted 08 February 2011 - 11:06 AM

I think an acceptable "hack" for items with 4 headers is to have the melee header last, because it will never take any charges (assuming it's not an Ultima-style "glass sword" type of weapon that breaks with one use). Thus, you could have 2 magical abilities and a ranged ability (or 3 magical abilities).

Five or more headers is a bit egregious though. Obligatory movie quote:

...and the number of the counting shall be three. Four shalt thou not count, neither count thou two, excepting that thou then proceed to three. Five is right out.


Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Infinity turns out to be the opposite of what people say it is. It is not 'that which has nothing beyond itself' that is infinite, but 'that which always has something beyond itself'." -Aristotle


#15 the bigg

the bigg

    2083 is a prime number.

  • Modder
  • 3331 posts

Posted 08 February 2011 - 12:03 PM

I think an acceptable "hack" for items with 4 headers is to have the melee header last, because it will never take any charges (assuming it's not an Ultima-style "glass sword" type of weapon that breaks with one use). Thus, you could have 2 magical abilities and a ranged ability (or 3 magical abilities).

1) Even if the over-limit headers are melee headers and don't use charges, the data structures are still allocated unsafely (they might be or not accessed later, which might or not make it harder to crash the game or other undesired behavior, but it's still a Bad Idea on principle).
2) Would such a setup even work correctly with the engine (I.E. will it be able to understand it should apply header 3 and not header 0 by default)?

Edited by the bigg, 08 February 2011 - 12:06 PM.

Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.


#16 Wisp

Wisp
  • Modder
  • 1353 posts

Posted 08 February 2011 - 12:28 PM

I think an acceptable "hack" for items with 4 headers is to have the melee header last, because it will never take any charges (assuming it's not an Ultima-style "glass sword" type of weapon that breaks with one use).

Staff of Striking. (Charged melee header.)

#17 Miloch

Miloch

    Barbarian

  • Modder
  • 6573 posts

Posted 09 February 2011 - 05:20 AM

1) Even if the over-limit headers are melee headers and don't use charges, the data structures are still allocated unsafely (they might be or not accessed later, which might or not make it harder to crash the game or other undesired behavior, but it's still a Bad Idea on principle).
2) Would such a setup even work correctly with the engine (I.E. will it be able to understand it should apply header 3 and not header 0 by default)?

I don't know for sure, but I've tested such items quite a bit and have not had anything like a crash. The only thing I noticed was the charge-setting issue when buying/selling from stores, and I fixed that by moving the melee header to the end. There's an item like this in Thrown Hammers (not mine, included from another modder by request) which also patches tooltip.2da to account for an extra column if it needs to. There's a thread buried on G3 with devSin's comments on the subject. I don't think either of us agrees it's a "good idea" but I don't think it'll reformat your hard drive or anything. Maybe someone (i.e. Ascension64) could investigate what exactly happens to the data structure in saves etc. Not like he doesn't have better things to do :D.

Staff of Striking. (Charged melee header.)

Yeah, or something like that. Not really relevant since it only has one header, but someone would be particularly foolish to add more than 2 extra ones to it (unless they gave it a ranged ability that didn't require charges, but that would be stupid).

Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Infinity turns out to be the opposite of what people say it is. It is not 'that which has nothing beyond itself' that is infinite, but 'that which always has something beyond itself'." -Aristotle


#18 the bigg

the bigg

    2083 is a prime number.

  • Modder
  • 3331 posts

Posted 09 February 2011 - 05:32 AM

As devSin said, it takes a lot of effort to reliably cause crashes (and extraordinarily more effort to execute arbitrary code). It's up to you if you think that an item that has a .5% chance of causing a non-reproducible CtD when you load a game is statistically acceptable or not.

Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.


#19 Miloch

Miloch

    Barbarian

  • Modder
  • 6573 posts

Posted 09 February 2011 - 06:21 AM

I don't think any chance of a crash is acceptable, but what's not clear is whether a null-charged 4th header could have any chance of causing that. I've never seen it, nor any report of it. Hence why further investigation (rather than speculation) might be helpful.

It's clearly not acceptable for mods to be trying to extend tooltip.2da to 9 columns or whatever. Or worse, just adding items with multiple magic abilities and not even bothering with tooltip.2da. I don't know if BP actually does this or if it's just trying to accommodate the other megamods (a lot of its code is actually geared toward the latter).

Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Infinity turns out to be the opposite of what people say it is. It is not 'that which has nothing beyond itself' that is infinite, but 'that which always has something beyond itself'." -Aristotle


#20 the bigg

the bigg

    2083 is a prime number.

  • Modder
  • 3331 posts

Posted 09 February 2011 - 06:37 AM

I don't think any chance of a crash is acceptable, but what's not clear is whether a null-charged 4th header could have any chance of causing that. I've never seen it, nor any report of it. Hence why further investigation (rather than speculation) might be helpful.

Buffer overflows are time bombs, which (depending on chance) might not trigger, trigger exactly when the item is accessed, or two hours later during something completely unrelated, when the game tries to access just that specific dirtied byte in the memory.

I don't know if BP actually does this or if it's just trying to accommodate the other megamods (a lot of its code is actually geared toward the latter).

Somebody mentioned that BP doesn't add any items with more than 3 abilities, it's just having trouble patching tooltip.2da.

Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.