Stop using handle vars

Status
Not open for further replies.

Sim

Forum Administrator
Staff member
Reaction score
534
if the person you are giving code to is so lazy that they can't download a program that doubles the power of the programming language they are using, why is it even important to give them code?

Doubles power? Maybe it increases efficiency (and only a bit), but anything useful you can do with structs I can do with Handle Vars. So forget power here.

they are just going to screw around and make subpar maps because of that lame mentality. leave them in the dust or force them to adapt, but don't cater to their mentality, it's a horrible idea.

These are powerful words, are you sure they apply? :p

Don't worry, you couldn't tell the difference between an Handle Vars and a struct map unless you could open it. As people protect their maps, forget it.

You're crediting way too much importance to just a slight difference. Realism, realism... People who edit maps often do it to learn. I'm pretty sure they aren't at the "Handle Vars vs structs" step yet.

And who's gonna look at your map if it's protected anyways? Which leads us to:

The difference between Handle Vars and structs exists, but is so minor that unless you open somebody's map, or make tests yourself, you won't notice a difference.

--> Now, yes it is worth it to learn how to use structs. The more knowledge, the better!

P.S.

> I believe that the Handle Vars is best to use still. When people go to take code that you have given to the public, they just have to copy it. They don't need to download anything else to make it all work.

True my friend. Last time I opened a spell map to review it I couldn't because I needed WEU to open it. Now, did it incite me to review it? Not really. And don't call me lazy or anything, I don't want to download WEU at this time, period. Same applies here when a mapmaker opens a spell/normal map with structs in it and he doesn't have the needed programs. Maybe he will want to learn later, but what if he doesn't even understand the code yet?
 

Prometheus

Everything is mutable; nothing is sacred
Reaction score
589
Okay, this had got me really confuesed.
The WHOLE reason JASS > GUI is to NOT use globals...
 

substance

New Member
Reaction score
34
Regardless of all that, dax, I think the bottom line is:

Why would anyone use a method of doing something when a better, faster, and more efficient method existed?
 

grim001

New Member
Reaction score
10
The Jass 101 Classroom was dead the last time i checked. I'll try looking at the readme like SFilip said (I have no jass experience)... Since wc3campaigns is down, what good vJASS tutorials do you recommend? Also, should i try to learn JASS first or jump straight to vJASS? Taking into account i have extremely minimal programming experience.

That's like saying "should I play a game or should I play its expansion pack first"
You need to learn JASS before you can do anything with vJASS, so do that first.

Doubles power? Maybe it increases efficiency (and only a bit), but anything useful you can do with structs I can do with Handle Vars. So forget power here.
You probably don't know most of the uses for vJASS if you think of it that way.

Don't worry, you couldn't tell the difference between an Handle Vars and a struct map unless you could open it. As people protect their maps, forget it.
I could tell with a good degree of accuracy...
1.) If the map has a good design and is coded well (and was made recently) there's a high probability it uses vJASS, since a good coder would want to take advantage of its features, since there is no reason not to aside from laziness, which is not a trait that good programmers generally have.
2.) If the map lags then there's a high probability it's using handle vars on periodic skills.
3.) If the map glitches out from handle stack corruption you know it's using I2H-based systems.
4.) If the map may be lacking cool features which the mapmaker intended to add but found to be impractical without the features of vJASS.
5.) It would still be easy to tell whether it uses vJASS or not looking at the obsfuscated code extracted from the MPQ

I see no reason to continue this dialogue, you are just polluting this thread. You can go start a "using vJASS is not important so don't bother learning it unless you're bored" thread.

Okay, this had got me really confuesed.
The WHOLE reason JASS > GUI is to NOT use globals...
I think this is something you should really unlearn that comes from the idea that global vars result in non-multi-instancability (which isn't true if you use arrays and a key assigned to an instance of an ability). The main problem with globals is that they made it hard to copy in spells and systems, but now you can copy and paste them directly in, and there are no naming conflicts because of scopes.
 

Pyrogasm

There are some who would use any excuse to ban me.
Reaction score
134
grim001 said:
3.) If the map glitches out from handle stack corruption you know it's using I2H-based systems.
Not always true. Rising_Dusk's Advent of the Zenith currently suffers huge bugs that are derived from handle stack corruption; ask him about it. And I'm more than willing to bet money that he coded the newer versions in vJASS.

