HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Why I2H is evil?

02-22-2009, 05:00 PM#1
Flame_Phoenix
Hi guys, recently I had a discussion with Anachron, my ex-terrainer and student. He is using Local Handle Vars in his map, and I told him that was a bad idea by many reasons (slow, outdated, ect) and based the strong point of my argument in the sentence "I2H is evil and can cause cache corruption". Then he asked me why ...
I only know what I read from posts here (I used the search function but found a lot of garbage =S ) and I really can't explain why.
Can some one tell me why I2H is so evil please?
02-22-2009, 05:08 PM#2
Vexorian
Because it is unnecessary and because it hoses your map.

I2H = handle corruption bug. Period. in reality using I2H on a dead handle will cause the corruption, so it is avoidable, but it is certainly not worth it, also handle vars don't have any such way to avoid it anyway, so they must be avoided.

I2H allows nothing that isn't possible without it, plus it makes your code looks ugly besides of adding that risk.
02-22-2009, 05:14 PM#3
Flame_Phoenix
Quote:
I2H = handle corruption bug. Period.
That is what I told him, yet he doesn't believe me ... he says "I used I2H over 1000 times and never had any problem"...

Quote:
so it is avoidable, but it is certainly not worth it, also handle vars don't have any such way to avoid it anyway, so they must be avoided.
So, I2H will cause cache corruption if used on a dead handle. Because we can't avoid dead handles with "Local Handle Vars" then we should not use I2H, correct?
02-22-2009, 05:22 PM#4
Vexorian
Reality is that if you are using I2H wrong and you have not noticed any bugs it means that you are either lucky to code it correctly or your map wasn't played enough. Dota was one of the first maps to report these things, and they used a handle vars variation that still worked using I2H.

A handle corruption just causes two or more handles to be at the same address, this adds random bugs, just notice that random bugs sometimes means no bugs. For example, it could happen that this map has so many handle leaks that this little corruption has no effect. Or it could be that this thing sometimes happens but just happens to do something undetectable, like not removing a location. Of course, with some bad luck, it will cause that one complicated spell to last forever and kill everybody around its area permanently, because a timer couldn't be stopped...
02-22-2009, 05:23 PM#5
Joker
How about you let him continue using Handle Vars and spank him later when he comes crying to you for help?
02-22-2009, 05:33 PM#6
Flame_Phoenix
Quote:
How about you let him continue using Handle Vars and spank him later when he comes crying to you for help?

Well, here is what I told him:
Quote:
(x:x:x) Anachron:
aslong as I don'T get problems I will use my method
(...)
(x:x:x) Flame_Phoenix:
I want to see you saying that, the moment your useres start saying your map is a piece of shit because ALL spells don't work

But, doing nothing is wrong, because:
1 - That is not pedagogical (meaning it is a bad way to learn things)
2 - As his teacher and friend, I want him to avoid such problems...

So my only solution is to convince him... which is failing so far.
Anyway, thx for help guys, rep++ to all.
02-22-2009, 05:43 PM#7
Vexorian
Regardless of bugs (Which are not as likely cause he probably has a lot of memory leaks in his map), the unreadable code will make his spells too hard to update, that's how he will have to pay.
02-22-2009, 07:17 PM#8
uberfoop
It's all about how unlucky you are in your coding. If you can't think of anything personal to show him, show him early 2.xx versions of AotZ. If that doesn't convince him that I2H is evil, nothing will.
02-22-2009, 07:51 PM#9
Flame_Phoenix
Quote:
It's all about how unlucky you are in your coding. If you can't think of anything personal to show him, show him early 2.xx versions of AotZ. If that doesn't convince him that I2H is evil, nothing will.
Mmm, for the sake of learning I will try it!
Where can I found such a map?
02-23-2009, 01:00 PM#10
emjlr3
i thought was related to some phantom timer bug, not I2H (or maybe the two are related)
02-23-2009, 02:23 PM#11
Captain Griffen
Dusk simultaneously switched to a timer stack and a safe LHV system (ie: no I2H), hence we can't actually tell.
02-23-2009, 03:10 PM#12
Vexorian
Quote:
Originally Posted by emjlr3
i thought was related to some phantom timer bug, not I2H (or maybe the two are related)
the timer bug and the I2H bug are exactly the same thing.

Not setting timers to null makes them immune to the I2H bug, and timers always were the weak link in a spell. That's how not setting a timer to null fixes things.

However, recycling timers is still practical for things like attachments.
02-23-2009, 05:58 PM#13
Rising_Dusk
Quote:
Originally Posted by Captain Griffen
Dusk simultaneously switched to a timer stack and a safe LHV system (ie: no I2H), hence we can't actually tell.
It wasn't simultaneous, there was a 2-version difference. The timer stack did not correct the bugs like I had originally thought it would; only when removing I2H utterly from the map via your LHV replacement did the bugs stop.
02-23-2009, 07:57 PM#14
Bobo_The_Kodo
Errr no Dusk, we still get chaos bugs in newest AotZ, just MUCH less frequently
02-23-2009, 10:59 PM#15
PandaMine
I believe DotA still uses I2H because its using gamecache, and Icefrog doesn't really feel like switching to structs/OOP