• 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] Variable or Hashtabel?

Status
Not open for further replies.
Level 12
Joined
Mar 24, 2011
Messages
1,082
I want to store a few (maybe around 200 :grin:) units - position ,unit-type, and facing angle, and 2 heroes - exp, stats, items.
I have read that hashtables are slower than variables and in some state (late game) id have to replace all the units with new ones and the heroes with their exp,stats and items from earlier.

So which is better to use variables or hashtable ?
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
I am prety sure that hashtables aren't buggy. We are talking about GUI here.
The real question is will a player expirience any lagg, delay, reduction of fps or any problems if I load the above mentioned things from a hashtable all at once.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
variables all the way, hashtables are bugged and causes memory fatal errors
well why dont you test it yourself >____________> there will without a doubt be lag when you store that many things
Seriously now? I've been using hashtables ever since the patch came out and I have never had even a single problem with it.
Not even when storing large amounts of data in it (as usually 1 hashtable supports all my systems).

Hashtables are highly convenient variables with 2 arrays and I will recommend them to anyone who is trying to get better at GUI because they're easy to use and do not bug often.
The only 'problem' is speed, and if you're so interested in speed you shouldn't use GUI anyway.

You're just spouting nonsense without proof and I'm not liking it.

Edit: oh right, the speed decrease isn't even that significant. In fact, you don't even notice it in-game.
How else are you going to get reliable double arrayed variables? By using var[ (i * size) + j ]? Remember that there's a limit on regular variables. endedit


Back on-topic: hashtables are very good because of their double arrays, but if you don't need them: don't use them.
It really depends on the details of what you want to store (if those heroes / items are divided into separate categories, then using a hashtable is fine).

Usually you will just need regular variables though.
But whatever you do, do not increase the array size in the variable editor!
 
Status
Not open for further replies.
Top