How to name town names in files

Started by
9 comments, last by Nicholas Kong 10 years, 7 months ago

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.

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?

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

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.

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.

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

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?


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.

Previously "Krohm"

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.

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

Previously "Krohm"

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

This topic is closed to new replies.

Advertisement