The International Simutrans Forum

 

Author Topic: Citylists separated from game language  (Read 8472 times)

0 Members and 1 Guest are viewing this topic.

Offline Václav

  • Devotee
  • *
  • Posts: 3267
  • formerly VaclavMacurek
  • Languages: CZ, EN
Citylists separated from game language
« on: August 05, 2009, 07:00:59 AM »
I would like to choose city names separately on language I chose for game.

Sometimes (many often) I would like to play with cities with names of country with else language I chose (for example I play with names of cities of Poland when I play on map of Poland). It is possible by choosing language before game start and change language after game start - but it is very incomfortable.

So I would like to ask programmers for separating of choosing of citylist from choosing of game language.

Offline Fabio

  • Devotee
  • Administrator
  • *
  • Posts: 2898
  • The Pak128 Guy
    • Visit me on Facebook
  • Languages: EN, IT, RO, FR
Re: Citylists separated from game language
« Reply #1 on: August 05, 2009, 09:50:53 AM »
i also thought of this. it would be an interesting option

Offline Spike

  • *
  • Posts: 1361
  • First Simutrans Developer and Graphics Artist
Re: Citylists separated from game language
« Reply #2 on: August 05, 2009, 12:21:59 PM »
Biggest job is coding the UI for city language selection I guess. Simutrans UI coding was booooring usually ... for me that is, other seem to like it.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18721
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Citylists separated from game language
« Reply #3 on: August 05, 2009, 08:40:14 PM »
Part of what makes coding Simutrans UI difficult is that there is not a great deal of abstraction to make things easier - one has to write manually the exact pixel dimensions of dialogue boxes and then update all the positions of the individual components to match, manually re-size fixed sized arrays, and so fourth. It would be far easier if those things were semi-automated so that adding them into the code did not require so much tinkering with low level values.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9516
  • Languages: De,EN,JP
Re: Citylists separated from game language
« Reply #4 on: August 06, 2009, 06:25:20 AM »
The UI got three rewrites. With the curretn one you need at least not to do repetive tasks like drawing etc. A more flexible system would be nice, so feel free to invest three month to do it. Or use componenets and scrollpanes, like in the filter dialoges; there you can add as much as you like which will even autoposition itself.

Offline Fabio

  • Devotee
  • Administrator
  • *
  • Posts: 2898
  • The Pak128 Guy
    • Visit me on Facebook
  • Languages: EN, IT, RO, FR
Re: Citylists separated from game language
« Reply #5 on: August 06, 2009, 07:20:37 AM »
Biggest job is coding the UI for city language selection I guess.

this could be (easily?) done just cloning the language selection UI and returning the value to a different routine.

A more flexible system would be nice, so feel free to invest three month to do it. Or use componenets and scrollpanes, like in the filter dialoges; there you can add as much as you like which will even autoposition itself.

this could be very useful, because probably UI is the very point where ST lacks the most...

Offline Amelek

  • *
  • Posts: 70
Re: Citylists separated from game language
« Reply #6 on: August 06, 2009, 07:29:25 AM »
I think that UI can be pretty simple, let's say that city names are placed in some subfolder of text. Then, choice list could just look like load/save list or even more simple textlist+scroll. I don't think that it's really that hard to code.

edit: Here is simple patch. It still requires some work. In fact, it can't be even considered alpha.

Bugs:
1) Uses lang files from only /pak/ dir. I have no idea how to get current pak directory.
2) Does not save selected name pack anywhere. If you restart simutrans, you will have to select it again.
3) Loading saved game in different pak might result in something strange (as again, i have no idea, where pak's are loaded so i can't put this hack into it) - it will still use old pak citynames file.
4) If cityname contains some national-specific characters not available in current language, they might be displayed incorrectly.
5) As you see on screenshot, GUI can be improved with some translation. I guess citylist_XX_YY.txt might be translated to "Cities for YY country in XX language" or something.

The problem is, that I lack knowledge on game source. It is also in German, which doesn't help.

Edit2: oops, it seem that you can't attach new files in edit. Here they are :
http://www.ii.uj.edu.pl/~szklarze/citynames.patch
http://www.ii.uj.edu.pl/~szklarze/simscr10.png
« Last Edit: August 06, 2009, 11:15:28 AM by Amelek »

Offline gerw

  • Coder/patcher
  • *
  • Posts: 618
Re: Citylists separated from game language
« Reply #7 on: August 10, 2009, 06:25:40 AM »
1) Uses lang files from only /pak/ dir. I have no idea how to get current pak directory.
It's located in 'umgebung_t::objfilename'.

Offline Amelek

  • *
  • Posts: 70
Re: Citylists separated from game language
« Reply #8 on: August 10, 2009, 08:40:32 AM »
new language entries
Code: [Select]
Citynames_choice
This tool allows you to choise city names pack\ndifferent from your current language
Citynames
City names
Cityname_list_for_cities_
City name list for cities in country
_Cityname_in_language_
 in language
