Jump to content

Reducing Slowdown


Guest Loz

Recommended Posts

Hi there,

As i noted before i am enjoying the improved ai. However, on my machine i am also experiencing a lot of lag in fights, and temporary freezing at the start of fights. This mainly seems to be a problem when encountering mages, but sometimes happens with other enemies too. I was wondering what the chances are of you somehow reducing this lag. If i understand correctly it is the size of the scripts that is the problem, and that this is caused by the script having to be large enough to cover all possible mages. Perhaps it would be possible to break this script into several different ones that cover a mage more precisely than generally. I should note that i do not experience this lag with, for example, the scripts used in ascension even though i percieve them to be of approximately the same intelligence(basically as good as you can get in the bg2 engine). As it stands i am anticipating that certain battles to come such as the yaga shura army will be unplayable for me. I don't know if this problem is even fixable, or if the workload is simply not worth it, but i thought i might aswell mention it. I am playing the game on a fairly new laptop and have vista installed if that makes a difference. Once again thanks for all the work you've put into improving the original game.

Link to comment

Also, i guess i should ask if there is anything i could do my end to help with the lag. Its a real pain and is stopping me taking full enjoyment of this mod :laugh:.

 

As a side point, would you consider doing an item tweak component for the cloak of mirroring similar to the shield of balduran, i.e. remove the thing from the game completely, or perhaps replace it with the currently unused cloak of balduran. To me the cloak of mirroring is the most overpowered item in the game, and the only one that i simply will not use. Other items i find to be a tad powerful(ravager +6, robe of vecna), but they have a redeeming fun factor and many enemies have similar effects to these items, but the cloak i find just makes the game worse.

 

Finally i have also noticed enemy mages sometimes cast power word: stun several times on the same target that it fails to affect. This may be because their current hp is too high, i once saw a mage cast it on an immune character 4 times in a row in an alacrity time stop session. Power word kill may suffer from this too, i don't know.

Link to comment
As a side point, would you consider doing an item tweak component for the cloak of mirroring similar to the shield of balduran

It was done in v6 :laugh: (ask David if you want to get it - since CamDawg gone for good, uploading was protracted)

About lags: you could try to defragment your hard drive, it can help a little. But lags are still biggest issue of this mod, that's for sure.

Link to comment
Also, i guess i should ask if there is anything i could do my end to help with the lag. Its a real pain and is stopping me taking full enjoyment of this mod :laugh: .
I think there's little to do about the lag...it's caused by the lengthness of the scripts, which is necessary to achieve the level of AI this mod offers.
As a side point, would you consider doing an item tweak component for the cloak of mirroring similar to the shield of balduran, i.e. remove the thing from the game completely, or perhaps replace it with the currently unused cloak of balduran.
I think Vecna is even more ridiculously overpowered, but surely Cloak of Mirroring is extremely cheesy. For the upcoming Item Revisions, I've not replaced it with the unused cloak but I've changed it so that it grants +25% magic resistance instead. Regarding Vecna, I would suggest toning it down to -2 casting speed instead of -4, it doesn't remove its appeal and you shouldn't have to feel guilty using it anymore.
Link to comment
Regarding Vecna, I would suggest toning it down to -2 casting speed instead of -4, it doesn't remove its appeal and you shouldn't have to feel guilty using it anymore.

Heh, i always did that myself in my games :laugh: (using NearInfinity)

Link to comment
Hi there,

As i noted before i am enjoying the improved ai. However, on my machine i am also experiencing a lot of lag in fights, and temporary freezing at the start of fights. This mainly seems to be a problem when encountering mages, but sometimes happens with other enemies too. I was wondering what the chances are of you somehow reducing this lag. If i understand correctly it is the size of the scripts that is the problem,

The size of the scripts certainly causes the temporary freeze at the start of a battle, which seems to occur even on fast machines and which I get myself. I'm less sure about general lagging, since it seems pretty variable who gets it - some people get it on fast machines, some people don't get it on slow machines, and I've never seen it on any machine.

 

and that this is caused by the script having to be large enough to cover all possible mages.

