Catalan Town Names

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Post Reply
Arnau
Engineer
Engineer
Posts: 54
Joined: 20 Jul 2006 10:18

Catalan Town Names

Post by Arnau »

Hi,

It's been a while since I started playing Openttd but this is my first message.
The reason of this message is that I wanted to contribute a little bit with a Catalan town names generator.
I'm quite a newbie using patch files and SVN but I think that I managed to save my work in a patch for the main trunk.
I'd like my little job to be included in the next versions of Openttd 0.4.8, 0.5 or the version the "openttd Guru's" consider apropiate.

One last thing, there is one little bug I couldn't solve. The last town names option was Italian, being Catalan now the last one, but I couldn't manage to tell Openttd that now there is one more option. The problem is that if I select Catalan town names, the next time I run openttd Italian is selected.

Arnau
Attachments
catalantownnames 280706.patch
Patch tested with r5625 of the main trunk
(6.61 KiB) Downloaded 293 times
Last edited by Arnau on 28 Jul 2006 14:36, edited 7 times in total.
falconbe
Engineer
Engineer
Posts: 12
Joined: 18 Jul 2006 08:01
Location: Belgium

Post by falconbe »

May I ask you how you did because I would like to do the same with my country (Belgium) ?
Falconbe
Arnau
Engineer
Engineer
Posts: 54
Joined: 20 Jul 2006 10:18

Post by Arnau »

Of course!
I followed this guide:

http://wiki.openttd.org/index.php/Town_Names

Basically there are two types of town names.
- Real names
- Fictional Computer generated names.

When you look at the sources you'll see that in some languages only Real names are used (because the author decided that way) and others use a list of words that combined with each other create some realistic names.

In my version, I used the Italian template with some modifications.

Hope it helps.
User avatar
lepkka
Engineer
Engineer
Posts: 117
Joined: 18 Jan 2005 12:32
Location: Barcelona

Post by lepkka »

hey, nice to see this!!

some ortografic facts for future versions:

Vilanova i la Geltrú
Sant Joan Despí
Vilafranca del Penedès

good job!
User avatar
belugas
OpenTTD Developer
OpenTTD Developer
Posts: 1507
Joined: 05 Apr 2005 01:48
Location: Deep down the deepest blue
Contact:

Re: Catalan Town Names

Post by belugas »

Arnau wrote:One last thing, there is one little bug I couldn't solve. The last town names option was Italian, being Catalan now the last one, but I couldn't manage to tell Openttd that now there is one more option.
You missed the changes in settings.c
This is what you need :)

By the way, maybe you could use a lot more names and parts.
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
Arnau
Engineer
Engineer
Posts: 54
Joined: 20 Jul 2006 10:18

Post by Arnau »

Thanks for the fast reply but what do I have to change in the settings.c file?

What would you like to add? more real towns or more fictional options? both hehe?

Another question. I'm having little problems with the function SeedModChance. The problem is that I don't know how it works, and I'd like to improve this part as I want a better distribution of the words.

The parameters are Shift, Max and Seed. The only one I know is Max which is the maximum value.

Well, if someone can explain or tell me where is explained I'll be so grateful.

Bye!
User avatar
sidew
Engineer
Engineer
Posts: 115
Joined: 31 Aug 2005 06:46
Location: Milan, Italy
Contact:

Post by sidew »

