Page 1 of 1

Catalan Town Names

Posted: 20 Jul 2006 12:49
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

Posted: 20 Jul 2006 14:21
by falconbe
May I ask you how you did because I would like to do the same with my country (Belgium) ?

Posted: 20 Jul 2006 15:04
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.

Posted: 20 Jul 2006 17:09
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!

Re: Catalan Town Names

Posted: 20 Jul 2006 17:15
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.

Posted: 20 Jul 2006 18:35
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!

Posted: 20 Jul 2006 20:51
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

Posted: 20 Jul 2006 21:04
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:

Posted: 21 Jul 2006 10:29
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:

Posted: 21 Jul 2006 14:03
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.

Posted: 21 Jul 2006 17:09
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.

Posted: 28 Jul 2006 14:38
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

Posted: 28 Aug 2006 22:06
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

Posted: 29 Aug 2006 12:08
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.

Posted: 29 Aug 2006 14:48
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)

Posted: 29 Aug 2006 18:29
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

Posted: 29 Aug 2006 18:51
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

Posted: 29 Aug 2006 18:57
by Telekoman
Nice to see new things comming from fellow spaniards!!

Cheers! :P