New Town Names (Silly)

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
azerbaijani
Engineer
Engineer
Posts: 6
Joined: 03 Aug 2009 15:21

New Town Names (Silly)

Post by azerbaijani »

Hello tt-forums!

I'm a member of a small community that plays a wide variety of multiplayer games. I'd like OpenTTD to be the next game in our rotation. Because we have our own off-brand of humor, I think a great way to encourage participation would be creating our own set of town names.

The IRC #openttd people were helpful in pointing me toward resources on NewGRF development, but it looks rather complicated. How much work would it be for an experienced developer to create a NewGRF with our name list?

Does OpenTTD generate names from the list in two parts? If so I can split our names into halves (most are already two parts).

How many names are allowed in a NewGRF? We have a list of 960 names. Most of them are just silly, some obscene, many are inside-jokes. Perhaps, once finished, the NewGRF may be released back to the community as an optional replacement for the "silly" name set.
acabin
Engineer
Engineer
Posts: 27
Joined: 05 Mar 2009 18:40

Re: New Town Names (Silly)

Post by acabin »

You can change the code yourselves, at namegen.h and namegen.cpp
I speak Chinglish...
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: New Town Names (Silly)

Post by DaleStan »

azerbaijani wrote:The IRC #openttd people were helpful in pointing me toward resources on NewGRF development, but it looks rather complicated. How much work would it be for an experienced developer to create a NewGRF with our name list?
Infinite, if you don't post the list.

If you do post the list, rather difficult unless you're OK with everything having almost exactly the same probability.

If everything has the same probability, I'm guessing about two hours.
azerbaijani wrote:Does OpenTTD generate names from the list in two parts?
It can. Or it can use three parts, or five parts, or one part, or just about any number of parts up to and probably exceeding INT_MAX. (Most of those parts would have to be non-random empty strings, though.)
azerbaijani wrote:How many names are allowed in a NewGRF?
The limit is somewhere between 16645636 and 4294967296, inclusive.
acabin wrote:You can change the code yourselves, at namegen.h and namegen.cpp
And then you, and everyone else who wanted to use your changes, would have to recompile.
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
azerbaijani
Engineer
Engineer
Posts: 6
Joined: 03 Aug 2009 15:21

Re: New Town Names (Silly)

Post by azerbaijani »

Thank you for your time, DaleStan.
DaleStan wrote:
azerbaijani wrote:The IRC #openttd people were helpful in pointing me toward resources on NewGRF development, but it looks rather complicated. How much work would it be for an experienced developer to create a NewGRF with our name list?
Infinite, if you don't post the list.

If you do post the list, rather difficult unless you're OK with everything having almost exactly the same probability.

If everything has the same probability, I'm guessing about two hours.
The list has some course language, and very long names, and other outliers. I'd like to clean it up before posting here.

I'm ok with even probabilities.
DaleStan wrote:
azerbaijani wrote:Does OpenTTD generate names from the list in two parts?
It can. Or it can use three parts, or five parts, or one part, or just about any number of parts up to and probably exceeding INT_MAX. (Most of those parts would have to be non-random empty strings, though.)
Can you tell me more about how these are arranged? The vast majority of the list is two-part names, with a handful of one and three part. I'd be ok with the patch being all one or two part names if that makes things easier.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: New Town Names (Silly)

Post by DaleStan »

Maximum name length is the shorter of 31 characters or 130 pixels.
azerbaijani wrote:Can you tell me more about how these are arranged? The vast majority of the list is two-part names,
I think you're misusing the word "part".
TTD's English name generator uses five parts. For the name "Little Bafingford", the parts are "Little " (note trailing space), "Ba", "fing", "ford", and "". For the name "Suwood City", the parts are "", "Su", "", "wood", and " City" (note leading space).

The vast majority of newgrfs use one-part names: "Little Bafingford" is "Little Bafingford", and "Suwood City" is "Suwood City".
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
azerbaijani
Engineer
Engineer
Posts: 6
Joined: 03 Aug 2009 15:21

Re: New Town Names (Silly)

Post by azerbaijani »

DaleStan wrote:
azerbaijani wrote:Can you tell me more about how these are arranged? The vast majority of the list is two-part names,
I think you're misusing the word "part".
TTD's English name generator uses five parts. For the name "Little Bafingford", the parts are "Little " (note trailing space), "Ba", "fing", "ford", and "". For the name "Suwood City", the parts are "", "Su", "", "wood", and " City" (note leading space).

