Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Thu Dec 13, 2018 11:52 pm

All times are UTC




Post new topic  Reply to topic  [ 21 posts ]  Go to page 1 2 Next
Author Message
PostPosted: Fri Jul 27, 2007 7:37 pm 
Offline
Engineer
Engineer

Joined: Fri Jul 27, 2007 7:11 pm
Posts: 4
I have hacked together a patch that adds a simple Russian town name generator to OpenTTD. It uses the Cyrillic alphabet, so you need to use a Unicode font to enjoy it.

I'm not Russian myself, so those of you who are may laugh at me and my ignorance now :D The generated names are indeed a bit monotonic; while reading my Атлас СССР I find lots and lots of names that do not fit my pattern. It might be interesting to expand the generator a bit…

It was pointed out in the IRC channel that Action F should be used instead, but I don't see how it would be possible to have adjectives agreeing with the gender of the noun.

Enjoy! (And if you do, please tell me. Maybe I'm the only twisted person who enjoys this kind of thing :D )


Attachments:
russian-town-names.patch [5.15 KiB]
Downloaded 776 times
Top
   
PostPosted: Fri Jul 27, 2007 9:01 pm 
Offline
TTDPatch Developer
TTDPatch Developer

Joined: Wed Feb 18, 2004 3:06 am
Posts: 10285
legoscia wrote:
It was pointed out in the IRC channel that Action F should be used instead, but I don't see how it would be possible to have adjectives agreeing with the gender of the noun.
You can do anything you want with action F. If you want gender agreement:
Code:
//Final definition
2*0 0F 80 <style-names>
  01 02 00 01
    81 01
    81 02

//masculine nouns
3*0 0F 01 02
  <num-parts> 01 <bit-count>
    //<num-parts> adjectives, masculine form
  <num-parts> <first-bit> <bit-count>
    //<num-parts> masculine nouns

Then repeat sprite 3 with the feminine forms and feminine nouns. And, if necessary, adjust sprite 2 and repeat sprite 3 again for the neuter gender.

_________________
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


Top
   
PostPosted: Fri Jul 27, 2007 9:11 pm 
Offline
Engineer
Engineer

Joined: Fri Jul 27, 2007 7:11 pm
Posts: 4
DaleStan wrote:
You can do anything you want with action F.

Ah… thanks for the enlightenment! I'll try to hack something together…


Top
   
PostPosted: Fri Jul 27, 2007 10:39 pm 
Offline
Engineer
Engineer

Joined: Fri Jul 27, 2007 7:11 pm
Posts: 4
There, now I've converted my name generator to NewGRF format; see attachments.

I noticed that OpenTTD doesn't allow forward referencing chains; all chains that the current chain jumps to must be defined earlier in the file. Is that a bug or a feature?


Attachments:
File comment: Russian Town Names v0.1: NewGRF file
russian-town-names.grf [1.24 KiB]
Downloaded 1890 times
File comment: Russian Town Names v0.1: source NFO file
russian-town-names.nfo [5.1 KiB]
Downloaded 861 times
Top
   
PostPosted: Fri Jul 27, 2007 11:11 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Fri Dec 02, 2005 3:43 pm
Posts: 619
Location: Drancy(93) - France
legoscia wrote:
I noticed that OpenTTD doesn't allow forward referencing chains; all chains that the current chain jumps to must be defined earlier in the file. Is that a bug or a feature?

That is my understanding of "Specifying an ID that isn't defined yet results in an error and therefore disabling all town name definitions in the file" in action F spec on ttdpatch wiki


Top
   
PostPosted: Sat Jul 28, 2007 12:04 am 
Offline
TTDPatch Developer
TTDPatch Developer

Joined: Wed Feb 18, 2004 3:06 am
Posts: 10285
Argh! Indeed. I got the sprites backwards. Just about the entirety of NFO works that way; everything must be defined before it can be used. Sorry for the confusion. I need more NFO coding! Stat! ;)

And it's a feature. It means you can define more than (1 << ID_WIDTH) entities of a given type. For action F that's not much of an issue, but you can easily end up with more action 2s than the 1-byte ids would otherwise allow.

_________________
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


Top
   
PostPosted: Sun Jul 29, 2007 9:47 pm 
Offline
Director
Director

Joined: Sat Mar 17, 2007 4:36 pm
Posts: 534
Wait. OTTD can do Action F now?