______

The other problem is that of system compatibility; I'd use vJASS if someone had cracked the OS X World Editor (Vexorian didn't even know how to do it). But then again, I'm sure there isn't a great majority of the population that fits this specific scenario.


I would say this: If you can/want to/feel the need to use vJASS and structs, go ahead. If you don't want to, at least use something that works well; KaTTaNa's system is outdated, and CSCache does a much better job of it.
 

grim001

New Member
Reaction score
10
Advent of the Zenith uses I2H last time I checked, and Rising_Dusk said he didn't want to recode the entire thing last time I checked. I have not heard any theories of handle stack corruption that occur without the use of I2H.
 
T

thedude

Guest
Off Topic

Are you going to release your engine anytime soon?
 

uberfoop

~=Admiral Stukov=~
Reaction score
177
Meh. There's some small projects where it's simply more practical to use handle vars...Even if you ARE using the NGP WE for the easy global declaration and whatnot. Simply put, handle vars are less of a pain to use, and if your map requires a small enough amount of processing power that only a person on an ancient ms-dos machine from the old days when we had 100-gun wooden battleships, don't fuss over it.


On the other hand, if you have a heavy-processing map that IS succeptable to lag, don't be an idiot.

I think that sums it up. Sorry if the first part offends someone's vJass crusade, but it seriously pisses me off when people bash easier-to-use systems even when they're being used in a way that works perfectly fine and makes it take less time to get stuff done. It's just like the overly-hardcore atheists that 'religiously' (zomg lame word usage maybe?) try to beat down religion as if it somehow offended their faith in some way, therefore contradicting their cause of making things better and easier.


If the map is heavy on the old processors, do everything you can to help it run smoother.
If not, PLEASE don't complain unless people are having troubles with handle system bugs, which they almost always don't.


Anyhow, the current aos map i'm making will use handle vars throughout simply because that's what I was using when I started it, and I like consistancy, even if it somewhat irrational.




Anyway, structs are useful to learn. And only take like 30 minutes to get at least somewhat comfortable with them. When making big maps that will have a lot of objects and whatnot, it's best to take all possible precautions against lags.
 

Steel

Software Engineer
Reaction score
109
Hey you know what? vJASS isn't anything fancy. All it does is creates a huge number of global variables for you. Look at your .j file after the program writes it for you.
 

grim001

New Member
Reaction score
10
OK Steel & uberfoop, your "opinions" are factually inaccurate, but willful ignorance isn't solved just by repeating things over and over. Just leave this thread to people who are interested in learning.
 

Steel

Software Engineer
Reaction score
109
OK Steel & uberfoop, your "opinions" are factually inaccurate, but willful ignorance isn't solved just by repeating things over and over. Just leave this thread to people who are interested in learning.

Incorrect? How else do you think vJASS makes the struct coding work? Magic?
 

uberfoop

~=Admiral Stukov=~
Reaction score
177
OK Steel & uberfoop, your "opinions" are factually inaccurate, but willful ignorance isn't solved just by repeating things over and over. Just leave this thread to people who are interested in learning.
I haven't EVER experience any problems with the Kattana system, except for the fact that it's slower than structs.

