wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Warcraft III Modding > Developer's Corner > Warcraft Editing Tools
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 10-06-2009, 09:24 PM   #316
Storyyeller
User
 
Join Date: Jun 2009
Posts: 46

Storyyeller has little to show at this moment (0)

Default

Is there anyway to get the Optimizer to recognize and get rid of duplicate functions?

GUI generated triggers often lead to dozens of identical functions littering the code, and yet they remain, even after optimization.

For example, stuff like this
Collapse JASS:
function ya takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='h04U')
endfunction
// other stuff omitted
function Za takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='h04U')
endfunction

Also, surely stuff like this can go as well?
Collapse JASS:
function en takes nothing returns boolean
return(vn())
endfunction

All of these examples were taken from a recent map that was optimized with Vexorian's Optimizer.


P.S. I don't know much about Jass syntax, so this may be a dumb question, but are the parenthesis around the return statements necessary?
Wouldn't
return x
be 1 character shorter then
return(x)


Sorry if I am nitpicking or anything. It's just that you have such a great and useful tool, and I thought I could help make it better by pointing out ways that scripts could be optimized even better. If this is the wrong place for suggestions, please tell me where I should post this.

Last edited by Storyyeller : 10-06-2009 at 09:38 PM.
Storyyeller is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 10-13-2009, 01:14 AM   #317
NovaBomb
User
 
Join Date: Feb 2004
Posts: 24

NovaBomb has a little shameless behaviour in the past (-4)

Default

I've encountered an issue where people playing my optimized map encounter heavy "lag" (which, from their description, is actually jerkiness and stuttering in the gameplay).

The same people can play the map fine when I use an old program called Map Protect by CBWhiz.

So something is getting messed up in the optimization. Before I send the map to Vexorian, do people know of any common causes of this kind of issue?

Some map details:

1. It's created in UMSWE 3.6, WC3 1.06.
2. I've turned any custom UMSWE triggers into custom text. The rest of the map uses GUI triggers.
3. I turned on all the features in wc3optimizer (using "Check All"). All Tweaks were left off.
3.a. I also tried versions where I left the default-off greyed-out features ("Optimize String Useage" and "Remove Editor Suffixes") turned off. I also turned off "BJ Optimize" in Tweaks. Still, people are "lagging".

Last edited by NovaBomb : 10-13-2009 at 03:09 AM.
NovaBomb is offline   Reply With Quote
Old 10-13-2009, 06:34 AM   #318
akolyt0r
In Flames
 
akolyt0r's Avatar
 
Join Date: Jan 2006
Posts: 1,154

Submissions (3)

akolyt0r has a spectacular aura about (120)

Default

Do those people have that lag aswell when they play an unoptimized version of the map ?

(btw: BJ optimize is one of the most important tweaks for GUI-made maps...)
__________________
akolyt0r is offline   Reply With Quote
Old 10-13-2009, 08:43 AM   #319
Anachron
User
 
Anachron's Avatar
 
Join Date: Mar 2009
Posts: 1,079

Anachron will become famous soon enough (51)Anachron will become famous soon enough (51)

Default

Well, I just hate this sound thing, because it increased the size of my 600kb map to an 1600kb map after compressing, only because I used 400 of it for sound files. Thats really much,...
__________________
CustomInventory [Discussion - Download] - Got Directors Cut!
CustomMissle [Discussion - [Download (not yet)] - In development!
Other systems [Spawn System] [Move System] [CustomBar] [SpellBar]
Anachron is offline   Reply With Quote
Old 10-13-2009, 01:04 PM   #320
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


Technical Director
 
Join Date: Apr 2003
Posts: 14,898

Submissions (37)

Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)

Hero Contest #3 - 2nd Place

Default

I hate it too.

Actually, if you want me to try fixing it, what would be really helpful are maps with sound files that get so much bigger.


Storyyeller: You should use jasshelper even when you just use GUI. It is better at inlining functions than the optimizer, your example would go away.

I am seriously considering the idea of making a Jass (just Jass) compiler that would do serious optimizations . I would make it a unit for jasshelper and also use it in the optimizer.
__________________
Zoom (requires log in)Wc3 map optimizer 5.0
Someone should fix .wav sound in this thing.
Zoom (requires log in)JassHelper 0.A.2.A
Turns your simple code into something that is complicated enough to work.
Faster != more useful
Vexorian is offline   Reply With Quote
Old 10-13-2009, 01:52 PM   #321
NovaBomb
User
 
