Code Review #3840

New town names grf

Added by PaulC over 7 years ago. Updated over 7 years ago.

Status:FeedbackStart date:2012-03-17
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-

Description

Here are the nml and language files for the new version of the town names grf, as discussed on the forums and via pm.

The new grf is loosley based on Japanese Town Names by Sylf, but otherwise is written entirely by myself. The grf uses real names of Japanese cities, towns and villages, and contains four language variants: latin, cyrillic, kanji and hiragana. The total number of unique names varies, but I count:

1578 latin names,
1576 cyrillic names,
1620 kanji names, and
1579 hiragana names.

For TTDP, only the latin names are included; the other versions cause TTDP to crash when starting a game because there is no font support for those languages. In fact there are also some latin characters missing in TTDP which means that some names won't display properly, but I'm going to see about updating TTDP's base graphics file in order to resolve this issue.

For encoding I recommend using nml r1742 ; earlier versions of nml don't support in-game urls, later versions use grf v8 which is incompatible with TTDP.

I've not included the version checks from the current action 14 - do we need these? It's not obvious what they're for.

jpnames.nml (167 KB) PaulC, 2012-03-17 22:38

english.lng (387 Bytes) PaulC, 2012-03-17 22:38

japanese.lng (409 Bytes) PaulC, 2012-03-17 22:38

russian.lng (442 Bytes) PaulC, 2012-03-17 22:38

SCR1.PNG (117 KB) PaulC, 2012-04-04 11:17

History

#1 Updated by dandan over 7 years ago

  • Status changed from New to Feedback

Looks very good, Paul. I will replace the current files with your new version.

For encoding I recommend using nml r1742 ; earlier versions of nml don't support in-game urls, later versions use grf v8 which is incompatible with TTDP.

That might be a bit of a problem in the long run since I would like to update the makefiles for the whole to enable automatic builds on the devzone. I wonder what we can do about this. Perhaps this one will just have to built by hand for the time being. This should not be a grf with very frequent updates, right?

I've not included the version checks from the current action 14 - do we need these? It's not obvious what they're for.

I don't remember exactly, but I believe earlier versions of OpenTTD/TTDPatch just do not know about action 14 and tend to panic when encountering one. This is probably much less of an issue now than it was when I first added those version checks two years or so ago. Still, minimal version checks should always be in place IMO.

#2 Updated by PaulC over 7 years ago

That might be a bit of a problem in the long run since I would like to update the makefiles for the whole to enable automatic builds on the devzone. I wonder what we can do about this. Perhaps this one will just have to built by hand for the time being. This should not be a grf with very frequent updates, right?

I assume automatic builds always use the latest version of nml then? But no, the next release should be more or less final. The only problem I foresee is if we ever need to add features that require later versions of nml, e.g. if new action 14 features become available in the future. OTOH, perhaps it's a reasonably safe assumption that anyone building the grf here will be doing so for OTTD and not TTDP?

I don't remember exactly, but I believe earlier versions of OpenTTD/TTDPatch just do not know about action 14 and tend to panic when encountering one. This is probably much less of an issue now than it was when I first added those version checks two years or so ago. Still, minimal version checks should always be in place IMO.

I'll look into it.

#3 Updated by planetmaker over 7 years ago

Use NML from the 0.2 branch (currently 0.2.3) in order to get a NewGRF using grf v7 which is (or might be) compatible with TTDPatch.

By default projects use NML nightly. But you can tell a project to use the releases NML version (thus 0.2.3) via the requires file like OpenGFX does: http://dev.openttdcoop.org/projects/opengfx/repository/revisions/5a494d2e2d48/entry/.devzone/build/requires

#4 Updated by PaulC over 7 years ago

dandan, about those version checks...

I don't know about OTTD, but apparently TTDP needs to be r2334 or better for action 14 to work (or rather, be ignored). According to the newgrf specs action 14 cannot be skipped by an action 7 or 9, so a check is useless anyway - you just get an invalid sprite warning regardless and not the action B message (see attached screenshot for an example).

#5 Updated by dandan over 7 years ago

I do not have time to test this right now, but I am little confused. The version check should not attempt to skip the action 14, rather it should skip the action B that deactivates the grf. This must all come before the action 14, obviously. Are you saying that TTDPatch will still give an error then? That would be odd.

#6 Updated by PaulC over 7 years ago

You're right about the version check - sorry, I tried several methods of handling action 14s when coding last night. The code you're using is this:

1 * 9 09 9D 04 \7= 01 00 00 00 03
2 * 9 09 8B 04 \7> \d2602333 01
3 * 10 0B 03 7F 00 "r2333" 00
4 * 6 09 9A 01 \7= FF 04

The intention I think is to give a fatal error and display the action B message if using an older version of TTDP. But TTDP actually appears to ignore this and throw an invalid sprite warning instead when it hits the action 14. Either way the grf is disabled, but it doesn't seem to be your code that does this, and you don't get the desired message.

Also available in: Atom PDF