JASS vs converted GUI

sithin

New Member
Reaction score
5
ok every1 is saying omgz jass is faster then gui less leaks n all that.
however what if lets say i make a spell, make sure its leakless then just convert it all to "custom text" i mean its in a form of JASS would that make it anymore faster/less lagy?
 

wraithseeker

Tired.
Reaction score
122
it is uselses, you either convert a non mui verison of a GUI trigger to jass and then use locals and such. No point making a GUI trigger MUI and convert it to JASS.
 

emilemil1

New Member
Reaction score
20
You can't use all features of JASS when using GUI, like locals. The GUI also uses predefined, and not always optimized, lines of JASS code.

Using GUI for a part of the trigger is often a good idea because it is faster. Then you would have to convert it and optimize it.

I am learning JASS atm and I am still using GUI for things like events before conversion. It is alot faster but can't do the fancy spells.

EDIT: Btw, GUI does not leak more than JASS if you know how to use some simple lines of JASS in a custom script.

And you are giving the example that you create a leakfree trigger and then convert it to JASS. It would not affect speed in any way since the GUI predefined codes are like puzzlepieces of JASS codes, with some pieces missing.

You can perhaps make a square out of many little triangles(GUI pieces), but it would be much easier and require less pieces to use a couple of little squares(JASS). The squares are however heavier because of their double size compared to the triangles and takes therefor longer to put out. But when the final big square is done, it is alot more stable(efficient) with tiny squares compared to triangles.

I hope that little metaphore does it :p
 

Flare

Stops copies me!
Reaction score
662
ok every1 is saying omgz jass is faster then gui less leaks n all that.
however what if lets say i make a spell, make sure its leakless then just convert it all to "custom text" i mean its in a form of JASS would that make it anymore faster/less lagy?
No, it won't have any effect whatsoever (other than making your script potentially unreadable to you). World Editor converts GUI codes into JASS anyway so simply converting to custom text without any modifications will not make the code any better or worse, performance wise
 

D.V.D

Make a wish
Reaction score
73
No, because its the exact same code. GUI is Jass. The reason why jass is faster is because we use natives not BJ's. For example: Instead of locations we use X/Y's because they better and quicker.
 

T.s.e

Wish I was old and a little sentimental
Reaction score
133
> The reason why jass is faster is because we use natives not BJ's.
According to who? Not all BJ's are the incarnates of evil.

>For example: Instead of locations we use X/Y's because they better and quicker.
Locations aren't BJ's. And sometimes, you can't avoid using locations, and please, instead of saying "better", atleast explain why.
 

uberfoop

~=Admiral Stukov=~
Reaction score
177
ok every1 is saying omgz jass is faster then gui less leaks n all that.
however what if lets say i make a spell, make sure its leakless then just convert it all to "custom text" i mean its in a form of JASS would that make it anymore faster/less lagy?

Warcraft 3 can only read triggers from map files in JASS form. The GUI is merely an interface used to help people who don't know JASS construct JASS code; when the map is saved, all of the GUI is converted to custom text as it gets put in the trigger component of the map file (maps are mpq archives, just a bunch of files stuck together under a single one). So converting to custom text and not doing anything with it won't do a thing.


The reason that JASSers can put out more efficient code is that the GUI system:
1) converts to code poorly
2) isn't as readily flexible as direct code.


1) The basic scary example of this is probably how the conversion system handles conditions. Create any trigger, give it a condition, and watch as the converter creates an enormous block of code for said condition:
JASS:
function Trig_fgdfxgh_Conditions takes nothing returns boolean
    if ( not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_STRUCTURE) == true ) ) then
        return false
    endif
    return true
endfunction

Which is no different from:
JASS:
function Trig_fgdfxgh_Conditions takes nothing returns boolean
return IsUnitType(GetTriggerUnit(), UNIT_TYPE_STRUCTURE) == true
endfunction


2) This can have several meanings. One, GUI is a pain to troubleshoot because you have to pound through all the froodlenutzkying layers. Two, some things just can't be done in GUI without incredibly epic effort compared to how they can be done with JASS. Operating storage systems in GUI? Do not want.

