Jump to content


Photo

"Cut the crap!" ( remove the lag )


  • Please log in to reply
6 replies to this topic

#1 Miksip

Miksip
  • Member
  • 50 posts

Donator

Posted 10 November 2017 - 08:57 PM

This topic is intended for those who experience slowdown caused by scripts and not sure how to deal with it.

 

TOOLS

 

1) NearInfinity - file browser and editor for the Infinity Engine.

Get it here https://github.com/A...inity/releases.

 

2) Notepad++ - friendly text editor.

Get it here https://notepad-plus-plus.org.

If you want to find "where does this piece of code came from" then open Search->Find in Files and use those filters " *.tp2 *.baf *.tpa *.tph *.ssl " to look through your megamod directory.

 

FOR YOUR INFORMATION

 

Game assets are saved in data folder in biff files which are easy for game to read.

Then if game find files with the same name in override folder - it uses them instead those found in biffs.

So even if you delete files in override - if they are saved in data folder then it is fine.

Make backup before experimenting!

You can delete baldur.bcs from override folder - game will use one in data folder instead.

 

If you want to check that your lag is caused by script - then make empty file called baldur.bcs in override folder ( or delete everything in already present).

Start the game and see for yourself if your lag is gone.

If it is gone then read here http://www.shsforums...e-3#entry259875

 

"The only reliable way to actually fix the slowdown" read here http://www.shsforums...e-2#entry597802

 

Now open NearInfinity->Game->Open  File->Open internal file-> baldur.bcs .

 

WHAT TO CUT

 

1) Beholder steals Mirror Shield and Cloak of Mirroring - this is added by SCS and not needed.

They implemented it because original shield is too powerful against beholders.
There is better solution to this - install item revisions. It has improved version of Balduran shield.
And remove from baldur.bcs and baldur25.bcs.

Look for DMWWBeholderSteal .

 

2) from refinements :

"BG2 Refinements offers new HLA tables for ALL classes and kits, which means this component may
clash with other mods that modify HLA material. A new Kit, both player selectable and "invisible"
(the player may not select the kit, which is typically used for an NPC or as a method to add a new
set of abilities to a character as it levels up) may come with a NEW HLA table"
"Implementing the Use Scrolls ability required some heavy coding, so a few decisions have been
taken in order to simplify the situation a little. Fortunately they also ultimately... make sense.

First, we've decided to make the Wizardslayer/Mage dual class combo "illegal."

Second, Use Scrolls is intended as a "built-in" ability for all kinds of mage/thieves; this is
perfectly normal most of the times, but technically mages who dual to thieves should not have it
until *reactivation* of the mage class.
That is only a temporary condition though, and those are characters that have very little reason
to "forget" that ability: they naturally have it as mages, and they have ALSO the "tendency" to
acquire it as thieves. In a way, it's a "common" feature of the two classes, not an exclusive one
of the mage part.
Now, handling this pathological case as all the rest would require an amount of work absolutely
unjustified for characters who, after all, have so many reasons to know how to read scrolls, and
this decision leaves the code significantly lighter, which is always a good thing."

You can see that this code is combination of mage X class X kit X player.
And the more kits you have the more code it adds to baldur.bcs .
I have cut 9418 lines for 148kb which is twice the Baldur's Gate 2 code.
Cut it. Look for kits with endings tF and tw in baldur.bcs and baldur25.bcs .

And there is invisible creature following you around which adds those kits too. Called Li#Stri.
Before installation remove ~kit.tpa~ mention from ~refinements\lib\hla_thief.tpa~ ,also ~kit_ee.tpa~ from ~hlab.tpa~ and setup-refinements.tp2 .
This may break some HLAs if they weren't already broken.


Simple solution - don't install Refinements.

 

3) Turambar component 2050 slow drow items disintegration and The Tweaks Anthology component 1050. Don't install them at all. Also some mods install additional checks for characters to remove drow items.

Look for DROWITEMCHECK . Not all is necessary to remove. if there is no hasitem checks then you can leave them alone.

 

4) BG2Fixpack component 104 [Ghreyfain's Holy Symbol Fixes]. Remove from baldur.bcs and baldur25.bcs.
Look for CDHLYSYM .

 

5) More drow items checks from Vault mod.

Look for  VaultDrow .

 

6) This is from YLItems. Bastard Sword +5: Holy Avenger: The Curse of Heaven and Arya Suit bonus for full complect.
Remove ~EquipEFF.BAF~ mention from setup-YLITEMS.tp2 before installation if you want items without excess scripts.
Cut from baldur.bcs and baldur25.bcs.

Look for SW1HPW and ARYASUIT.

 

7) This is from Stuff of The Magi mod. Again bonuses for complete set.