The vast majority of newgrfs use one-part names: "Little Bafingford" is "Little Bafingford", and "Suwood City" is "Suwood City".
Thank you for the explanation and examples. And yeah that's p much what I meant.

Here's an example of the few names that really succeed as a single whole, atomic part:

Code: Select all

POKEY FUDGEPIPE
DOG THE COUNTY BUTLER
HOARY MARMOT
PENNY POUNDPUNCHER
FLUORESCENT GREEN NIGHTCRAWLER
HENRY FJORD
FREEHIPPY DIRTYLOADER
WALT THE BOY WHO CAN'T SPELL
MURPH THE CLOWN WITH HEART OF ALUMINUM
JERKY BEEFHUFFER
JESUS OF BACON LAKE
THE AXIS OF KNEIVEL
But there are many more nonsensical words that could be broken into first and last parts and mixed up:

Code: Select all

HUFF GLASSMONT
CONT MILKSTUMP
DRIP FISTMIX
GLAK FUNDBOAT
ROBOGOAT
FUDGEMONT GARGLEDRAWERS
SPLINCH GRIFTSMITH
GRANDPA BIBLESMILE
WINT "KNEES" THUNDERCHURCH
KROT GASBLISTER
PINE HOUSELOAD
BANGALANG "TENDERSNOT" WONDERLORD
MONDAY Von HOWARDSEN
HAMF Al-Bin FALAFELLATIO
"TOOLS" GRUNDY
ALBERTSON VON WALGREENS
"BEVERAGES" McDINGLE
COL. POPCORN SHINMODE
SHEIK YERBEWTIE
BOON CRANKPINCH
DORP O'HANDLEBAG
MELMAN ROWSDOWER
MARMALADE El WOBBLE
SLICK McDURPER
They're all uppercase and we like them that way, though I might be convinced to properly capitalize them if this patch would be useful to the rest of the community (these names are much easier to remember than the mumbly generated Engrich ones, I think.)

Are there character set restrictions?

So if it's not too much trouble, I'd like to see some of the long names stand on their own, and others be generated from two or three parts. I'm willing to parse the text in any way that would be helpful for a developer.
BUT if that's too much trouble, then I'd be happy to just use all 900-some names as they are now, that's cool.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: New Town Names (Silly)

Post by planetmaker »

azerbaijani wrote:Are there character set restrictions?
ASCII or UTF-8

Applying a proper capitalization would actually allow me to read them beyond the first line of names :-P
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: New Town Names (Silly)

Post by DaleStan »

azerbaijani wrote:Here's an example of the few names that really succeed as a single whole, atomic part:
Then code those as one part.
azerbaijani wrote:But there are many more nonsensical words that could be broken into first and last parts and mixed up:
And code those as two parts. Or three parts, for if you want the option of names with three of those random words.

NFO is powerful like that.
azerbaijani wrote:Are there character set restrictions?
Basic Multilingual Plane. But if you can keep it to seven-bit ASCII, things are a whole lot simpler.
azerbaijani wrote:So if it's not too much trouble, I'd like to see some of the long names stand on their own, and others be generated from two or three parts. I'm willing to parse the text in any way that would be helpful for a developer.
For me, the best format would be something like:

Code: Select all

# One part names
POKEY FUDGEPIPE
DOG THE COUNTY BUTLER
HOARY MARMOT

# Two-part names, first part
HUFF
CONT
DRIP
GLAK

# Two-part names, second part
GLASSMONT
MILKSTUMP
FISTMIX
FUNDBOAT
And so forth. "This list is the same as <otherlist>" is also allowable. Unless you mention otherwise, I'll make each option for a given part the same probability, but "All names have the same probability " is probably not what you want if there are 300 one-part names, 1.4 million two-part names, and 1.8 billion 3-part names.

The easiest, of course, is to just use the names as-is.
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
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: New Town Names (Silly)

Post by Roujin »

Does that mean you're creating the NewGrf for him, DaleStan? Just like that?
Wow, you must be in a good mood today. :lol:
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage
azerbaijani
Engineer
Engineer
Posts: 6
Joined: 03 Aug 2009 15:21

Re: New Town Names (Silly)

Post by azerbaijani »