Join Date: Feb 2004
Posts: 24

NovaBomb has a little shameless behaviour in the past (-4)

Default

Quote:
Originally Posted by akolyt0r
Do those people have that lag aswell when they play an unoptimized version of the map ?

(btw: BJ optimize is one of the most important tweaks for GUI-made maps...)

I believe Map Protect does no optimization... it is very old school map protection, removing the list file, .wtg, and a couple tricks to trip people up. So I could be wrong, but I believe the answer is "No, people don't lag if the map is unoptimized." (But I have never had people test the map with zero protection/optimization.)

And re: BJ optimize, to be clear, I tried both with and without, and the map lagged in both cases.
NovaBomb is offline   Reply With Quote
Old 10-13-2009, 01:58 PM   #322
Anachron
User
 
Anachron's Avatar
 
Join Date: Mar 2009
Posts: 1,079

Anachron will become famous soon enough (51)Anachron will become famous soon enough (51)

Default

Vex, do you know how DotA is encrypted? Its something with the listfile + slk files only + encrypted and compressed wc3script.j, ... May I ask if you are able to do same?
__________________
CustomInventory [Discussion - Download] - Got Directors Cut!
CustomMissle [Discussion - [Download (not yet)] - In development!
Other systems [Spawn System] [Move System] [CustomBar] [SpellBar]
Anachron is offline   Reply With Quote
Old 10-13-2009, 01:58 PM   #323
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


Technical Director
 
Join Date: Apr 2003
Posts: 14,898

Submissions (37)

Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)

Hero Contest #3 - 2nd Place

Default

Quote:
So I could be wrong, but I believe the answer is
Test it. Don't believe.
__________________
Zoom (requires log in)Wc3 map optimizer 5.0
Someone should fix .wav sound in this thing.
Zoom (requires log in)JassHelper 0.A.2.A
Turns your simple code into something that is complicated enough to work.
Faster != more useful
Vexorian is offline   Reply With Quote
Old 10-13-2009, 01:59 PM   #324
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


Technical Director
 
Join Date: Apr 2003
Posts: 14,898

Submissions (37)

Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)

Hero Contest #3 - 2nd Place

Default

Quote:
Originally Posted by Anachron
Vex, do you know how DotA is encrypted? Its something with the listfile + slk files only + encrypted and compressed wc3script.j, ... May I ask if you are able to do same?
Is it worth it though? I think using same 'protection' as DOTA, guarantees you'll be cracked.
__________________
Zoom (requires log in)Wc3 map optimizer 5.0
Someone should fix .wav sound in this thing.
Zoom (requires log in)JassHelper 0.A.2.A
Turns your simple code into something that is complicated enough to work.
Faster != more useful
Vexorian is offline   Reply With Quote
Old 10-13-2009, 02:32 PM   #325
Anachron
User
 
Anachron's Avatar
 
Join Date: Mar 2009
Posts: 1,079

Anachron will become famous soon enough (51)Anachron will become famous soon enough (51)

Default

Quote:
Originally Posted by Vexorian
Is it worth it though? I think using same 'protection' as DOTA, guarantees you'll be cracked.
Currently your protection is less space-saving and less protective as DotAs, they managed to bring everything back to tables for DatA and thats really good.

Your protection is far more easy breakable at the moment, its ofcourse only a Map Optimizer, but I guess its optimizing when you pack stuff into .slk and clean even more stuff aswell.
__________________
CustomInventory [Discussion - Download] - Got Directors Cut!
CustomMissle [Discussion - [Download (not yet)] - In development!
Other systems [Spawn System] [Move System] [CustomBar] [SpellBar]
Anachron is offline   Reply With Quote
Old 10-13-2009, 03:02 PM   #326
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


Technical Director
 
Join Date: Apr 2003
Posts: 14,898

Submissions (37)

Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)

Hero Contest #3 - 2nd Place

Default

Quote:
Currently your protection is less space-saving
I really , really doubt it, I guess you don't have the original dota to prove this assertion.

If DOTA is using some special form of protection (which I doubt it considering that you just mentioned something that is doable by just using the widgetizer before the optimizer), it is already cracked. I mean, seriously.

Now, it could be that it is just that they are 'signed' so it is impossible to make a DOTA clone without migrating return bug completely, but that's an artificial DoTa-only thing that's aided by blizz.

