GOTY Script Tidy

Post » Tue May 17, 2011 9:23 am

It's up. http://planetelderscrolls.gamespy.com/View.php?view=Mods.Detail&id=8384
Comment stripping: keep at least valuable infos, you can nuke the joke comments

Some examples:
if ( MenuMode == 1 )	return	;don't run time in Menu Mode. Very bad.endif

if ( timer > 29 )	set start to 0	set timer to 0	;after 9 more seconds, the doors are back to their original position	;reset timer and startendifset timer to ( timer + GetSecondsPassed );above line increments the timer... should be last here outside if;statements;otherwise bad things can happen
Are these comments useful for someone that never opened MSFD? Probably yes. Are they useful for more experienced coders? probably not.
I think these comments could be stripped with no great problems in a script tidy work

Begin arethanMandasScript;can't be insane if you have LOREshort noLoreEnd
This comment I would keep: it tells about the special purpose of the script.
[EDIT]Is it <- Are they
User avatar
maria Dwyer
 
Posts: 3422
Joined: Sat Jan 27, 2007 11:24 am

Post » Tue May 17, 2011 2:16 am

I going too test and use the .esm version. I assume the ideally load order when using Morrowind Patch Project would be:
Morrowind.esmTribunal.esmBloodmoon.esmMorrowind Patch v1.6.4.esmGOTYScriptTidy.esm...Better Heads.esmBetter Heads Tribunal addon.esmBetter Heads Bloodmoon addon.esmTexture Fix 1.8.esmBook Rotate.esm

Should I avoid using Book Rotate when tesing this general script fix mod in my secondary game installation? I don't assume that that this mod will have any conclict with either Testure Fix or Better Heads.esm. Please correct my if I'm wrong.
User avatar
Jack
 
Posts: 3483
Joined: Sat Oct 20, 2007 8:08 am

Post » Tue May 17, 2011 2:40 am

My warnings.txt file:

Script variable "replacedDocs" not found for dialogue type Topic
Info "EMPTY"
Script variable "replacedDocs" not found for dialogue type Topic
Info "EMPTY"
Script variable "murderedAlvisTeri" not found for dialogue type Topic
Info "EMPTY"
Script variable "learnedWizardSpells" not found for dialogue type Topic
Info "EMPTY"
Script variable "learnedWizardSpells" not found for dialogue type Topic
Info "EMPTY"
Script variable "duelOndresNerano" not found for dialogue type Topic
Info "EMPTY"

Good work! I'm impatient for the next version. ;-)
User avatar
Joe Bonney
 
Posts: 3466
Joined: Tue Jul 17, 2007 12:00 pm

Post » Tue May 17, 2011 5:55 am

Stacet,
I would put GOTYST between Bloodmoon and the Morrowind Patch. As for Book Rotate, I made signifigant changes to only one of the scripts that the mods share, I believe, and that's 'fallingScript' which had too many 'endifs'. You should be o.k.

abot,
I like your approach and if I had more time and wasn't so lazy I might've done something like that.

I do find it funny, though, that even with proper indentation and comments, over 200 original scripts turned out wrong and stayed that way for 10 years.
Anyway, rather than turn this into a philosophical debate, I've gone ahead and started a 'minimal impact' version which changes only the worst syntax errors and leaves everything else intact. I'm about half way through. Give it a few days.

Runspect,
Funny, I had just finished toying with an amalgamated version of the Big 3 .esms (MW, TB, BM) which integrates GOTYST and came up with a similar Warnings file. I'll have to look into that. Thank you.
User avatar
Julie Ann
 
Posts: 3383
Joined: Thu Aug 23, 2007 5:17 am

Post » Mon May 16, 2011 10:57 pm

Better Hards.esm.

Excuse me while I find this typo really funny, haha =)

Great work Huskobar =) I'm unsure if it has helped but that a-long with mostly known mods and simple stuff my MW is as crash-free as it ever was.
User avatar
JaNnatul Naimah
 
Posts: 3455
Joined: Fri Jun 23, 2006 8:33 am

Post » Tue May 17, 2011 10:28 am

