does still anyone use kattana's system?

13lade619

is now a game developer :)
Reaction score
399
random question..

is there anyone here who still uses kattana's local handle vars system?

if not.. why? is it inefficient or something?
and what are the advantages of the system you're using now?

IMO, it's still good since it's an all around attachment system that can attach any data to any handle.. especially structs..

i'm just interested 'cause i'm still using it and maybe there's a better one out there.
 

Viikuna

No Marlo no game.
Reaction score
265
Not because of gamecache, but because of I2H.

If you need gamecache, you should use Vexorians Table, it has nicer interface.
 

Trollvottel

never aging title
Reaction score
262
Actually there are no problems with kattanas if you use it correctly. Its fast enough for the most things. And if you use it for struct attachment there will be no bugs at all.
 

wraithseeker

Tired.
Reaction score
122
But it's interface isn't really nice and like Viikuna said, I2H is bad. I seen one of the debating of I2H in a thread in WC3C where Vex talked about Icefrog using I2H and got some debug messages sometimes.
 

Flare

Stops copies me!
Reaction score
662
what is I2H exactly and what's bad about it?
This should be informative, particularly this post.
rain9441 @ WC3C said:
Heres how the bug works:

Suppose you have a unit, a footman

You set FootmanIndex = H2I(Footman)
you call RemoveUnit(Footman).
you set Footman = null

Now the game recycles the Footman unit index that you have stored in FootmanIndex, and the next handle (or one of the many next) that is created gets the SAME handle index that the Footman has. This will also happen if the footman dies, decays, and gets recycled by the Wc3 engine as well.

Now lets say you set Footman = I2U(FootmanIndex). You now have a unit variable that isn't actually a unit, it is a Location! Uh oh! Call GetWidgetLife(Footman). Now you called GetWidgetLife on a Location! This is very bad, and is really unknown to what it specifically does, but it may crash (i never tried it).

So the act of calling I2H isnt actually bugged, its a reliable function, but the integer value you pass to I2H being corrupted causes the problems.

This problem is easily seen when storing H2I values in gamecache then nulling the handle variable. Then there is no guarantee that the I2H(gamecachevariable) call will give back the correct handle.

Theres one method that I know of that prevents this issue. When using H2I, make sure that you store not only the integer value it returns, but also store the handle variable. These must be stored in global variables, not gamecache. This will prevent the Wc3 engine from ever recycling the handle index until you null the handle variable.

Although, there are more problems supposedly associated with it, that's the first one I found with a good explanation
 

Trollvottel

never aging title
Reaction score
262
JASS:
library LHV
 
globals
    gamecache LOCAL_HANDLE_CACHE = InitGameCache("localhandles.w3v")
endglobals
 
// ===========================
private function H2I takes handle h returns integer
    return h
    return 0
endfunction
 
// ===========================
function LV takes nothing returns gamecache
    return LOCAL_HANDLE_CACHE
endfunction
 

 
function SetHandleInt takes handle subject, string name, integer value returns nothing
        call StoreInteger(LV(), I2S(H2I(subject)), name, value)
endfunction
 
 
function GetHandleInt takes handle subject, string name returns integer
    return GetStoredInteger(LV(), I2S(H2I(subject)), name)
endfunction
 
endlibrary


show me the I2H here.
 

Romek

Super Moderator
Reaction score
963
It's still slow. :rolleyes:

And there are faster systems, with nicer interfaces and more 'features' available too.
 

Trollvottel

never aging title
Reaction score
262
JASS:
 	 It's still slow.

I've heard that GameCache is about 4 times slower than an array. Not very slow, is it?
and doesnt HSAS or HAIL (dont know which system) use Game Cache?
JASS:
And there are faster systems, with nicer interfaces and more 'features' available too.


I agree.
 

SFilip

Gone but not forgotten
Reaction score
633
> Not very slow, is it?
It is. Why use something slower when you don't have to?
 

Trollvottel

never aging title
Reaction score
262
I didnt say i use it... I just said its not too slow to use it. And it is 1 call per timer run - can it be that bad?
 

Romek

Super Moderator
Reaction score
963
> and doesnt HSAS or HAIL (dont know which system) use Game Cache
Maybe as a backup or something, incase something goes wrong.
But otherwise, It's very unlikely.

I'm pretty sure ABC uses gamecache when there's a collision.
 

Trollvottel

never aging title
Reaction score
262
Maybe as a backup or something, incase something goes wrong.
But otherwise, It's very unlikely.

oh i think 1 of the system just stores values like H2I(h) - 0x10000000... in an array and if the value is above 8192 it just stores it in gamecache. but.... look a big map has about 5000 handles minimum at map initialization. look at the doodads etc. And everytime i tested a spell which used HSAS it lagged me to death -.-.
 

Azlier

Old World Ghost
Reaction score
461
Doodads are handles, now? I must test this, someday...
 

Trollvottel

never aging title
Reaction score
262
destructables are. i used the wrong word. but there are some maps which have thousands of trees, why do you think there is a destructable limit?
 

Viikuna

No Marlo no game.
Reaction score
265
I would still rather use Table.
Why?
Because it looks nicer.
And because most of recources in these days use it and not Handle vars.

And you dont really need gamecache too often anyways.

I use struct arrays and timer stacks for attaching timers.
I use UnitUserData for indexing units.

So I only rarely need Table for something.
 

Romek

Super Moderator
Reaction score
963
Also, take into consideration that most current attachment systems were actually created to replace LHV, because it was slow and unsafe. So going back to using that because there's "nothing wrong with it", is a bit silly.

As Viikuna said, if you insist on gamecache, then at least go for Table.

Though the only time I need to use that is to attach structs to ID's or similar.

I use a static timer for attaching to timers.
PUI for unit attaching. :)
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    So what it really is me trying to implement some kind of better site navigation not change the whole theme of the site
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top