• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Hashtables vs variables

Status
Not open for further replies.
Level 4
Joined
Jan 3, 2012
Messages
60
Hey guys

I just learned about hashtables and im still wondering if i should use them in my map or not, so i wanted to hear your opinions.

My map has 8 players and each player have a range of "attributes" i need to save. For example, each player have 13 units, 13 unit upgrades, 2 researches and level of them, some specific regions and so on.

Up until now i've used variables and arrays to save these for each player, but it will be a lot variables by the time i'm done. Would it be better to make a hashtable for each player and then save all of these values? Or is big 8 hashtables in one map too much?
 

zam

zam

Level 3
Joined
Jan 1, 2021
Messages
31
Use them but make sure not to hit the limit.

Limit is 256 (i think) so 8 hashtables is nothing.
 
Level 12
Joined
Feb 5, 2018
Messages
522
Well sounds like it would be easy enough with player number and index variables. Don't think you need hashtables here :)
 
Status
Not open for further replies.
Top