And there's always the direct advantage of seeing and understanding what exactly you're looking at. GUI doesn't offer you that.


As to the issue of BJ's, yeah, they really barely matter as long as they're safe, as arguably the efficiency drop of the map overall isn't that much. At the same time, more efficiency is better, and making two or three function calls when all you need is one is rather silly.
 

D.V.D

Make a wish
Reaction score
73
Im not saying all BJ's are bad. Locations are BJ's because they are made up of X/Y's. And most of the time, Jassers don't use locations at all. They use fuctions like these:
JASS:


Here's another example. This is how PolarProjectionBJ is made:

JASS:
function PolarProjectionBJ takes location source, real dist, real angle returns location
    local real x = GetLocationX(source) + dist * Cos(angle * bj_DEGTORAD)
    local real y = GetLocationY(source) + dist * Sin(angle * bj_DEGTORAD)
    return Location(x, y)
endfunction


Where is says GetLocationX/Y, I atleast normally put my X/Y. So here's another example:
JASS:

    local real x = GetUnitX(unit) + 500.00 * Cos(90.00 * bj_DEGTORAD)
    local real y = GetUnitY(unit) + 500.00 * Sin(90.00 * bj_DEGTORAD)


And when we use MoveUnitInstantly, its more like this:

JASS:

    local real x = GetUnitX(unit) + 500.00 * Cos(90.00 * bj_DEGTORAD)
    local real y = GetUnitY(unit) + 500.00 * Sin(90.00 * bj_DEGTORAD)
    call SetUnitPosition(unit,x,y)


Now your thinking, well thats just more complicated useless code. Why not just use the Locations? Because doing this will be faster and more efficient. When you take a native and make a function that does the exact same thing like the native, you slow down the speed the native is called. Hope this answerd your question. Now, Im not saying all BJ's are bad, just some shouldn't be used.

To figure out more about BJ's, you could go to Blizzard.j or use TESH from JassNewGenPack.
 

Romek

Super Moderator
Reaction score
963
Feel free to ignore DVD. He doesn't seem to know what he's talking about, and may just end up confusing you.

What hasn't really been touched upon is the fact that [v]Jass is much, much more flexible than GUI. As well as using natives instead of BJs, no retarded conditions, etc. There are many things you can do in Jass that you cannot in GUI: (Decent) Timers, FOG loops, dynamic triggers, and best of all; Functions. This is all Jass only.
Also, in vJass, you can use structs, interfaces, global blocks, encapsulation and more.

GUI is limited to the basics of basics, and even when only allowing the basic stuff, it still does so inefficiently.

Converting GUI will give you Jass code. But it'll be inefficient, and just as limited as GUI was. It doesn't make any difference, really.
 

sithin

New Member
Reaction score
5
ok how about this, cos ild rather spend like a month doing my map then a month learning jass then vjass
would it be hard just come back and convert to custom txt once iv fully learnt jass? or would i basicly have to spend weeks redoing every trigger into jass?
 

Romek

Super Moderator
Reaction score
963
Converted GUI is so horribly ugly to read, you'd just die trying.
As I always said, using GUI is a form of map protection.
Once a map is open, all the Converted-GUI-Jass will give someone a heart attack.

You'd most likely end up doing everything again.
I'd suggest learning at least the basics of Jass, and make sure you comment everything.
So once you get better, you'll find it much easier to fix and change, and the comments will certainly help.

When commenting, remember to write why you're doing something. Not what it is doing.

JASS:
// Bad:
call RemoveLocation(l) // removing the location

// Good:
call RemoveLocation(l) // preventing leaks
 

Viikuna

No Marlo no game.
Reaction score
265
GUI has no functions :(


And yea, it does lack removing stuff, which can make your map slow down pretty baddly.

When doing Jass, you never have to worry about leaks, because cleaning them is so natural ( when doing Jass ).

Converted GUI is just ugly looking Jass
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top