DaleStan wrote:Unless you mention otherwise, I'll make each option for a given part the same probability, but "All names have the same probability " is probably not what you want if there are 300 one-part names, 1.4 million two-part names, and 1.8 billion 3-part names.

The easiest, of course, is to just use the names as-is.
Ok, let's keep this simple for the first version. I'll provide the list of whole names, and from that we may separate the multi-part names for a future version.

This evening I'll massage the .txt into a list with the following criteria:
  • 7-bit ASCII (I think it already is)
  • Proper capitalization (I'm sure there's a GNU tool perfect for this)
  • < 30ish characters per line
  • no obcenity or obvious double entendres (this will take a while 8) )
  • probably 800-900 lines
  • Anything else I'm forgetting?
Should I deliver this as a 'Code' block in a forum post, or attach a .txt, or another preferred method?

Once a NewGRF is created and installed, how would it be implemented? Would it add an additional option to the town_names directive, or would it replace 'silly'? I'm ok with either. Hopefully I can handle installing this on my dedicated server myself (I'm a sysadmin by day.)

The title for this project, where needed, should be "TAN BLATCHMAN", after the first name in the list.
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: New Town Names (Silly)

Post by Yexo »

azerbaijani wrote:Should I deliver this as a 'Code' block in a forum post, or attach a .txt, or another preferred method?
Please don't inline 50+ lines of code. Anything bigger than that should be attached in some way.
azerbaijani
Engineer
Engineer
Posts: 6
Joined: 03 Aug 2009 15:21

Re: New Town Names (Silly)

Post by azerbaijani »

Yexo wrote:Please don't inline 50+ lines of code. Anything bigger than that should be attached in some way.
Of course.

The .txt file is attached to this post.
Attachments
tanblatchman.txt
A big pile of silly names.
(15.79 KiB) Downloaded 217 times
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: New Town Names (Silly)

Post by DaleStan »

Roujin wrote:Wow, you must be in a good mood today. :lol:
Mostly because this is something that can be barfed out of a very small Perl script. (445 bytes, not counting extraneous whitespace.)

If I did my math correctly, no two probabilities differ by more than 1.12 chances per million. (Relative difference less than 1‰.)

I didn't test it, but NFORenum doesn't object.
Attachments
TAN_BLATCHMAN.grf
(16.79 KiB) Downloaded 180 times
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
azerbaijani
Engineer
Engineer
Posts: 6
Joined: 03 Aug 2009 15:21

Re: New Town Names (Silly)

Post by azerbaijani »

DaleStan wrote:
Roujin wrote:Wow, you must be in a good mood today. :lol:
Mostly because this is something that can be barfed out of a very small Perl script. (445 bytes, not counting extraneous whitespace.)

If I did my math correctly, no two probabilities differ by more than 1.12 chances per million. (Relative difference less than 1‰.)

I didn't test it, but NFORenum doesn't object.
You, sir, are my hero for the day.

I'll post here again once I have it running on my dedicated server.

Would you mind sharing said Perl script? Would I need a lot of other tools to compile these myself?
Attachments
Screenshot of TAN BLATCHMAN town names
Screenshot of TAN BLATCHMAN town names
tanblatchman.png (271.48 KiB) Viewed 5272 times
Wasila
Tycoon
Tycoon
Posts: 1498
Joined: 15 Mar 2008 07:02

Re: New Town Names (Silly)

Post by Wasila »

Which community is this, may I ask?
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: New Town Names (Silly)

Post by DaleStan »

azerbaijani wrote:Would you mind sharing said Perl script?
Feed it a list of 825 names on standard input and get an almost-NFO on standard out. Edit the "TAN BLATCHMAN" strings, if desired, and fix the GRFID. Pass the mess to NFORenum, and then encode with grfcodec. (The reason it's hardcoded to 825 is not because I typed an 825 -- in fact, there's no instance of a literal 825 anywhere in the script -- but because I didn't feel like writing code to factor arbitrary integers. It's hardcoded to 5 groups of 165 names.)

If you have a different number of names, you'll need to edit the Perl script.
If the perl script dies, see the comment on that line, and update the mentioned variables accordingly.

If NFORenum complains, then either you edited $name inappropriately, or one at least one of $lbits and $sbits is too small.

azerbaijani wrote:Would I need a lot of other tools to compile these myself?
NFORenum and GRFCodec, as mentioned.
Attachments
townnames.txt
(553 Bytes) Downloaded 230 times
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
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 4 guests