• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[General] Hashtables VS Indexing

Status
Not open for further replies.
Level 33
Joined
Mar 27, 2008
Messages
8,035
Now I know both of these methods will make your spells/systems to become MUI/MPI.

But, I need a solid confirmation (with proof and evidence, perhaps you can throw some theories) on which method is the best.

Do they have cons and pros ?

Or just this 1 method, dominates the other ?

I'm talking about every aspects and angles, such as efficiency, lag-less triggers, user-friendly, easy to read and understand, etc.

So guys, discuss, as I need your opinion

And don't even mention a word or two about vJASS or JASS in here as in fact, those programming language is the best compared to hashtable or indexing.
 
one method is never better than the other, indexing is faster than hashtable
coz in HT you usually call at least 2 natives (I mean the Id of a particular handle),
the ParentId & ChildID in 'EACH' line, then at loading time, it calls 'again' those types...
so it's kinda slow, but talking about saving, it's more powerful than indexing, the downside
of this the childId can be overwritten if the user is not careful, that's bad...

Indexing is fast, uses only arrays (integers as index), but can't recall outside
the indexed area, well it can, using vJass and UnitIndexer...

Why is it fast?, coz it uses only integers to load certain type of saved things,
reffering to a certain type of saved unit/location/effect etc...

I strongly recommend UnitIndexer than Hanky's Indexing sytem as it is easier to use...
 
Level 14
Joined
Jan 15, 2007
Messages
349
I think that indexing is still a way faster than using hashtables. Sure you can hit the array size limit but if you are intelligent enough you won't.

If you want to make a spell or a system where you got many looping events, indexing is the fastest way to go. When you want to save stuff over a longer period of time, hastables are the way to go.

There is also an example, in my template map, how to make a handle indexer (it's pretty much the same like a unit indexer, but more powerful).
 
Hanky's Indexing is way better than Unit Indexer imo. Hashtables and/or Unit Indexer may be easier to grasp. I still think Hanky's is reasonable for people to understand, because no one has come back to me to tell me it's too complicated.

Unit Indexer / Hashtables allows you to do more powerful things than simple indexing, like attaching data to a unit and referencing at any arbitrary point in the game.
 
Status
Not open for further replies.
Top