| 02-22-2009, 05:00 PM | #1 |
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 |
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 | ||
Quote:
Quote:
|
| 02-22-2009, 05:22 PM | #4 |
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 |
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 | ||
Quote:
Well, here is what I told him: Quote:
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 |
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 |
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 | |
Quote:
Where can I found such a map? |
| 02-23-2009, 01:00 PM | #10 |
i thought was related to some phantom timer bug, not I2H (or maybe the two are related) |
| 02-23-2009, 02:23 PM | #11 |
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 | |
Quote:
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 | |
Quote:
|
| 02-23-2009, 07:57 PM | #14 |
Errr no Dusk, we still get chaos bugs in newest AotZ, just MUCH less frequently |
| 02-23-2009, 10:59 PM | #15 |
I believe DotA still uses I2H because its using gamecache, and Icefrog doesn't really feel like switching to structs/OOP |