I do find it funny, though, that even with proper indentation and comments, over 200 original scripts turned out wrong and stayed that way for 10 years.
Agreed, probably this is due to a sort of "stand in awe of Bethesda" effect, mixed with "if they (seem to) work don't change them", and the fact that some things that seem wrong or at least incongruent (= equivalent to == in comparisons, some extra endifs that seems to be just happily skipped...) probably produce the same bytecode as the "correct" version.
There are probably Bethesda scripts that were not written by programmers, and scripts that may be written in a theoretically more efficient way ( I say theoretically because I an not so sure that would be a noticeable difference in game)
Take the signrotate and the float scripts for example: they are widely used by lights and other activators, and even in the Bloodmoon revision, they are still calling a "slow" getdistance function each frame and using an unneeded swingTime variable instead of a constant value. I'm using a personal version of signrotate on street lanterns, that replaces the variable with a constant, calls getdistance only every couple of seconds (using getsecondspassed and a slighty randomized time interval so not every instance repeats the slow getdistance call the same frame), and even replaces the light with activator at daytime.
With all this optimization, what is the huge FPS gain in Balmora? Probably less than 1 FPS.
Anyway, rather than turn this into a philosophical debate, I've gone ahead and started a 'minimal impact' version which changes only the worst syntax errors and leaves everything else intact.
Keep up the good work!
Personally, I would also love a version daring to optimize code like the signrotate script... just without all my beloved indentation stripped ;)
Here is a (maybe) interesting http://abot.silgrad.com/tmp/ab01speedtest.zip... what would be the 3rd script without sweet indentation?
User avatar
Eve(G)
 
Posts: 3546
Joined: Tue Oct 23, 2007 11:45 am

Post » Tue May 17, 2011 10:44 am

This plugin appears to break the Telvanni "Wizard Spells" quest: Aryon doesn't recognize the spells like he should. I unchecked the Tidy plugin and Aryon gave the correct response.
User avatar
no_excuse
 
Posts: 3380
Joined: Sun Jul 16, 2006 3:56 am

Post » Tue May 17, 2011 11:46 am

I've switched to using the .esm, and my mlox_user.txt file contains:
[Order]Bloodmoon.esmGOTYScriptTidy.esmMorrowind Patch *.esm

Now, I'll retest the Wizard Spells quest (I don't have a save game to it,so I'll have to do that the hard way).
User avatar
scorpion972
 
Posts: 3515
Joined: Fri Mar 16, 2007 11:20 am

Post » Tue May 17, 2011 12:31 am

Version 1.0 is now up http://planetelderscrolls.gamespy.com/View.php?view=Mods.Detail&id=8384.

It includes a minimal-impact version, MPP fixes, and dialogue corrections for the full-tidy build. Dialogue corrections should fix these quests:

House Hlaalu: Erroneous Documents
Imperial Legion: Saprius Entius
House Telvanni: Wizard Spells
House Redoran: Ondres Nerano's Slanders
House Redoran: Founder's Helm.

Substituting version 1.0 for the Beta in a savegame might help fix the above quests if they're broken. It might make you subject to doubling though.
User avatar
Dj Matty P
 
Posts: 3398
Joined: Sat Jun 09, 2007 12:31 am

Post » Tue May 17, 2011 5:38 am

Any benchmarks?

Plans for the future?

:drool:
User avatar
Maddy Paul
 
Posts: 3430
Joined: Wed Feb 14, 2007 4:20 pm

Post » Tue May 17, 2011 2:07 pm

Please don't drool all over my mod. :)

re: benchmark - Performance reports are ancecdotal at this point.

re: future plans - So long as this fix is error free, I consider it pretty much done. It addresses all the errors that I can currently identify. The one exception is the checking of Dialogue Results, but that will be a long time coming.

Any further work would constitute changes to the actual components of scripts (variables, objects, coding). That is beyond the scope of this mod; the few variables I did change were issue enough. I'd be happy if GOTYST could be used as a basis for a mod of coding enhancements though. I leave that in the hands of top-notch scripters (which I'm not).

My current focus regarding scripts is to apply tidying to the mods in Morrowind Amalgamated, my pet project. First stages are complete in things like Wizards Islands, The Underground, Silgrad Tower, Vampire Embrace, Vampiric Hunger, and numerous smaller mods. Things look promising for my second try at Galsiah's Character Development too. I'm playtesting this work right now and if it meets approval with the original authors, it might be released down the road.
User avatar
Kyra
 
Posts: 3365
Joined: Mon Jan 29, 2007 8:24 am

Post » Tue May 17, 2011 4:35 am

..just discovered a problem.

Now that GOTYST fixes the script ColonySeler and it works, the quest surrounding it is wonky. This is part of Bloodmoon to do with the old miner who picks a fight with you in the Raven Rock bar ("East Empire Company: Bar Brawl").