_________________
Jezulkim wrote:
Credits:
- Johnny B Goode, for digging this thread up and giving me an idea for this update.
- Mr. Owen Rudge, for his TT website where I grabbed the names.

Yeah! I've been credited! (Thanks, Jezulkim)
Winner of Most Annoying Member Award 2007 - Runner-up for Biggest Spammer 2007
My blog - Diary Of A Madman
Image
Image


Top
   
PostPosted: Sun Jul 29, 2007 10:08 pm 
Offline
TTDPatch Developer
TTDPatch Developer

Joined: Wed Feb 18, 2004 3:06 am
Posts: 10285
I've heard at least two different developers assert the truth of that, so I would presume so.

_________________
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


Top
   
PostPosted: Mon Jul 30, 2007 6:03 pm 
Offline
Director
Director

Joined: Sat Mar 17, 2007 4:36 pm
Posts: 534
Thanks, didn't know.

_________________
Jezulkim wrote:
Credits:
- Johnny B Goode, for digging this thread up and giving me an idea for this update.
- Mr. Owen Rudge, for his TT website where I grabbed the names.

Yeah! I've been credited! (Thanks, Jezulkim)
Winner of Most Annoying Member Award 2007 - Runner-up for Biggest Spammer 2007
My blog - Diary Of A Madman
Image
Image


Top
   
PostPosted: Thu Aug 09, 2007 10:55 am 
Offline
Engineer
Engineer
User avatar

Joined: Thu Jan 06, 2005 5:22 am
Posts: 97
Location: Russia, Volgograd
Patch for russian_townnames is using over 2 years in russian builds of openttd. It use ~ 7500 real townnames of russian towns, villages, etc. It use 1 additional file (with townnames) and very small changes in original files.

_________________
Russian OpenTTD Community patchpack (2.0.0RC2) (in Russian) , (in English)


Top
   
PostPosted: Sun Dec 27, 2009 3:59 pm 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Tue Dec 21, 2004 5:35 am
Posts: 185
Skype: andrey-zaharov
Location: St. Petersburg, Russia
Here patch based on original algorithm works against r18645


Attachments:
File comment: r18645
russian-town-names.patch [5.31 KiB]
Downloaded 185 times

_________________
OpenTTD Hard Game Pack
Top
   
PostPosted: Thu Apr 01, 2010 10:20 pm 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Tue Dec 21, 2004 5:35 am
Posts: 185
Skype: andrey-zaharov
Location: St. Petersburg, Russia
Synced to the 1.0.0
Smoky's patch with static names (no need out-dated GRF )


Attachments:
russian-town-names-smoky.patch [129.2 KiB]
Downloaded 223 times

_________________
OpenTTD Hard Game Pack
Top
   
PostPosted: Tue Apr 20, 2010 8:47 pm 
Offline
Engineer
Engineer

Joined: Tue Apr 20, 2010 8:41 pm
Posts: 19
Location: Moscow,Russia
legoscia, if you are still on this forum, your newgrf doesn't work on 1.0. I get an error "Unexpected end of grf". And patch is worse than newgrf of course because it's incompatible with non-patched openttd.


Top
   
PostPosted: Wed Apr 21, 2010 12:04 am 
Offline
Tycoon
Tycoon

Joined: Wed Jan 17, 2007 12:14 am
Posts: 7228
you can try to use grfcodec and nforenum on the grf, that might show what's wrong with it. you can get both tools from www.openttd.org/development

_________________
You might not exactly be interested in Ferion, but if you are, have fun :)


Top
   
PostPosted: Thu Apr 22, 2010 8:14 pm 
Offline
Engineer
Engineer

Joined: Tue Apr 20, 2010 8:41 pm
Posts: 19
Location: Moscow,Russia
Code:
#renum russian-town-names.nfo
NFORenum v3.4.6 r2309 - Copyright 2004-2009 Dale McCoy.
Processing file "russian-town-names.nfo".
Does not appear to be an NFO file.
Processing complete.

Code:
#grfcodec -e russian-town-names.grf .
GRFCodec version 0.9.10 r2306 - Copyright (C) 2000-2005 by Josef Drexler
Encoding in temporary file russian-town-names.new

