Home World Forum
Stars! AutoHost web forums

Jump to Stars! AutoHost


 
 
Home » Stars! Clones, Extensions, Modding » Stars! Nova - Development » Need to move away from using names as IDs
Re: Need to move away from using names as IDs Sat, 25 June 2011 07:09 Go to previous messageGo to previous message
Musmuris

 
Master Chief Petty Officer
Stars! Nova developer
Stars! Nova developer

Messages: 96
Registered: June 2011
We so need to move away from names as keys. However if we're using Empire for players then we no longer need the race as part of the key - that just becomes metadata about the empire. The empire ID is ennough to uniquely identify it.

We should make new composite keys for fleets, designs etc. This should be some form of Empire ID and FleetID, DesignID etc. as the client needs to be able to allocate them as well (e.g. when spliting fleets it needs to make a new FleetID so the current idea of the Server keeping a global ID counter is flawed)

We can either make strings (like "1/1", "1/2") I tend to prefer ints - and use the (e.g) high 8 bits for empire ID and the rest for the counter. This allows for 128 empires with 16 million IDs each. To get the Empire ID just && with 0xFF000000 and the ID && with 0x00FFFFFF. I.e. start numbering Empires at 0x01000000 and go up from there (no need it has to start at 1!)

Report message to a moderator

 
Read Message icon4.gif
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message icon14.gif
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Turn year
Next Topic: Orders overwriting Star Data
Goto Forum:
  


Current Time: Thu May 02 20:56:08 EDT 2024