If you want equipment without more bonuses and extra code for baldur.bcs then remove ~wzrdset.baf~ mention from Setup-StuffofTheMagi.tp2 before installation.
Look for wzrdset .

 

8.) Check the Bodies. SongSapate, Moonblade, ElfSapate checks for rightful owner, talks and upgrades. Get the latest version with CBMOONP1-6 for party member 1-6 .
Look for Spellsung CBEMMOON CBMOONP and for CBMOONP once more.

 

9) Additions by Vlad's Compilation v10. Remove from VCv10.tp2 before installation "Drow Item\Avatar Fixes" - check for drow items and "BALDUR.BCS fixes by Extremist" paragraph - for some minor additions.
Look for SorcererScript & SorcererSumFig .

 

10) The Darkest Day. Tuki Kiba - katana which changes to day/night version.

Look for kiba .

 

11) Piece of code from TDD which no one knows where it came from.

You can read about it here http://www.shsforums...-10#entry493986 .
Cut m2guard2 .

 

12) The Darkest Day. Check for right owner from Vesine(NPC) blade.

Look for vesine .

 

13) Talking Sword of Flame from Bonehill.

Cut bhfsw1 .

 

14) Shadows over Soubar . This one is quite an old thing. Hellblades.
See this post from 2007 http://www.shsforums...cs/#entry361660
or this post from 2005 http://www.shsforums...ns/#entry190976
For your information SoS appends bladur.bcs with 96kb full of Hellblades and only 5kb of quest triggers.
Remove ~SOS/SNIP/bBALDUR.BAF~ mention from tp2 before installation.
Look for CBHB .

 

15) This is from Region of Terror. Talking armor to match with your talking sword.
Look for SoulArmr .

 

16) Enhanced BG2 v1.1 component 6 [Dragonsuit & Glory of Balduran (ToB)] - gives bonuses when you equip full complect. Sounds good, but not in constantly running scripts. This component overwrites shield of balduran(wa2shiel.itm) from item revisions . I would recommend to skip it completely.
Look for DS01 and GOB01 .

 

17) Impasylum Breudayael's Wedding Ring checks for owner.

Look for r#wedrin .

 

18) Talking sword Lilarcor. You can cut it, but it is the only talking sword that i approve of, so personally I'm gonna leave it.

Look for sw2h14 and c2sw2h01 .

 

WHAT TO LEAVE

 

1) This is from 1PP component 113 . Script to change your character animation. You can leave since it is not that big and without this animation change wouldn't work.
Don't look for UNARMOURED .

 

2) There is some extra code in dplayer2.bcs and dplayer3.bcs which makes your armor, shields and weapons shatter - better leave it alone if you want item shattering to work right.

 

3) "Kuroisan", the Acid Kensai. It is tactical encounter from BP and Tactics. Look for advice in tactics2 folder.

 

TIPS & TRICKS

 

You can replace partyhasitem("%item%") to hasitem("%item%",Player2) so script which looks through all your party items ( including all spaces of your empty "Botomless Bag") will look only in one character inventory - Player2. Give all quest items to him/her and don't give this character more than 1 bag with less than 50 capacity.

You can change bag capacity by editing your savegame. Look here http://www.shsforums...-2#entry597780.

 

Also you can save 1 copy of wzrdset and ARYASUIT assigned to this player and then change it to the one who is going to wear it when you have all the items.

 

ADDITIONAL INFORMATION

 

1) "Botomless bag" from Vlad Compilation and Baldurdash.

See here http://www.shsforums...e-2#entry597745

and here http://www.shsforums...e-3#entry260191

and here http://www.shsforums...e-3#entry410930

 

It may be not necessary anymore if you followed advice in tips & tricks, but if you want to then remove "Botomless bag" mention from Setup-VCv10.tp2 and Setup-BDToBv175.tp2.

 

2) Other causes of lag by script http://www.shsforums...-2#entry259682.

See example here http://www.shsforums...-nej2-v691-mod/

 

3) 1PP High Quality Music also causes lag on my system. You better make sure that it is fine for you before big installation.

Install BGT and high quality music->New BG1 game->see cutscene when Gorion dies. If there is lag then better not to install it.

 

4) Ambient sounds. Read about them here http://www.shsforums...s/#entry504047.

Open baldur.ini and under [Game Options] change to

Low Mem Sounds 1=1
Low Mem Sounds 2=1

 

5) If you encounter lag in certain areas then most probably area script contains "PartyHasItem" in it.

Make save in this area, then open NearInfinity->Save->Your save->Baldur.gam and click on Current Area mentioned.

Now click on Area Script and change any "PartyHasItem" that you find in it as described above.


Edited by Miksip, 21 November 2017 - 01:33 AM.

