Jump to content
  • Advertisement
Sign in to follow this  
Nicholas Kong

How to name town names in files

This topic is 2128 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement

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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites


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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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).

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!