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 13
Joined
Feb 5, 2018
Messages
567
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