hashtable limits?

W!†A_cRaft

Ultra Cool Member
Reaction score
28
Okay since im making sort of a weird map i will try to clue you guys in on what I need:

a unit to unit relation that stores certain data:

unit 1 towards unit 2 has data value of lets say 10
unit 1 towards unit 3 has data value of lets say 15
unit 2 towards unit 3 has data value of lets say 30
unit 3 towards unit 2 has data value of lets say 105
unit 3 towards unit 1 has data value of lets say 5

if you get the point, i need to make relations between units in my map and store data to it. I think the hashtable would be a rather easy way to do it.

PROBLEM:
I don't know if a hashtable can handle it, or if it would make the game laggy. Due to enormus number of relations that are kept as data stored in the hashtable itself it might cause lag, or possible even clogging the table? It would be better if i could dispose of the data when the unit decays away, since i would no longer need it.... But I cant do that with hashtables.

What are the limits with tables? Is there a way to dispose of the data that i no longer need inside the table?
 
A single hashtable can store unlimited amounts of data as far as i know. however, you are limited to 256 hashtables a map. (thats not such a bad limitation because seriously, no one will ever need this many)

depending on what kind of data you want to store and how many units are involved it might become laggy. this is because of all the ram taken to save the values.

if you are going to store big amounts of data like unitgroups and such for hundreds of units it can really become laggy the way memory leaks would do. however, saving a couple of hundred numbers within 0 - 255 wouldnt really make much of a difference for todays computers.
 
Well im counting like this:

i will have like 200ish units in a map, so the total relations would go as high as oblivion...

just take a pattern of 5 units:
unit 1 relates to units 2,3,4,5
unit 2 relates to units 1,3,4,5
unit 3 relates to units 1,2,4,5
unit 4 relates to units 1,2,3,5
unit 5 relates to units 1,2,3,4

that makes a total of 4 + 4 + 4 + 4 + 4 relations = 20 relations for 5 units. using the same principal, 200 units would in return have: 39800 relations

39800 relations x Number of Data Stored (which should be at least like 5-10) would make an average of:

278600 Hashtable entries in total I think this is a little too much don't you? It would be really epic if I could clear the data once I do not need it anymore thus freeing up space for other data, specially since there will never be a need to keep more then 20 units stored at same time.


EDIT: Also is there really any benefit in spreading the data over multiple hash tables, or can i just keep using 1?
 
>It would be really epic if I could clear the data once I do not need it anymore thus freeing up space for other data, specially since there will never be a need to keep more then 20 units stored at same time.

Use Clear Parent Hashtable + Clear Child Hashtable?

>the limit is 123 not? Oo
nope it's 256

Off-topic: wasn't the limit of gamecache also 256?
 
123 doesnt make any sense. 128 would be more fitting as a power of 2.
the indexnumber of hashtables can varry from 0 - 255, thats exactly 1 byte. this limitation is used to save memory. if you could create more then 256 hashtables they would need doubled ram to store their corresponding ID.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good

      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