Only in part. SCSII mage scripts are usually c. 16,000 lines, and at a rough guess the average high-level mage uses 8,000-10,000 lines of that (the rest is code that doesn't apply to him). But original game scripts are usually 50-200 lines long, and (say) Ascension scripts are usually 500-1000 lines, so there's still a big gap. Ultimately mages just have a lot of options and the BG2 script language is pretty script-inefficient.

 

I should note that i do not experience this lag with, for example, the scripts used in ascension even though i percieve them to be of approximately the same intelligence(basically as good as you can get in the bg2 engine).

 

I don't want to comment on how SCS II compares to Ascension in-game, people should make their own minds up. But there's a lot more going on under the hood in an SCS II script, mostly in terms of fine-tuned targetting.

 

As it stands i am anticipating that certain battles to come such as the yaga shura army will be unplayable for me. I don't know if this problem is even fixable, or if the workload is simply not worth it.

 

The workload involved in splitting scripts up so different mages have different scripts is prohibitive, sorry - I just don't have time, especially as for the reasons above I'm not convinced it would make all that much difference.

Link to comment
As a side point, would you consider doing an item tweak component for the cloak of mirroring similar to the shield of balduran, i.e. remove the thing from the game completely, or perhaps replace it with the currently unused cloak of balduran. To me the cloak of mirroring is the most overpowered item in the game, and the only one that i simply will not use. Other items i find to be a tad powerful(ravager +6, robe of vecna), but they have a redeeming fun factor and many enemies have similar effects to these items, but the cloak i find just makes the game worse.

I move it into ToB in v6, though I don't destroy it and don't plan to. There are mods out there that remove or nerf it. Or, if you're feeling adventurous, just add this

BEGIN ~Replace Cloak of Mirroring with Cloak of Balduran~

COPY_EXISTING ~clck05.itm~ ~override/clck26.itm~

 

to the end of the .tp2 file of any mod you like, and voila! your own Cloak-Swapping component.

 

Finally i have also noticed enemy mages sometimes cast power word: stun several times on the same target that it fails to affect. This may be because their current hp is too high, i once saw a mage cast it on an immune character 4 times in a row in an alacrity time stop session. Power word kill may suffer from this too, i don't know.

Yeah, this is me playing nice - mages try to guess if someone's going to be affected, but they don't always get it right. Possibly I'd better make them more psychic.

 

 

This is the sort of thing that bedevils any attempt to make spellcasters less than omniscient about the party's defences and abilities - occasionally it leads to them doing something numbingly stupid. It's also the sort of thing that makes SCS II scripts so damn long!

Link to comment

In my ideal AI world, mistakes happen.

 

Applying scientificly the right countermeasure to anything would make the AI (for me) even worse than the dumb original one.

 

I really find disturbing to seek perfection in the detecable spells/effects routine.

 

An enemy has the right to be wrong or make mistakes. It makes it for more interesting and varied encounters, for one thing. But ultmately, it makes it for much more realistic challenges.

 

DavidW and I (and others) have already discussed this: if it was not for coding difficulties, an enemy mage should never be inibited from casting first his usual spells against player that are protected against, unless some feedback is given to unveil the nature of the protection.

 

After the first unfruitable attack, then the AI should switch to another choice of spell.

 

I am no modder but unfortunately it seems that this can't be coded despite being certainly the most desirable way to tweak the AI.

 

I repeat: the biggest mistake would be to turn enemies into robomachines that acquire all datas about the targeted enemy, elaborate it with no margin of error, and reply with the best possible countermeasure against it.

 

A perfected AI is a flawed AI in games. At least that's my thought.

Link to comment
An enemy has the right to be wrong or make mistakes. It makes it for more interesting and varied encounters, for one thing. But ultmately, it makes it for much more realistic challenges.
Hear, hear!

 

Hey, I'm no tactician. I can't get through a pack of kobolds without some really hideous cheese. But I admire any gaming concept that makes things more like real life, and in real life, people go for the "old standbys." They'll bufff when it might not help, and they'll cast that second, or third, or fourth spell, even if the first several didn't have much luck. But that's because they aren't metagaming.

 

So yay for realistic behavior!

Link to comment

Indeed. I also prefer realistic behaviour from AIs over a perfect ability to know and counter every possible defence you might put up.

 

Fair enough if you cast the spell right in front of them, but if you wander up with a Spellshield pulsing merrily away, how are they to know? You certainly shouldn't know if they have one up before you arrive (though sadly, we do).

Link to comment
Indeed. I also prefer realistic behaviour from AIs over a perfect ability to know and counter every possible defence you might put up.

 

Fair enough if you cast the spell right in front of them, but if you wander up with a Spellshield pulsing merrily away, how are they to know? You certainly shouldn't know if they have one up before you arrive (though sadly, we do).

 

I think there are two issues to separate out here: (1) the information available to enemy AI; (2) the intelligence shown by enemy AI.

 

(1) is a little complex. Quite a lot of spells actually have a visible effect, so of course that information should be available. Others fairly clearly shouldn't: the enemy fighter wearing a helm of charm protection, say. Others are borderline: the computer helpfully tells you what spells are cast (including, usually, by enemy pre-buffs), so if you're playing the realism game, presumably that means there are little visual cues.

 

Added to the problem is the fact that it's very hard - without a prohibitive processing cost - to allow for the fact that enemies can learn this information in-game. Take Jaheira's harper amulet. It doesn't come with a visual cue, so it's unrealistic that enemies wouldn't cast Magic Missile at her. But once she's been uselessly hit by a MM, it's obvious that she's immune, so no sane enemy will cast a second one at her.

 

... now, try coding that. I can just about think of a way to do it, but it would take about four or five times as long as code that just detected the amulet and didn't attack in the first place. That's not realistic in most scripts: SCSII mage scripts are 18,000 lines long and computers can more-or-less cope, but 80,000 is out of the question.

 

So, what to do? Either (a) allow creatures to know unrealistically much, or (b) allow them to know unrealistically little. I'd argue that (b) produces a lot more flagrantly immersion-breaking behaviour.

 

 

(2) really isn't worth worrying about - certainly there's no point building lack of intelligence into the AI. SCS II enemies - and IA enemies, and Tactics and Ascension and Improved Battles enemies, and basically any enemies in any computer game ever - are so much stupider than you that it isn't true. There's no need to insert extra stupidity by hand.

Link to comment
Take Jaheira's harper amulet. It doesn't come with a visual cue, so it's unrealistic that enemies wouldn't cast Magic Missile at her. But once she's been uselessly hit by a MM, it's obvious that she's immune, so no sane enemy will cast a second one at her.

 

... now, try coding that. I can just about think of a way to do it, but it would take about four or five times as long as code that just detected the amulet and didn't attack in the first place.

Would it work to have a "first block" where you don't check for the amulet, and then a second one (applied to every other magic missile fired from then on) where the mage always detect the amulet? :( I know SCS has multiple blocks for every action to optimize targeting, and doubling the script for a spell already means a lot...but perhaps it wouldn't require a code 4 or 5 times longer. I'm not an expert sorry, just trying to help.

 

Anyway, though I don't like vampires that never try to charm a warrior because they detect the helm of charm protection, I would surely like even less vampires that try to charm him endless times because they can't detect the helm. In short, I agree with DavidW on everything. :D

 

P.S Furthmore extending the already very long scripts of SCS II would also mean to augment the slowdown problem many are suffering.

Link to comment

Yes, DavidW.

 

Your explanation is crystal clear and makes very much sense. I was in fact just speaking of the realm of possibilities and what would make the AI most appealing (at least in my opinion). It is still nice to know though that it's not a technical impossibility to tweak the informations the AI extracts in order to make it more realistic. Who knows? Maybe in the future with more powerful computers...

 

About visual spell effects: you are right when you say that for the most both players and SCS AI unrealistically get to understand what kind of protections the others have. Conclusion: unrealistic but at least fair (although I still see a small advantage for SCS AI since the party might buffer away from the enemy which should have not then had any visual feedback/spellcraft understanding).

 

But things are much different if we shift the problem to detectable effects. Protective items/class immunities on enemies let us players work realistically as we players don't know (without metagaming, of course) that they are there and we attack according to our usual "routine". Instead the enemies have un unfair advantage. And this does not only apply to items but also to a series of innate protections coming, example, from specific kits. At this point I cannot help but feel that the efficacy and value of such protections becomes at least partially frustrated by not making the AI do mistakes about it. We have here then a situation (I repeat: I exclude metagaming which should not be considered as an evaluation parameter) that is unfair (towards the player) and unrealistic (to benefit the enemy's AI).

 

Today there is maybe nothing that can be done about it because of CPU processing limitations but we can at least know that we are still speaking of feasible coding.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...