Quote:
Your protection is far more easy breakable at the moment, its ofcourse only a Map Optimizer, but I guess its optimizing when you pack stuff into .slk and clean even more stuff aswell.
err, is there a reason you won't just use the widgetizer before using the optimizer?

Edit: hehe, I see, some maps out there use some new mpq encryption thingy, it is already cracked though, but I'll try to do some reverse engineer and try to make it public...

Edit: Ah, it is this program:
http://www.wc3c.net/showthread.php?t=101586

At first I thought the dep guys would be able to break it right away, but It seems I overestimated them. Instead, someone cracked it but instead of making a free tool to break it, he made one that requires money... So if you want to use this encryption, use both the optimizer AND also the ultimate slk optimizer, it seems that's what DOTA is doing.
__________________
Zoom (requires log in)Wc3 map optimizer 5.0
Someone should fix .wav sound in this thing.
Zoom (requires log in)JassHelper 0.A.2.A
Turns your simple code into something that is complicated enough to work.
Faster != more useful
Vexorian is offline   Reply With Quote
Old 10-13-2009, 05:58 PM   #327
Dr.Willy
User
 
Join Date: Nov 2003
Posts: 37

Dr.Willy has little to show at this moment (4)

Default

Quote:
Originally Posted by Vexorian
I am seriously considering the idea of making a Jass (just Jass) compiler that would do serious optimizations . I would make it a unit for jasshelper and also use it in the optimizer.
Why make it a standalone tool, that reads from stdin and writes to stdout?
That'd make it very easy to use with any other tools.

(Edit: I obviously like the idea)
__________________
7-Zip | OpenOffice | Jabber | MLDonkey | Mumble
Quote:
<Aoi-chan> everyone's first vi session.
^C^C^X^X^X^XquitqQ!qdammit[esc]qwertyuiopasdfghjkl;:xwhat

Last edited by Dr.Willy : 10-13-2009 at 06:00 PM.
Dr.Willy is offline   Reply With Quote
Old 10-13-2009, 06:43 PM   #328
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


Technical Director
 
Join Date: Apr 2003
Posts: 14,898

Submissions (37)

Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)

Hero Contest #3 - 2nd Place

Default

It could easily be an optimizer unit, and a jasshelper unit.

If it is a jasshelper unit, it will be easy to call it only it from command line.
__________________
Zoom (requires log in)Wc3 map optimizer 5.0
Someone should fix .wav sound in this thing.
Zoom (requires log in)JassHelper 0.A.2.A
Turns your simple code into something that is complicated enough to work.
Faster != more useful
Vexorian is offline   Reply With Quote
Old 10-13-2009, 07:18 PM   #329
NovaBomb
User
 
Join Date: Feb 2004
Posts: 24

NovaBomb has a little shameless behaviour in the past (-4)

Default

Quote:
Originally Posted by Vexorian
Test it. Don't believe.

You're right, of course! But it was a very educated assumption. (By the way, I think you mean "Don't assume," aka "Test your assumptions.")

Anyway, after testing with an unprotected version, the lag went away. What I found is:

- Unprotected: no lag.
- Map Protect by CBWhiz: no lag. (very old prog, don't necessarily recommend using)
- wc3optimizer: lag lag lag.

Then I realized I've not been using all the tools at my disposal... like basic Windows performance monitoring. I checked my processes on a number of tests, and without fail, the wc3optimizer version runs at around 50% cpu. The other versions run at around 0-2%.

So I'm going to keep testing by disabling/enabling various options with Vex's program. I'll let you know what I find. But if anyone has any bright ideas, please let me know.

Last edited by NovaBomb : 10-13-2009 at 07:20 PM.
NovaBomb is offline   Reply With Quote
Old 10-13-2009, 08:00 PM   #330
NovaBomb
User
 
Join Date: Feb 2004
Posts: 24

NovaBomb has a little shameless behaviour in the past (-4)

Default

I believe I've discovered the problem. It was the last place I would think to check.

If I check everything on, leave all Tweaks off, and then UNCHECK the "Clean SLKs" option, the map runs fine, in the 0-2% CPU range.

So... perhaps something about the cleaned SLKs was causing lag issues (while still allowing the game to run). Maybe because the map is edited in WC3 1.06? Or because it uses an AbilityData.slk based off WC3 1.18? Or a combination?

Hopefully this is a useful troubleshooting step to others who run into similar problems.

Last edited by NovaBomb : 10-13-2009 at 08:01 PM.
NovaBomb is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 08:50 AM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2019, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services