P.S. Don't listen to The Imp - it is voice of the Devil.


#2 The Imp

The Imp

    Not good, see EVIL is better. You'll LIVE.

  • Member
  • 5155 posts

Posted 10 November 2017 - 11:06 PM

Hmm, there's a lot more detail that could be accumulated from the above if you would actually use spoilers on what you have cut from the baldur.bcs ... or just run the LStest tool in a lagging game, with ambients off.

Have you done anything on this list ? The Ambient sounds are handles by the BWS and BWP automatically ... if you actually make a proper mega install for example. The biffing won't help if you don't actually do it etc.

Aka, I haven't seen one weidu.log from you. That I would remember.

 

PS, I am the builder of that list, so I know how important it has been.


Yep, Jarno Mikkola. my Mega Mod FAQ. Use of the BWS, and how to use it(scroll down that post a bit). 
OK, desert dweller, welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand. Ouh, actually it was still snow then.. but anyways.


#3 Mirandel

Mirandel
  • Member
  • 64 posts

Posted 11 November 2017 - 12:37 PM

Wow! A very impressive list. Thank you for sorting it all out and all the recommendations. Looks like together with Megamod installation FaQ it covers every possible case!



#4 subtledoctor

subtledoctor
  • Modder
  • 656 posts

Posted 11 November 2017 - 08:05 PM

Before installation remove ~kit.tpa~ mention from ~refinements\lib\hla_thief.tpa~ ,also ~kit_ee.tpa~ from ~hlab.tpa~ and setup-refinements.tp2 .
This may break some HLAs


This is bad advice. You want to break stuff for the sake of removing 3 kits and a grand total of 14 lines from baldur.bcs? That's not going to make any difference.

#5 The Imp

The Imp

    Not good, see EVIL is better. You'll LIVE.

  • Member
  • 5155 posts

Posted 28 November 2017 - 12:40 PM

4) Ambient sounds. Read about them here MM faq
Open baldur.ini and under [Game Options] change to
Low Mem Sounds 1=1
Low Mem Sounds 2=1

Edited by The Imp, 28 November 2017 - 12:43 PM.

Yep, Jarno Mikkola. my Mega Mod FAQ. Use of the BWS, and how to use it(scroll down that post a bit). 
OK, desert dweller, welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand. Ouh, actually it was still snow then.. but anyways.


#6 The Imp

The Imp

    Not good, see EVIL is better. You'll LIVE.

  • Member
  • 5155 posts

Posted 28 November 2017 - 12:43 PM

If you would actually read the linked post, you could actually reproduce the advice, and not just ram your head to a wall.
And you should perhaps go into far more detail in the above, of the changes you propose and we can see what to do about them. As my-former-selves post is pinned, while yours lies in the general forum, which will eventually disappear.

Yep, Jarno Mikkola. my Mega Mod FAQ. Use of the BWS, and how to use it(scroll down that post a bit). 
OK, desert dweller, welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand. Ouh, actually it was still snow then.. but anyways.


#7 subtledoctor

subtledoctor
  • Modder
  • 656 posts

Posted 10 December 2017 - 08:32 AM

This topic is intended for those who experience slowdown caused by scripts and not sure how to deal with it.
...
2) from refinements :

"BG2 Refinements offers new HLA tables for ALL classes and kits, which means this component may clash with other mods that modify HLA material. A new Kit, both player selectable and "invisible
(the player may not select the kit, which is typically used for an NPC or as a method to add a new set of abilities to a character as it levels up) may come with a NEW HLA table"


You can see that this code is combination of mage X class X kit X player. And the more kits you have the more code it adds to baldur.bcs .
I have cut 9418 lines for 148kb which is twice the Baldur's Gate 2 code.

Cut it. Look for kits with endings tF and tw in baldur.bcs and baldur25.bcs. And there is invisible creature following you around which adds those kits too. Called Li#Stri.

Before installation remove ~kit.tpa~ mention from ~refinements\lib\hla_thief.tpa~ ,also ~kit_ee.tpa~ from ~hlab.tpa~ and setup-refinements.tp2 .
This may break some HLAs

Simple solution - don't install Refinements.


Just to follow up on this for other readers:

Even if the premise of "more kits = more lag" is correct (I'm not sure it really is, but whatever), it's worth mentioning that you can install Refinements HLAs on a class-by-class basis in v4.

That means that, if you're worried about the Use Scrolls Engine and all those invisible kits, just don't install thief HLAs.  Install them from Rogue Rebalancing, or something, and install HLAs for all the other classes from Refinements. Thus, you can have great mod HLAs for every class, but no Use Scrolls and no invisible kits.


Edited by subtledoctor, 10 December 2017 - 09:37 PM.