Japanese Town Names
Moderator: OpenTTD Developers
Japanese Town Names
Now that OpenTTD has Unicode support and a Japanese localisation, Japanese town names seem appropriate. I have produced a patch, using real town names sourced from Wikipedia, which should be attached to this post.
Note that you'll need to have fonts working properly in OpenTTD for this to work.
Questions, comments, feedback, etc. more than welcome
Note that you'll need to have fonts working properly in OpenTTD for this to work.
Questions, comments, feedback, etc. more than welcome
- Attachments
-
- japanese_town_names.patch.gz
- Japanese town names patch for OpenTTD
- (9.17 KiB) Downloaded 249 times
Screenshot
A screenshot of the patch in action:
Any language with only real town-names will not be expected. On big maps you can run out of town names and OpenTTD would crash. Would be great if you could make some random townname generator in Japanese
TrueLight: "Did you bother to read any of the replies, or you just pressed 'Reply' and started typing?"
<@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
<@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
About amount of town names...
I found playing a 2048x2048 map with "many" or "few" cities just produce the same amount of cities.
After some investigation, I just found it's because there is not enought cities names.
I found a list of the 400 biggest cities in France on Wiki. I think you'll find the same for most countries. Can't we use these names instead of the current small list ?
I did a patch on my PC and added these cities. I can get maps with many many cities. And it works fine. The only matter is that UTF-8 doesn't support a french character " œ ". ( œ ) so it must be replaced manualy by "oe" in the file...
Also, can't these town names be in a separat file ? Currenty it's an enum in C code. So we can't add/fix city names without compiling the game... It should be better if it was provided like the translation files.
You can find the patch here :
http://www.tt-forums.net/viewtopic.php?t=29578
PS : The diff contains another patch also. Keep defaut value then it will work as before (so you'll get only new cities).
Regards,
Sylvain
I found playing a 2048x2048 map with "many" or "few" cities just produce the same amount of cities.
After some investigation, I just found it's because there is not enought cities names.
I found a list of the 400 biggest cities in France on Wiki. I think you'll find the same for most countries. Can't we use these names instead of the current small list ?
I did a patch on my PC and added these cities. I can get maps with many many cities. And it works fine. The only matter is that UTF-8 doesn't support a french character " œ ". ( œ ) so it must be replaced manualy by "oe" in the file...
Also, can't these town names be in a separat file ? Currenty it's an enum in C code. So we can't add/fix city names without compiling the game... It should be better if it was provided like the translation files.
You can find the patch here :
http://www.tt-forums.net/viewtopic.php?t=29578
PS : The diff contains another patch also. Keep defaut value then it will work as before (so you'll get only new cities).
Regards,
Sylvain
What Peter said (encoding is C5 93) If you want to generate UTF-8, one very easy way is to open Firefox and type "data:," in the address bar, followed by the text you want encoded. Eg: data:,œ or data:,This string contains "œ". (phpBB refuses to turn these into links.)
400 is not nearly enough. I just started a random 2048x2048 game and Open generated 3136 towns.MagicBuzz wrote:I found a list of the 400 biggest cities in France on Wiki. I think you'll find the same for most countries. Can't we use these names instead of the current small list ?
Yes, they can, through the magic of NFO.MagicBuzz wrote:Also, can't these town names be in a separat file ?
If you want any hope at all of this being committed, remove the other patch.MagicBuzz wrote:The diff contains another patch also.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Then why is it OK for French, Spanish, Swiss, Romanian and Slovakian names, all of whose name pools (in namegen.h) are far smaller than the one I have created for Japanese?Darkvater wrote:Any language with only real town-names will not be expected. On big maps you can run out of town names and OpenTTD would crash.
That is a really good question. One possible reason could be that they got added before variable sized maps. Maybe it would be advisable to look into this.ickoonite wrote:Then why is it OK for French, Spanish, Swiss, Romanian and Slovakian names, all of whose name pools (in namegen.h) are far smaller than the one I have created for Japanese?Darkvater wrote:Any language with only real town-names will not be expected. On big maps you can run out of town names and OpenTTD would crash.
I can't find the RFC again. But I'm sure I read in the past in the UTF-8 RFC oelig was forgot, as they too latin-1 ISO charset for latin charset instead of latin-15 that fixed this bug.peter1138 wrote:What? œ is code point U+0153...MagicBuzz wrote:The only matter is that UTF-8 doesn't support a french character " œ ". ( œ ) so it must be replaced manualy by "oe" in the file...
May be it's fixed now, don't know...
Did you know that the word "gullible" isn't in the dictionary?
(And, on a completely unrelated subject, you are aware that 153 is about 32% larger than 100, right?)
(And, on a completely unrelated subject, you are aware that 153 is about 32% larger than 100, right?)
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Here is a patch with the COMPLETE list of the 36571 French cities (communes) including corsica but not off shore territories.
This is the list of all cities with a mayor. Small cities (hameaux) are not included in this list.
I removed double values (in fact, several cities uses the same name but in different locations...). I kept "only" 33689 names.
Source : http://fr.wikipedia.org/wiki/Listes_des ... _de_France
PS : Yes, it's not a mistake, a city is really named "Y" in France http://fr.wikipedia.org/wiki/Y_%28Somme%29
Working file (contains raw data and formulas from Wiki)
http://magicsite.manga-torii.com/files/villes.zip (Excel 2007 XLSX file)
Patch
http://magicsite.manga-torii.com/files/ ... cities.zip
This is the list of all cities with a mayor. Small cities (hameaux) are not included in this list.
I removed double values (in fact, several cities uses the same name but in different locations...). I kept "only" 33689 names.
Source : http://fr.wikipedia.org/wiki/Listes_des ... _de_France
PS : Yes, it's not a mistake, a city is really named "Y" in France http://fr.wikipedia.org/wiki/Y_%28Somme%29
Working file (contains raw data and formulas from Wiki)
http://magicsite.manga-torii.com/files/villes.zip (Excel 2007 XLSX file)
Patch
http://magicsite.manga-torii.com/files/ ... cities.zip
Last edited by MagicBuzz on 23 Jan 2007 21:09, edited 1 time in total.
I can't understand your humor. SorryDaleStan wrote:Did you know that the word "gullible" isn't in the dictionary?
(And, on a completely unrelated subject, you are aware that 153 is about 32% larger than 100, right?)
Last edited by MagicBuzz on 23 Jan 2007 21:21, edited 3 times in total.
Translations:
First line: "I have no clue where you heard that oelig wasn't part of Unicode, but some sort of warning indicators REALLY should have gone off at that point, if not made you both blind and deaf."
Second line: "oelig is not in Latin-1. It also doesn't appear in Unicode's Latin-1 block. This might not be a coincidence."
First line: "I have no clue where you heard that oelig wasn't part of Unicode, but some sort of warning indicators REALLY should have gone off at that point, if not made you both blind and deaf."
Second line: "oelig is not in Latin-1. It also doesn't appear in Unicode's Latin-1 block. This might not be a coincidence."
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Did you set a font in openttd.cfg?
Edit: added a screenshot (compiled with your patch)
Edit: added a screenshot (compiled with your patch)
- Attachments
-
- As you can see, it works :) (using tahoma bold font)
- Non nommé, 2 Jan 1950.png (81.71 KiB) Viewed 5159 times
Last edited by glx on 23 Jan 2007 21:37, edited 2 times in total.
No, I didn't changed anything in the config fileglx wrote:Did you set a font in openttd.cfg?
Edit: added a screenshot (compiled with your patch)
I'll try to use another font then.
-- Edit : You're right. I tested with Arial and it's OK. I just have to find a nice font now
Last edited by MagicBuzz on 23 Jan 2007 21:55, edited 1 time in total.
Well, there you go, you need to set a font in the config file. /me points in the general direction of the readmeMagicBuzz wrote:No, I didn't changed anything in the config fileglx wrote:Did you set a font in openttd.cfg?
Edit: added a screenshot (compiled with your patch)
I'll try to use another font then.
TrueLight: "Did you bother to read any of the replies, or you just pressed 'Reply' and started typing?"
<@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
<@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
It works fine with the new cities.
The only matter is that is nearly impossible for the game engine to find valid paths to create subsidies.
If I read the code, it choose a random city.
Then try 1000 times to pick up random city, then check if distance between cities is less than a defined valide (70 tiles).
On huge maps, as we can now have thousands cities, it's just near to be impossible to get it work.
I'm working on a patch to allow a number of tries based on the count of cities.
http://www.tt-forums.net/viewtopic.php?t=29578
I merged this fix in my subsidies range patch.
The only matter is that is nearly impossible for the game engine to find valid paths to create subsidies.
If I read the code, it choose a random city.
Then try 1000 times to pick up random city, then check if distance between cities is less than a defined valide (70 tiles).
On huge maps, as we can now have thousands cities, it's just near to be impossible to get it work.
I'm working on a patch to allow a number of tries based on the count of cities.
http://www.tt-forums.net/viewtopic.php?t=29578
I merged this fix in my subsidies range patch.
I've finally got around to making a version which generates random names as well as reading from the list from Wikipedia, so we have a mix of both real and random names.
It would be nice, though, if the same scrutiny that is being imposed on this contribution would be imposed on those which I referred to in my previous post (French, Spanish, Swiss, Romanian and Slovakian), which, as of the current trunk, are still generating town names from a relatively small town list.
On that point, and in response to a point Darkvater made further up this thread, running out of town names does not actually cause OpenTTD to crash - well, at least it doesn't on the Mac OS X/PPC builds. Instead, it just means that town generation (once the list of towns is exhausted) is really, really slow.
Anyway, apply the patch (patch -p1) and try it out - questions, comments, feedback, etc. welcome. Remember you'll need Unicode font support in your openttd.cfg file!
It would be nice, though, if the same scrutiny that is being imposed on this contribution would be imposed on those which I referred to in my previous post (French, Spanish, Swiss, Romanian and Slovakian), which, as of the current trunk, are still generating town names from a relatively small town list.
On that point, and in response to a point Darkvater made further up this thread, running out of town names does not actually cause OpenTTD to crash - well, at least it doesn't on the Mac OS X/PPC builds. Instead, it just means that town generation (once the list of towns is exhausted) is really, really slow.
Anyway, apply the patch (patch -p1) and try it out - questions, comments, feedback, etc. welcome. Remember you'll need Unicode font support in your openttd.cfg file!
- Attachments
-
- japanese_town_names_20070224.patch.gz
- Updated version of the Japanese town names patch, which now generates random names too.
- (11.48 KiB) Downloaded 208 times
Who is online
Users browsing this forum: No registered users and 2 guests