Arnau wrote:Thanks for the fast reply but what do I have to change in the settings.c file?
As coder of Italian town generator (BTW I'm happy that you used my code a s schema for your generator), the setting thtat you look in setting.c is the line

Code: Select all

SDT_OMANY(GameOptions, town_name, SLE_UINT8, 0, 0, 0,  19, "english|french|german|american|latin|silly|swedish|dutch|finnish|polish|slovakish|norwegian|hungarian|austrian|romanian|czech|swiss|danish|turkish|italian", STR_NULL, NULL), 
You modify the "19" in "20" and add "catalan" after italian like

Code: Select all

SDT_OMANY(GameOptions, town_name, SLE_UINT8, 0, 0, 0,  20, "english|french|german|american|latin|silly|swedish|dutch|finnish|polish|slovakish|norwegian|hungarian|austrian|romanian|czech|swiss|danish|turkish|italian!catalan", STR_NULL, NULL), 
I hope that 'll help you
Sidewinder

Italian Town names patch for OTTD (R5266) now in trunk since 0.4.8
For typo, errors or bug on OTTD italian translation, please PM me.
unofficial italian TTD/OpenTTD forum: http://wolf01.game-host.org/forum/index.php
Arnau
Engineer
Engineer
Posts: 54
Joined: 20 Jul 2006 10:18

Post by Arnau »

I updated and uploaded the patch.
Sidew thanks you very much. I feel a little bit idiot it wasn't that difficult... :roll:
Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Post by Bjarni »

Arnau wrote:Sidew thanks you very much. I feel a little bit idiot it wasn't that difficult... :roll:
well, the Swiss town names had the same bug, but for some odd reason nobody noticed, so it got committed and after a long while, we got a bug report on it so I had to fix it (simple fix :D )
Odds are that if you do something stupid, you aren't the first one to do so and you aren't the last either :wink:
User avatar
belugas
OpenTTD Developer
OpenTTD Developer
Posts: 1507
Joined: 05 Apr 2005 01:48
Location: Deep down the deepest blue
Contact:

Post by belugas »

Arnau wrote:What would you like to add? more real towns or more fictional options? both hehe?
Both, indeed! The more the better.
Arnau wrote: Another question. I'm having little problems with the function SeedModChance. The problem is that I don't know how it works, and I'd like to improve this part as I want a better distribution of the words.
Those functions are merely using the seed param, operate a binary shift and see what the result is, compared to Max. It does not generate a random number by itself. So the seed value must not be changed. Yu can play with the shift as you will, as well as the max.
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
Arnau
Engineer
Engineer
Posts: 54
Joined: 20 Jul 2006 10:18

Post by Arnau »

New version with more Real town names and new words.
I modified a little bit the seed functions in order to avoid too long town names.
Arnau
Engineer
Engineer
Posts: 54
Joined: 20 Jul 2006 10:18

Post by Arnau »

Well,

This is the final version of the Catalan town names generator.

I hope it will be added to some version of Openttd in the future :)

Bye
nars
Engineer
Engineer
Posts: 1
Joined: 28 Aug 2006 22:02

Post by nars »

Hi,

I think you have a bug at:

Code: Select all

		if (SeedModChance(0, 2, seed) == 0) { // prefix
			strcat(buf, name_catalan_pref[SeedModChance(11, lengthof(name_catalan_pref), seed)]);
		}
		else {  <-- HERE
this else will cause city names with prefix only, never with prefix and the rest of the city name.

Regards
User avatar
sidew
Engineer
Engineer
Posts: 115
Joined: 31 Aug 2005 06:46
Location: Milan, Italy
Contact:

Post by sidew »

I confirm this bug after checked the source, can you write in http://bug.openttd.org because the generator is now in trunk.
Sidewinder

Italian Town names patch for OTTD (R5266) now in trunk since 0.4.8
For typo, errors or bug on OTTD italian translation, please PM me.
unofficial italian TTD/OpenTTD forum: http://wolf01.game-host.org/forum/index.php
Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Post by Bjarni »

sidew wrote:I confirm this bug after checked the source, can you write in http://bug.openttd.org because the generator is now in trunk.
No, that's just a GUI frontend to the actual svn server for reading stuff, not editing. It lacks write permission.
To edit anything in the svn server, you need to be a developer, so I fixed it.
Revision: 6213 wrote:-Fix: Calatan town names was only prefix OR the rest of the string, never both (nars)
Arnau
Engineer
Engineer
Posts: 54
Joined: 20 Jul 2006 10:18

Post by Arnau »

Hi,

I wanted to report the problem, but I've been away for quite a lot of time. Anyway someone noticed before me. So Nars, thanks!. Problem solved Hurrah!

I just found one little little bug more...

in the strings list, in the table/namegen.h

Code: Select all

	"Olesa de",    ---->	"Olesa de ",
I forgot one space at the end.

Sorry :oops:

Bye
Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Post by Bjarni »

Arnau wrote:I just found one little little bug more...

in the strings list, in the table/namegen.h

Code: Select all

	"Olesa de",    ---->	"Olesa de ",
I forgot one space at the end.
fixed
User avatar
Telekoman
Chairman
Chairman
Posts: 844
Joined: 05 Mar 2004 19:01
Location: Madrid (spain)

Post by Telekoman »

Nice to see new things comming from fellow spaniards!!

Cheers! :P
Due to cutbacks, the light at the end of the tunnel has been turned off.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Bing [Bot] and 41 guests