Temporary workaround: After getting the assignment from Falco (not tested if you side with Carnius, but I assume it works the same) and after getting the plea from his wife near the bar entrance, go into the bar then use the ~ key to open the console.

Type:
player->positioncell 4460 3960 15820 0 "Raven Rock, Bar"
then hit Enter and the ~ key again to close the console

You should be whisked way into the void far above the bar (you probably won't even be able to see the bar), but you should be near Seler. Let him do his thing, fighting you and working through the dialogue. You'll be in mid air, but you should be able to bring the fight to a conclusion. When done, go back to the console.

Type:
COC "Raven Rock, Bar"
hit Enter and ~

That will put you back in the bar and you can go back to talking to his wife and Falco.
User avatar
Gwen
 
Posts: 3367
Joined: Sun Apr 01, 2007 3:34 am

Post » Tue May 17, 2011 2:03 pm

Does the RA command bring that particular NPC back into correct position?
User avatar
Ashley Campos
 
Posts: 3415
Joined: Fri Sep 22, 2006 9:03 pm

Post » Tue May 17, 2011 4:27 am

I don't know. ..worth a try. I'm skeptical because the way the script is written, he seems to just pop up to those coordinates regardless. I tried entering proper coordinates using the console, he arrived, then as soon as I closed the console, zoom - up he went. I think changing the coordinates in the script or eliminating the line altogether is required.
User avatar
gandalf
 
Posts: 3400
Joined: Wed Feb 21, 2007 6:57 pm

Post » Tue May 17, 2011 12:48 pm

Does the RA command bring that particular NPC back into correct position?

Yes. I often have to use that because my NPCs (in a completely vanilla game) would rapidly and mysteriously relocate themselves far away from their starting position. Silt strider dudes would end up half-way stuck inside their platform, NPCs would mysteriously fall into a river (and swim around forever or drown), and other oddities. I think my game is cursed. D:
User avatar
Zach Hunter
 
Posts: 3444
Joined: Wed Aug 08, 2007 3:26 pm

Post » Tue May 17, 2011 1:04 am

Yes. I often have to use that because my NPCs (in a completely vanilla game) would rapidly and mysteriously relocate themselves far away from their starting position. Silt strider dudes would end up half-way stuck inside their platform, NPCs would mysteriously fall into a river (and swim around forever or drown), and other oddities. I think my game is cursed. D:

If you speed up the timescale to an extreme value (e.g. 3600), you can easily witness NPCs who are supposed to stay in place start to drift - the silt strider NPCs usually end up off their platforms. It looks like it's due to slight synchronization differences between the animation idles that over time (regardless of timescale speed) displace the NPC a fraction of an amount from its last position's origin.

Mods like Living Cities of Vvardenfell can automatically help prevent that for the NPCs that get relocated due to scheduling, effectively resetting their positions.
User avatar
JaNnatul Naimah
 
Posts: 3455
Joined: Fri Jun 23, 2006 8:33 am

Post » Tue May 17, 2011 6:14 am

I looked at the pictures of you work (before and after), and here are my conclusions from them only,

I think the scripts that you simply removed comments for as well as indentation should be removed,
Optimized languages get compiled into machine code, then run. I don't think that Morrowind code is THAT bad, so comments do not slow anything down.
Removing indentation harms readability while removing comments is just bad coding (You would get fired from any respectable company if you did not comment code)...
So, sorry, but this seems... redundant.

Now for the scripts that are actually modified,
I know that someone tried optimizing Oblivion scripts, and well, it helped with general performance. (And I am talking about a 2.4Ghz Core 2 Duo here)
If I remember: there were comparisons in various ways of doing the same thing to determine best method of writing optimized code and stuff like that.
You should continue this route.
User avatar
A Lo RIkIton'ton
 
Posts: 3404
Joined: Tue Aug 21, 2007 7:22 pm

Post » Tue May 17, 2011 6:55 am

Hmm... this looks like the sort of thing I'd like to add to my mod list once it gets out of beta testing and all of the issues with the MPP have been resolved.

Or, ideally, this should really just get added tot he next version of the MPP (which needs to hurry up and get released already).
User avatar
Kayla Bee
 
Posts: 3349
Joined: Fri Aug 24, 2007 5:34 pm

Post » Tue May 17, 2011 6:48 am

Lord Udedenkz,

The screenshots represent the FULL tidy version of the mod.
If you need the indentation and comments, use the minimal-impact version which is included in the v1.0 package.

I guess my general question on this matter is why does anyone need the comments or indentation at this point? Are you planning on rewriting the game? If it's for bugfixes, using a variation of the script, or a tutorial: a.) many bugfixes have already been dealt with in patches like the Morrowind Patch Project. b.) I'd advise that if you want to examine an original script, you'd work FROM an original script. Then it would be just a matter of adding any changes to this mod.

BTB,

In theory, v1.0 is compatible with MPP 1.6.4. Unfortunately, I'm discovering that, in the Full Tidy version, I might still have tripped up on The Matchmaker, a complex dialogue-driven quest - I'm not sure. I noticed when one version of this was loaded with MPP in the CS, the dialogue didn't appear as I expected. I agree that, ideally, "baking it in" to MPP would be desirable and would reduce such uncertainty.
User avatar
Chavala
 
Posts: 3355
Joined: Sun Jun 25, 2006 5:28 am

Post » Tue May 17, 2011 1:11 am

My warnings.txt file:

Script variable "replacedDocs" not found for dialogue type Topic
Info "EMPTY"
Script variable "replacedDocs" not found for dialogue type Topic
Info "EMPTY"
Script variable "murderedAlvisTeri" not found for dialogue type Topic
Info "EMPTY"
Script variable "learnedWizardSpells" not found for dialogue type Topic
Info "EMPTY"
Script variable "learnedWizardSpells" not found for dialogue type Topic
Info "EMPTY"
Script variable "duelOndresNerano" not found for dialogue type Topic
Info "EMPTY"

Good work! I'm impatient for the next version. ;-)

Have these issues been resolved?
User avatar
Dalley hussain
 
Posts: 3480
Joined: Sun Jun 18, 2006 2:45 am

Post » Tue May 17, 2011 10:23 am

Yes, these were addressed in v1.0 and only apply to the FULL tidy versions of the mod (I didn't touch these in the Minimal-Impact version).

Hopefully they work correctly now, but with the attempt to make it compatible with MPP I can't provide full assurances yet. I will undertake to do more testing.
User avatar
Leah
 
Posts: 3358
Joined: Wed Nov 01, 2006 3:11 pm

Post » Tue May 17, 2011 1:02 pm

Yes, these were addressed in v1.0 and only apply to the FULL tidy versions of the mod (I didn't touch these in the Minimal-Impact version).
Hopefully they work correctly now, but with the attempt to make it compatible with MPP I can't provide full assurances yet. I will undertake to do more testing.

A simple fix may well be to just not compress the names of those particular script variables.
User avatar
JERMAINE VIDAURRI
 
Posts: 3382
Joined: Tue Dec 04, 2007 9:06 am

Post » Tue May 17, 2011 12:47 pm

In theory, v1.0 is compatible with MPP 1.6.4. Unfortunately, I'm discovering that, in the Full Tidy version, I might still have tripped up on The Matchmaker, a complex dialogue-driven quest - I'm not sure. I noticed when one version of this was loaded with MPP in the CS, the dialogue didn't appear as I expected. I agree that, ideally, "baking it in" to MPP would be desirable and would reduce such uncertainty.


"Baking it in"... I like that.

But yes, I look forward to hearing more about this mod. I bestow upon it my official stamp of approval.
User avatar
sexy zara
 
Posts: 3268
Joined: Wed Nov 01, 2006 7:53 am

Post » Tue May 17, 2011 4:57 am

It's up at PES now. I'll be sure to try it out, when I finally get around to firing up the game again. Someone did this for Oblivion a while ago, and it seemed to make a huge difference. Hopefully the same will be true here. thanks :foodndrink:

I thought the Oblivion mod that did something similar like this was confirmed to be nothing more than a placebo effect with a FPS gain of <1. At least that's the last thing I heard...

Then again I get the idea that Oblivion isn't bogged down by its scripts as much as Morrowind is...
User avatar
Mandy Muir
 
Posts: 3307
Joined: Wed Jan 24, 2007 4:38 pm

Post » Tue May 17, 2011 9:51 am

I thought the Oblivion mod that did something similar like this was confirmed to be nothing more than a placebo effect with a FPS gain of <1. At least that's the last thing I heard...

You mean, because the scripts are all ultimately compiled?
User avatar
Tyler F
 
Posts: 3420
Joined: Mon Aug 27, 2007 8:07 pm

Next

Return to III - Morrowind