Cityname_list_for_cities_in_language_
City name list for cities in language
Citynames_hint_Use_this_nameset
Use this nameset
Citynames_Default_behavior
Default behavior

patch attached

it still doesn't save though. I can't find, where I should attach
Code: [Select]
void citynamesgui_t::rdwr(loadsave_t *file)
http://www.ii.uj.edu.pl/~szklarze/citynames2.patch if attachment is corrupted
« Last Edit: August 10, 2009, 09:03:39 AM by Amelek »

Offline gerw

  • Coder/patcher
  • *
  • Posts: 618
Re: Citylists separated from game language
« Reply #9 on: August 10, 2009, 03:31:58 PM »
it still doesn't save though. I can't find, where I should attach
Code: [Select]
void citynamesgui_t::rdwr(loadsave_t *file)
Maybe you could add a new variable in einstellungen_t (dataobj/einstellungen.*). But then it would be saved game-wise.

Offline Václav

  • Devotee
  • *
  • Posts: 3267
  • formerly VaclavMacurek
  • Languages: CZ, EN
Re: Citylists separated from game language
« Reply #10 on: August 12, 2009, 09:11:22 AM »
Fabio: thanks for supporting me in my idea.

Offline Leartin at

  • Devotee
  • *
  • Posts: 1260
  • PAK-DEV P192C
  • Languages: DE, EN
Re: Citylists separated from game language
« Reply #11 on: February 08, 2015, 03:15:11 PM »
Since there is no conclusion here and I thought of something similar today, I decided to perform some practical necromancy ;)

Both citylists as well as streetlists are currently dependent on the language setting. As the thread already showed, while playing on a non-fictional map, you'd probably like to use the native citylist(s)
But there is another issue: Many languages are spoken in multiple nations. Therefore, the citylists and streetlists often prefer names of one "main" nation over others. To get the citylist of Brazil, Austria, or USA, you usually need to change filenames (if the lists are even provided).

To tackle both issues in one go, I propose players should be able to choose multiple citylists/streetlists at once, via checkboxes. The default should of course be the language chosen - but not only one list, but all lists of the given language.
Eg. instead of citylist_de, you got citylist_de_germany, citylist_de_austria and citylist_de_swiss, and on default all of them are used as if they were one list if you play in German language - only you can tick them off in some menu to only play with Swiss names, for example. Or use citylist_en_ireland instead for playing an ireland inspired map. I guess since the citylist is only chosen at the start of the game, it could be "hidden" in the advanced options upon game creation, just a new tab there.


Offline Fabio

  • Devotee
  • Administrator
  • *
  • Posts: 2898
  • The Pak128 Guy
    • Visit me on Facebook
  • Languages: EN, IT, RO, FR
Re: Citylists separated from game language
« Reply #12 on: February 09, 2015, 08:04:34 AM »
Whatever goes in this direction, I support it!


Sent from my iPhone using Tapatalk

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5531
  • Languages: EN, NO
Re: Citylists separated from game language
« Reply #13 on: February 09, 2015, 04:00:38 PM »
Just remember to take into consideration sending a savegame to someone without the citylist used in that game so far.

Offline sdog

  • Devotee
  • *
  • Posts: 2039
Re: Citylists separated from game language
« Reply #14 on: February 09, 2015, 04:57:26 PM »
Just remember to take into consideration sending a savegame to someone without the citylist used in that game so far.
Isn't the city-list only used when generating a map. While in the savegame the actual string for each city, regardless how it has been named, is saved.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18721
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Citylists separated from game language
« Reply #15 on: February 09, 2015, 05:01:35 PM »
Unless, I suppose, cities are generated manually or the map is enlarged. And then there is the issue of station name lists...

Offline sdog

  • Devotee
  • *
  • Posts: 2039
Re: Citylists separated from game language
« Reply #16 on: February 09, 2015, 05:09:50 PM »
Unless, I suppose, cities are generated manually or the map is enlarged. And then there is the issue of station name lists...
Last time i tried it it generated cities with 'unnamed' strings only. I don't see a problem either, if new cities are generated and use the city list, they ought to use the currently, locally, active city list. At that point the versions diverged anyway. Or am i missing some aspect of server games here?

Offline Leartin at

  • Devotee
  • *
  • Posts: 1260
  • PAK-DEV P192C
  • Languages: DE, EN
Re: Citylists separated from game language
« Reply #17 on: February 09, 2015, 05:28:07 PM »
For me, it usually takes the citylist of the language I play in, not the one the game was started with. Not that I have a history of switching language all the time, though.

So I guess if nothing changes regarding this, sending a savegame would not be a problem. Could only be a problem if the used citylist would indeed be saved - in that case, you'd just need a fallback to the default (by game language/english)

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5531
  • Languages: EN, NO
Re: Citylists separated from game language
« Reply #18 on: February 09, 2015, 05:34:21 PM »
if new cities are generated and use the city list, they ought to use the currently, locally, active city list.