If I know exactly how, from a JASS perspective anyway (I'm not TOTALLY sure about all the mechanics behind the return bug, other then that it returns some type of unusual data about one type when you return it as another, eg handles sending back their integer pointer), how both gamecache and struct systems function, and I've used both of them, I'm not quite understanding in how my 'opinion' can be 'factually innacurate'.

All structs are are a bunch of globals with a function to find unused index's. It's not exactly hard to understand how it functions nor why this is faster than gamecache.

Anyhow, my opinion just says that it can be quicker to write in gamecache than in structs, and, from my experiences, that's how it is. You have to type out struct blocks, which is more or less anoying.



My point is simply that you need to stop acting like obsolete systems = bad map. ToB N lasted an insane amount of time and, at it's height, was considered to be the best or one of the best maps ever, and still is considered the best by some. Does it use structs? No. Will version O use structs? Probably, but that won't fix potential lag THAT much.

My point is simply that which system you use has a low enough effect that you shouldn't make a big deal out of it and act like your overall e-skills are better than other peoples simply because you use vJass systems; code efficiency is 99% formality anyway (argue if you want but it's true, and has been proven by plenty of tests that the difference is almost completely negligible), except when talking about object leaks, which really CAN get hellish. If someone simply chooses not to use structs, don't flame them for it. The difference between structs and gamecache is like 2 frames throughout the game anyway. The REAL big causes of processor pwn come from graphics, not unformatted text.




I'm not saying don't use structs. Use structs if you want, because they technically ARE more efficient. But understand that the amount of energy spent just posting this could cause more impact on a large turkey slowly cooking in the oven than the difference in coding will have on maps.
 

Andrewgosu

The Silent Pandaren Helper
Reaction score
716
This is going to turn out like those GUI vs. JASS threads, only this time it's JASS vs vJASS. Both systems (handle vars vs. structs) have cons and pros, it's up to the JASSer, which one he/she wants to use/prefers.

I suggest to lock this thread before it gets overhand. JASSers, we're a brotherhood, stop arguing with each other and save some energy to fight with GUI'ers (not saying GUI is bad [especially for a beginner], JASS is just better).
 

Jazradel

Helping people do more by doing less.
Reaction score
102
Can we please seperate the concept of vJass and struts? vJass is an enourmously powerful compiler for Jass, structs are an concept from OOP thats enabled in Jass through use of vJass and global arrays.

If you don't understand how return bug work then you don't really understand handle systems and why they're so flawed. Warcraft III stores the id of each object (it's handle) in a big list. The return bug converts what you see (unit, region, etc (which are just struts internal to warcraft III)) to it's internal id. Handle stack corruption occurs when that list of id's get reordered. Handle vars are flawed because that list is so fragile and is damaged by a number of things.

My point is simply that which system you use has a low enough effect that you shouldn't make a big deal out of it
That isn't true. Compare DotA:Allstars 5.84b, 6.0 and the latest one. You will notice a huge difference in the coding styles and performance.

With a simple map and a decent computer you probably won't notice any change, but if you get anything with a lot happening a once like DotA or Pudge Wars, or any other nice map then you will definitely see a change in performance.

The real reason to use structs is simply because it looks nicer and is easier to code it.
 

SFilip

Gone but not forgotten
Reaction score
634
> going to turn out like those GUI vs. JASS threads
Too late. This went a bit beyond a random rant that it was in the first place.
I don't really like that. Let the people use whatever they want, nobody's forcing you to use that same thing though nor play their/implement their products anyway.

> If the map lags then there's a high probability it's using handle vars on periodic skills.
Or it has a memory leak.
Or it uses inefficient coding in general (I've seen maps with periodic events to check if a unit died).
Or it's just too big for some people's computers to handle.
Or it has a bunch of stuff that isn't preloaded (example: older footman frenzy).
.......
Obviously handle vars are not (the only thing) making maps bad and laggy.

> vJass is an enourmously powerful compiler for Jass
Preprocessor. Compiler is something different.
The actual power is...well limited to mere text manipulation. However, yes, this is done very nicely, like just about everything Vexorian made so far.

vJass, obviously, cannot add any actual functionality or power to Jass whatsoever. All it does is making it easier to access what already is available.
Heard of maps such as DotA, ToB, AoM? They all use (or used) a variation of kattana's system.
Though somehow I don't recall anybody complaining about them (at learn not by taking efficiency as an argument), nor do I recall anybody saying "OMG these new maps made with structs are so much better than the old stuff". Seriously, would you even know pudge wars uses structs by simply playing it?

All this said I guess it's about time to close this...rant topics are never very useful anyhow.
 
Status
Not open for further replies.
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top