Jump to content

  • Log In with Google      Sign In   
  • Create Account

How to name town names in files


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
10 replies to this topic

#1 warnexus   Prime Members   -  Reputation: 1438

Like
0Likes
Like

Posted 12 September 2013 - 06:53 PM

I figure I would write "insert_town_name_" as the filename under a package called "town".

 

Anybody do things differently?

 

I am writing the game in Java.


Edited by warnexus, 12 September 2013 - 07:58 PM.


Sponsor:

#2 SiCrane   Moderators   -  Reputation: 9603

Like
1Likes
Like

Posted 12 September 2013 - 07:00 PM

That would really depend on what the town names are for. Are you talking about towns as locations in your game? A list of towns that come up in NPC chatter? A list of default names for a Civilization clone? Is there any other data associated with the names like nation, population, resources or climate?



#3 Paradigm Shifter   Crossbones+   -  Reputation: 5379

Like
0Likes
Like

Posted 12 September 2013 - 07:06 PM

I always name my children after GUIDs, if you save each town by name everyone is going to cal their town "cocktown"... or is that just me.


"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

#4 warnexus   Prime Members   -  Reputation: 1438

Like
0Likes
Like

Posted 12 September 2013 - 07:58 PM

That would really depend on what the town names are for. Are you talking about towns as locations in your game? A list of towns that come up in NPC chatter? A list of default names for a Civilization clone? Is there any other data associated with the names like nation, population, resources or climate?

I am writing a small scale version of Legend of Zelda similar to the NES version using the Java language.

 

Say, if I was to make a small scale Pokemon game with towns: would the naming conventions apply to Legend of Zelda.



#5 Paradigm Shifter   Crossbones+   -  Reputation: 5379

Like
0Likes
Like

Posted 12 September 2013 - 08:14 PM

Short answer: it doesn't matter if you name the towns yourself and it is a single player game. (You could call them town01, town02, etc.)

 

If it's a multilplayer game and anyone can name a town use a GUID.


Edited by Paradigm Shifter, 12 September 2013 - 08:15 PM.

"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

#6 warnexus   Prime Members   -  Reputation: 1438

Like
0Likes
Like

Posted 12 September 2013 - 08:56 PM

Short answer: it doesn't matter if you name the towns yourself and it is a single player game. (You could call them town01, town02, etc.)

 

If it's a multilplayer game and anyone can name a town use a GUID.

What do you mean by GUID?

 

Did some research and apparently it says: Globally Unique Identifier. Is this what you are referring to? Referring a town name by 128 bit number?



#7 Krohm   Crossbones+   -  Reputation: 3129

Like
0Likes
Like

Posted 16 September 2013 - 12:29 AM


I figure I would write "insert_town_name_" as the filename under a package called "town".
I'm not even sure what that means.

Ok, so I guess it means you have a stored file "New York.resource" for modelling New York city.

This will come handy for managing the assets but I would never, ever pull a resource name from a file name.

Just have a property in the data structure and use it as a city name. It's pure data and really irrelevant to the game as long as it's coherent.

 

I have no idea what most messages are talking about either... referring to towns by GUID? That's nonsense, in Java we can just have a reference to each city we need, every time we need, or an index to the resource slot. GUIDs are often overkill.



#8 BitMaster   Crossbones+   -  Reputation: 4131

Like
0Likes
Like

Posted 16 September 2013 - 01:16 AM

I have no idea what most messages are talking about either... referring to towns by GUID? That's nonsense, in Java we can just have a reference to each city we need, every time we need, or an index to the resource slot. GUIDs are often overkill.


I would not say that is completely true. When data has been loaded completely, then using GUIDs is indeed generally not an ideal path. However, during loading there will always be a time when you build the internal representation and you must use something to set the references/pointers/whatever you are using. And if you are deserializing a non-trivial graph, you will need something to set these interconnections. That can be simple integer IDs, internal string names or GUIDs (among other possibilities). GUIDs can have a reason for existence there, especially if the game allows user generated content (and mixing the content of different users) to avoid name clashes.

#9 Krohm   Crossbones+   -  Reputation: 3129

Like
0Likes
Like

Posted 16 September 2013 - 07:43 AM

Ah ok, I guess I understand now. In that case however I'd suggest the use of serialization slot indices (UIDs local to the resource being streamed).



#10 TheChubu   Crossbones+   -  Reputation: 4403

Like
0Likes
Like

Posted 16 September 2013 - 05:29 PM

Hmm... Well, you could serialize your town objects. In that case, each town would have a name field. So then the actual name of the file wouldn't matter, you would load your twn01.dat file, transforming it to an object, and read its name field.


"I AM ZE EMPRAH OPENGL 3.3 THE CORE, I DEMAND FROM THEE ZE SHADERZ AND MATRIXEZ"

 

My journals: dustArtemis ECS framework and Making a Terrain Generator


#11 warnexus   Prime Members   -  Reputation: 1438

Like
0Likes
Like

Posted 16 September 2013 - 06:10 PM

Hmm... Well, you could serialize your town objects. In that case, each town would have a name field. So then the actual name of the file wouldn't matter, you would load your twn01.dat file, transforming it to an object, and read its name field.

True! How did this slip pass my thought process? Thanks a bunch TheChubu!






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS