News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

Citylists separated from game language

Started by Václav, August 05, 2009, 07:00:59 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Václav

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.

Chybami se člověk učí - ale někteří lidé jsou nepoučitelní

Fabio

i also thought of this. it would be an interesting option

Spike

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.

jamespetts

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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

prissi

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.

Fabio

Quote from: Hajo on August 05, 2009, 12:21:59 PM
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.

Quote from: prissi on August 06, 2009, 06:25:20 AM
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...

Amelek

#6
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

gerw

Quote from: Amelek on August 06, 2009, 07:29:25 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'.

Amelek

#8
new language entries

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 void citynamesgui_t::rdwr(loadsave_t *file)

http://www.ii.uj.edu.pl/~szklarze/citynames2.patch if attachment is corrupted

gerw

Quote from: Amelek on August 10, 2009, 08:40:32 AM
it still doesn't save though. I can't find, where I should attach 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.

Václav

Fabio: thanks for supporting me in my idea.

Chybami se člověk učí - ale někteří lidé jsou nepoučitelní

Leartin

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.


Fabio

Whatever goes in this direction, I support it!


Sent from my iPhone using Tapatalk

Ters

Just remember to take into consideration sending a savegame to someone without the citylist used in that game so far.

sdog

Quote from: Ters 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.
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.

jamespetts

Unless, I suppose, cities are generated manually or the map is enlarged. And then there is the issue of station name lists...
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

sdog

Quote from: jamespetts 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...
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?

Leartin

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)

Ters

Quote from: sdog on February 09, 2015, 05:09:50 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.

Leartin

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.

Ters

Quote from: Leartin 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 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.

Leartin

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?

Ters

Quote from: Leartin on February 09, 2015, 07:45:37 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.

Fabio

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

Ters

Quote from: Fabio 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.


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.

sdog

Quote from: Fabio on February 10, 2015, 06:46:06 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.