does still anyone use kattana's system?

13lade619

is now a game developer :)
Reaction score
398
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
964
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
634
> 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
964
> 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
964
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.
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?

      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