Feature Request #1327

allow more than 255 names

Added by Ammler almost 9 years ago. Updated over 8 years ago.

Status:ClosedStart date:2010-08-27
Priority:LowDue date:
Assignee:Ammler% Done:

100%

Category:-
Target version:-

Description

town_names parts have a limit of 255, it would be nice if nml could split parts self and "recalculate" probabilities:

Example NML, which doesn't build:
http://bundles.openttdcoop.org/swisstowns/nightlies/ERROR/r7/
from http://dev.openttdcoop.org/projects/swisstowns (#1326)

swisstowns.nml (60.3 KB) Ammler, 2010-08-27 20:57

History

#1 Updated by Ammler almost 9 years ago

  • Tracker changed from Feature to Feature Request

#2 Updated by Ammler almost 9 years ago

Add example NML as the error bundle might disapear...

#3 Updated by compiler almost 9 years ago

[22:54] <Alberth> bummer, townnames splitting is non-trivial

My "workaround" with bash splitting works fine, so no real blocker anymore.

#4 Updated by Ammler almost 9 years ago

  • Priority changed from Normal to Low

^^ that was me :-)

#5 Updated by Alberth almost 9 years ago

  • % Done changed from 0 to 100

implemented in r765, but it needs some testing

#6 Updated by Alberth over 8 years ago

  • Status changed from New to Closed

Nobody complained so far, so I define the problem as solved.
The issue can be re-opened, or a new issue can be created, if necessary.

#7 Updated by Ammler over 8 years ago

  • Status changed from Closed to Reopened

The last part of swisstowns has a total of 6334 for the probabilities, does openttd allow such a high number for the randomizer?
I have the feeling, that the towns listed on that part are prefered quite a lot

01 "ÞChavannes-près-Renens" 00     01    1
01 "Crissier" 00     01    1
<..snip...>
01 "Bavois" 00     01    1
01 "Chavornay" 00     01    1
FF 00     FF    255
FF 01     FF    255
FF 02     FF    255
FF 03     FF    255
FF 04     FF    255
FF 05     FF    255
FF 06     FF    255
FF 07     FF    255
FF 08     FF    255
FF 09     FF    255
FF 0A     FF    255
FF 0B     FF    255
FF 0C     FF    255
FF 0D     FF    255
FF 0E     FF    255
FF 0F     FF    255
FF 10     FF    255
FF 11     FF    255
FF 12     FF    255
FF 13     FF    255
FF 14     FF    255
FF 15     FF    255
FF 16     FF    255
FF 17     FF    255

#8 Updated by Ammler over 8 years ago

  • Assignee set to Alberth

assigned to you, so you get mail ;-)

#9 Updated by Alberth over 8 years ago

Sorry, I have not read my mail yet :)

Your message is a bit of a mystery to me.

... 01 "Chavornay" 00
FF 00 FF 01 FF 02 FF 03 FF 04 FF 05 FF 06 FF 07 FF 08 FF 09 FF 0A FF 0B
FF 0C FF 0D FF 0E FF 0F FF 10 FF 11 FF 12 FF 13 FF 14 FF 15 FF 16 FF 17

is what I see in the NFO at the end of sprite 21 (with a few added new lines for better readability), which are 24 references to sub-nodes 00 to 17 with probability 0x7f (bit 7 is used to decide between a string-name and a sub-node, see also http://wiki.ttdpatch.net/tiki-index.php?page=ActionF in the last table, just above 'Notes' for the meaning of bit 7 of the probability.

I don't know how you got 4 columns in note#7 above, and/or how to read all those numbers. What does each column mean? (At a side note, any way to make note#7 a link?)

24 * 127 = 3048 rather than 6334.

If you are worried about the number of bits, yes you get enough, namely 32 from OpenTTD ("...Every town has 32 random bits for random naming ..." says the Action F wiki). You need 7 to select one from the selected sub-node, and 12 for value 3048 (or 13 bits, if 6334 is the right total), needing at most 7 + 13 = 20 bits.
Also, I verify that the action does not use more bits than it has available.

Edit:
While thinking about the problem, I came to the conclusion that you are right, probabilities seem to be messed up.
Currently busy doing repairs.

#10 Updated by yexo over 8 years ago

I haven't followed the changes to town name code that closely, so is this still a problem or can this issue be closed?

#11 Updated by Alberth over 8 years ago

  • Assignee changed from Alberth to Ammler

Ammler requested to ask that question about now to him.
Could you please test the new town names implementation, and if all is well, close this issue?
Thank you.

#12 Updated by Alberth over 8 years ago

  • Status changed from Reopened to Closed

Everybody is happy now :)

Also available in: Atom PDF