News:

Want to praise Simutrans?
Your feedback is important for us ;D.

PR#521 - Nameable Accommodation Class

Started by Ranran, March 14, 2022, 03:51:44 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ranran

Quote from: ACarlotti on March 10, 2019, 06:00:27 PMMy idea is to make the number of classes of accommodation in a vehicle completely independent of the number of wealth groups. Each portion of accommodation in a vehicle would have a suggested (default) wealth class assigned to it, and can be given a descriptive name in the pak file.

James: This would be fully backwards compatible - in the event that default wealth classes aren't in listed in the pak file or dat file, the default will be set to be equal to the index of the accommodation (which is consistent with the current dat file format). If the dat file and/or pak file does not give a label for an accommodation section, then it can be named according to it's default wealth category (perhaps in a slightly different form to the wealth description to avoid the existing ambiguity), or can be left unspecified if it is the only (non-empty) section in the vehicle.

I know what I intend to do here, and a lot of it involves reworking and fixing stuff I did last year, so I'll put this on my todo list and write it up when I have time.
Unfortunately, ACarlotti evaporated and his plan was not carried out. (´・ω・`)
I am not sure if it is exactly the same as his idea, as I and many Japanese are not fluent in English, but I thought I would implement it as it seems to be a feature that could please train geeks.
I created the foundation for it. You can test it with pull request #521.


Overview:
The patch allows for the naming of each of the vehicle accommodations. For example, the same class can be named open salon, compartment, sleeper, etc.
Set the following in dat file.

payload[3]=28
comfort[3]=191
accommodation_name[3]=Couchette


If nothing is set, the default name is used. However, in this patch, as proposed by ACarlotti, the translations of fare, wealth, and accommodations are separated.
Existing ones will be reused as wealth classes and new translations for fares and default accommodations will be added

p_accommodation[0]
p_accommodation[1]
p_accommodation[2]
p_accommodation[3]
p_accommodation[4]
m_accommodation[0]
m_accommodation[1]
p_fare[0]
p_fare[1]
p_fare[2]
p_fare[3]
p_fare[4]
m_fare[0]
m_fare[1]

If you want the text to be the same as before, just make these translations the same as the wealth class.

I have currently implemented only this basic functionality. The display regarding this can only be seen on the depot dialog.
This patch is a patch that requires pakset to be updated, so you need to work on changing pakset. I am not familiar with the UK situation and would not be able to do that.

Little work has progressed on the implementation work on the GUI yet, but this is expected to bring new functionality and will take a lot of time. But I would like to take the first step.
I would be happy to hear your guys' opinion on this. Thanks in advance.

jamespetts

Thank you for your work on this, and apologies for not having had the time to look into this until now. I am not sure that I fully understand what A. Carlotti had proposed here - he seemed to be suggesting separating the number of accommodation sections from the number of wealth classes, which does not appear on the face of it to make sense, as the only function to different accommodations is to charge more to those who can afford to pay more, i.e., those in higher wealth classes.

However, I think that what you describe here does not have that difficulty. This appears to be related specifically to modifying the names of different accommodations in vehicles, if I have understood correctly? Or did you intend this to have functionality beyond just names?

Can I check one thing with this before progressing further - what name is displayed if no translation text has been set? There are such a large number of vehicles with classes in Pak128.Britain-Ex, it would not be desirable if each of these had to have translations set manually for text that is not "p_fare[0]" (etc.) to appear in the UI.
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.

Ranran

Quote from: jamespetts on April 15, 2022, 09:29:10 AMHowever, I think that what you describe here does not have that difficulty. This appears to be related specifically to modifying the names of different accommodations in vehicles, if I have understood correctly?
Because a common term is used for one, it may not be clear whether it refers to a fare class or a wealth class.
Secondly, there is the issue of translation. Wealth, fare and accommodation are different concepts and may not be expressed in common terms in all languages. Currently we can only assign words like Low, High which are common.
An English person would describe human height as tall, small, but a Japanese person would try to describe it as high, low. Thus, we might describe wealth as poor or rich, fare as cheap or accommodations as gorgeous or luxurious. It is difficult to come up with a word that fits them all.



QuoteOr did you intend this to have functionality beyond just names?
Still this is only the first step, but the changes are intended to make it easier for players to figure out what class they are referring to.
For example, what is the class displayed on the vehicle? Some people may mistake it for an accommodation, but it is actually a fare class.
In this patch, the rank of the accommodation is indicated by a number next to the accommodation name.
One idea for future could be to make this a symbol or color-coding to indicate the rank of the accommodation.
Five different ticket rank symbols or ticket symbols and numbers represent the rank of the fare.
I couldn't come up with a good idea for a wealth rank symbol. There was an idea of a rank insignia, but that is somewhat military... Goods colors and numbers may be appropriate.
Anyway, I think it is necessary to make it easy to understand what those "classes" refer to.
Another idea is the ability to change fares for the same accommodations at once. This implies identical facilities, not identical ranks.


Quotewhat name is displayed if no translation text has been set?
p_accommodation[n]/m_accommodation[n] as in the first post. As explained earlier, assigning the same name in English as p_class, i.e., wealth(Very low - Very High), may not be a problem. In that case, the display will remain the same as before. However, you will need to prepare a translation. But as already explained, it may be different in other languages. In other words, this division makes it possible to assign a translation to each class that is more appropriate for a particular language.

jamespetts

Thank you for the response - I think that I understand this better now. In relation to the translations, do I understand correctly that one only needs one translation of p_accommodation[n] (for each n) and m_accommodation[n] (for each n) in a pakset, rather than one per vehicle? If so, then this can easily be integrated. If one needed one translation per vehicle, this would make it too much work to integrate and there would need to be a default fallback to a user friendly text in case no translation terms were defined.

In relation to symbols for different wealth levels, this is a good idea. How about a number of coins representing different wealth levels? One coin for the lowest, and five coins for the highest, for example?
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.

Ranran

#4
Quote from: jamespetts on April 16, 2022, 05:41:35 PMIn relation to the translations, do I understand correctly that one only needs one translation of p_accommodation[n] (for each n) and m_accommodation[n] (for each n) in a pakset, rather than one per vehicle?
Yes.
If an Accommodation Name is set for the vehicle's capacity, it will be replaced by the Accommodation Name. The Accommodation Rank number will appear to the left of the Accommodation Name.

For example, if you set accommodation_name[3]=Couchette for a vehicle (in dat file), it will show [4]Couchette for [4]p_accommodation[3].
(It should be noted that although dat and code are 0-4, players perceive them as 1-5 and they are displayed as such in the GUI.)
My plan is to allow players to change fares in one go for all vehicles they own or for Couchette capacity grouped by line or home depot. This will make it easier to manage accommodations and fares.
Therefore, it would be convenient for the pakset author to give the accommodation a name that takes it into account. Perhaps real-life transportation companies also use some name to distinguish them.

This is only a stepping stone and not a major modification (symbolization) of the GUI. Thus currently it is used in a limited number of places. You can see it in the depot dialog. class manager is an old GUI and needs to be updated.
Many of the classes currently in use on GUIs are fare or wealth, all of which are distinguished by this patch.

jamespetts

My apologies: I realise that I had forgotten to look into this further. However, trying to merge this in now unfortunately results in a merge error in simversion.h - I should be grateful if you could update this to allow for testing with a view to integration. Thank you.
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.

Ranran

I believe I have resolved the conflict.
It is due to the fact that I incremented the ex minor version to make explicit the change in the version of makeobj that can be supported.

jamespetts

Excellent, thank you. Now incorporated. Apologies for the delay with this one.
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.