And then it just hangs up loading my CPU at 100% (I've been waiting for 5 minutes, but no effect, which is unlileky for normal processing of 5 Kb of code)


Top
   
PostPosted: Fri Apr 23, 2010 12:46 am 
Offline
Tycoon
Tycoon

Joined: Wed Jan 17, 2007 12:14 am
Posts: 7228
the file doesn't respect the file format. replace the first lines with:
Code:
// Automatically generated by GRFCODEC. Do not modify!
// (Info version 7)
// Format: spritenum pcxfile xpos ypos compression ysize xsize xrel yrel

_________________
You might not exactly be interested in Ferion, but if you are, have fun :)


Top
   
PostPosted: Fri Apr 23, 2010 1:21 am 
Offline
Engineer
Engineer

Joined: Tue Apr 20, 2010 8:41 pm
Posts: 19
Location: Moscow,Russia
Well, it now gives LOTS of errors like this
Code:
//!!Warning (144): Offset 8: Control character 93 should not be used in this string.
//!!Warning (143): Offset 11: Using unspecified control character 9D.
//!!Warning (144): Offset 21: Control character 93 should not be used in this string.
//!!Error (187): Offset 25: Undefined extended format code D1.
//!!Error (161): Offset 31: Text ID D0 BD is not a valid text ID.
//!!Warning (144): Offset 38: Control character 93 should not be used in this string.
//!!Warning (144): Offset 53: Control character 93 should not be used in this string.
//!!Warning (147): Offset 60: Insufficient stack data for control character 82.
//!!Warning (144): Offset 68: Control character 93 should not be used in this string.
//!!Warning (144): Offset 71: Control character 94 should not be used in this string.
//!!Warning (147): Offset 79: Insufficient stack data for control character 80.
//!!Warning (144): Offset 85: Control character 93 should not be used in this string.
//!!Warning (144): Offset 88: Control character 92 should not be used in this string.
//!!Warning (144): Offset 100: Control character 93 should not be used in this string.
//!!Warning (147): Offset 109: Insufficient stack data for control character 82.
//!!Warning (144): Offset 117: Control character 93 should not be used in this string.
//!!Warning (147): Offset 128: Insufficient stack data for control character 80.
//!!Warning (144): Offset 134: Control character 93 should not be used in this string.
//!!Warning (144): Offset 147: Control character 93 should not be used in this string.
//!!Warning (143): Offset 150: Using unspecified control character 9B.
//!!Error (161): Offset 155: Text ID D0 BE is not a valid text ID.

It makes me think that this file totally doesn't respect NFO format.
But grfcodec makes the same grf an author posted. Maybe it works in TTDPatch?
I think about making my own grf for town names list (automated generation will never cover all kind of names) instead of patch. I searched this forum, but found no automated way to make NFO from a towns list. Is there any? If not I'll learn that newgrf format (but it's awful).


Top
   
PostPosted: Fri Apr 23, 2010 1:28 am 
Offline
Tycoon
Tycoon

Joined: Wed Jan 17, 2007 12:14 am
Posts: 7228
these errors probably can be fixed with a few tweaks, but i haven't looked into it.

there was a script like that discussed recently, it belonged to the swiss towns set, i believe.

_________________
You might not exactly be interested in Ferion, but if you are, have fun :)


Top
   
PostPosted: Fri Apr 23, 2010 6:26 am 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Wed Nov 07, 2007 10:44 pm
Posts: 9064
Location: Sol d
It seems that the amount of defined strings was wrongly stated within the grf. Also I silenced the warning about colour codes in action8 as they can be savely ignored.

Attached the fixed NFO file and the compiled grf which work for me.


Attachments:
File comment: NFO which works for me
russtown.nfo [5.77 KiB]
Downloaded 214 times
File comment: compiled grf
russtown.grf [1.24 KiB]
Downloaded 355 times

_________________
Image
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
Top
   
PostPosted: Fri Apr 23, 2010 9:16 am 
Offline
Engineer
Engineer

Joined: Tue Apr 20, 2010 8:41 pm
Posts: 19
Location: Moscow,Russia
planetmaker wrote:
Attached the fixed NFO file and the compiled grf which work for me.

Thanks! It works now. But names it creates don't really look as any kind of russian names. So I think a list woul be the best decision. And maybe some generator but made by russian person :)
I think I'll make that Newgrf. And thanks Eddi, Swiss town names source really has a script. Hope it works for me.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 21 posts ]  Go to page 1 2 Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2018 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2018.
Hosted by Zernebok Hosting.