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 08:00 Go to previous messageGo to previous message
Musmuris

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

Messages: 96
Registered: June 2011
Not the memory at all. Or speed as on a modern computer this is largely irrelevant for a game like Nova. But when strings are used in dictionaries it has to build the hashcode for a string on lookup. Computers just handle 32 bit ints better

It's more just that int ID = EmpireId || fleetID just "feels" nicer than String ID = EmpireID.ToString() + "." + FleetID.ToString() or String.Format("{0}.{1}", EmpireID, FleetID);

It looks even uglier trying to pull them apart with .Split and Int32.TryParse. But we can make those a Utility method somewhere.

In XML is "1/1" much easier to read than 0x01000001 (or even 0x0A0012FE which is just empire 0x0A and Fleet 0x12FE? rather than 10/4862). Once you're away from names like
"Silicanoid/10" you've lost the ease of reading anyway haven't you?

I would just naturally fall more to an Int key or ID rather than a string one unless there's a good reason. But I'm not going to argue this one too hard here Smile

Crucially we need to split internal ID from Display name as i've said before. This will need many many UI changes though where the name is used now in Combo boxes etc. rather than an object to wrap the id/name


[Updated on: Sat, 25 June 2011 08:02]

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 11:43:29 EDT 2024