Yes, but what is the currently active city list? Players might like to use different city list for different games, like they can have different pak sets for different games. So a global setting might not be right. But if the city list selection is a setting in the game, the game must be prepared for cases where that file isn't there, either because it's deleted or because the game has been copied to a different computer. The latter is handled for pak sets and add-ons, so it's not impossible, but doesn't happen by itself. There might also be other ways to handle this.

Offline Leartin at

  • Devotee
  • *
  • Posts: 1260
  • PAK-DEV P192C
  • Languages: DE, EN
Re: Citylists separated from game language
« Reply #19 on: February 09, 2015, 06:10:56 PM »
The lists are currently distributed with the paksets. Unless this is changed, a global setting wouldn't work at all.

I'd just have the names of the lists to use stored in the savegame. As long as at least one of these lists is available, use it. Otherwise, go by the chosen language.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5531
  • Languages: EN, NO
Re: Citylists separated from game language
« Reply #20 on: February 09, 2015, 06:38:45 PM »
The lists are currently distributed with the paksets. Unless this is changed, a global setting wouldn't work at all.

I thought changing this was the whole point. Not only to be able to select city names from a different language, but also make and download custom lists, without being restricted by what pak set authors put into their distributions.

Offline Leartin at

  • Devotee
  • *
  • Posts: 1260
  • PAK-DEV P192C
  • Languages: DE, EN
Re: Citylists separated from game language
« Reply #21 on: February 09, 2015, 07:45:37 PM »
No need to change anything, since there already is a texts-folder within the game-folder where any custom lists could be stored and used with any pakset. While it's true that pakset-lists overwrite lists in this common folder, this shouldn't really be an issue, since custom lists would not have standard names likely to be used by paksets. So there is no restriction by paksets. On the contrary, if paksets would not be able to come with their own lists, the player might get no lists at all (since right now, even though it would be possible, there are no lists distributed with the game)
I think it's similar to themes, of which there are (to my knowing) only four besides the standard. Two of which only exist to be used with their specific paksets (and two which are more like experiments on what was possible at the time of their creation - I should know, I made them) - So the way it currently stands, having them not be distributed by paksets seems like a mistake. Why repeat that if there is no need?

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5531
  • Languages: EN, NO
Re: Citylists separated from game language
« Reply #22 on: February 09, 2015, 08:06:35 PM »
I think it's similar to themes, of which there are (to my knowing) only four besides the standard.

I see city name lists more like pak sets. Themes don't affect the game at all. But I think we can expect that there will be more city name lists than pak sets, probably more like pak set add-ons. And there's the lists of names for stops, which might need the same possibilities as city name lists, and which are used more extensively during gameplay. Unlike pak sets, it should however be no problems changing either list completely during gameplay. Simutrans must just be ready to fall back gracefully to other lists should the active one for a game disappear.

Offline Fabio

  • Devotee
  • Administrator
  • *
  • Posts: 2898
  • The Pak128 Guy
    • Visit me on Facebook
  • Languages: EN, IT, RO, FR
Re: Citylists separated from game language
« Reply #23 on: February 10, 2015, 06:46:06 PM »
Just to add 2 cents, playing in a language doesn't mean playing a map of one's own country, and I can see for instance one person playing in his language Pak Britain... Expecting to see British names. By the way, I would also like some fictional list of language-sounding cities, as I find much more annoying having real names completely out of place on a map.


Sent from my iPhone using Tapatalk

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5531
  • Languages: EN, NO
Re: Citylists separated from game language
« Reply #24 on: February 11, 2015, 06:50:45 AM »
Just to add 2 cents, playing in a language doesn't mean playing a map of one's own country, and I can see for instance one person playing in his language Pak Britain... Expecting to see British names. By the way, I would also like some fictional list of language-sounding cities, as I find much more annoying having real names completely out of place on a map.


Quoted using the quote button

That's pretty much the idea here, from the very beginning. It should also be noted that there are countries sharing an official language, but with a different set of place names.

Offline sdog

  • Devotee
  • *
  • Posts: 2039
Re: Citylists separated from game language
« Reply #25 on: February 13, 2015, 07:35:03 PM »
[...]I find much more annoying having real names completely out of place on a map.
That can be a little inconvenient indeed. James procedurally generated a very good and long fictional english city list.
This reminds me of something: Some of the standard city lists (eg. pak128) are way to short for modern mid- to large-sized games (I.e. >200 cities).


I don't find scrambled place names not as bad any more, after living in Toronto for a while. It formerly was called York. The villages to the east have a mix of Yorkshire, local names, names after influential people and so on. Slightly annoying is: when you leave York along the lake shore towards the west you come to Scarborough first, then Pickering and Whitby. Leaving York, Yorkshire, one can go to Whitby either via Scarborough (along the coast) or following Whitby Road through Pickering (passing the forrest). It must be a constant source of irritation or at least cognitive dissonance for everyone commuting east of Toronto.