Feature #2175

Parameter for train type availability

Added by Terkhen over 8 years ago. Updated over 8 years ago.

Status:NewStart date:2011-01-14
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-

Description

It would be quite nice to allow to enable/disable what train types to use via parameter. This would permit to use the 2cc train set more easily along with other sets, by for example enabling only metro trains.

screenshot.png (185 KB) planetmaker, 2011-01-17 11:41

History

#1 Updated by Voyager1 over 8 years ago

Nice idea but a big problem. I've tried to suggest something like that in the forums... see here:

http://www.tt-forums.net/viewtopic.php?f=32&t=52045

#2 Updated by Terkhen over 8 years ago

I meant a NewGRF parameter for 2cc (to allow to decide which types of train engine are used ingame) not a filter in OpenTTD for displaying less vehicles. Something similar to Feature #56, but for train types instead of train regions. IMO both settings would not be in conflict: someone could for example want to use only InterCity and Commuter trains of Europe.

#3 Updated by planetmaker over 8 years ago

It's two completely different things.

Your suggestion in the forum is to add some filtering to OpenTTD.

Terkhen's very valid suggestion is to add to the 2cctrainset a newgrf parameter which cuts down the available engines, giving the player a choice to only play with a subset of the 2cctrainset.

#4 Updated by DJNekkid over 8 years ago

I know. With the latest drawingspree of Voyager1 and Emperor Jake (and possible more) there certainly is a need to add inn some parameter system to limit the selection. Just how have I not decided yet, but the old regional parameter might be a part of it, and some new one might also be.
But im not sure if we need so many regions as we used to. There were 4 eurpoean regions, 2 american, and 3 others. What about:
*Europe: None | Western | Eastern | Both (default) - Remove Scandinavia and southern, and maybe after 1990ish (2000?) everything is just "europe" as more and more stock is built in (an example) Switzerland and used in Romania
*America: On (default) | Off - Do we need to separate north and south? There arent to many south engines, and as far as ive understood, most south stock is US built.
*Other: None | Africa | Asia | Oceania | Af/As | Af/Os | As/Os | All

That is the regions, then to the rolling stock:
*Engines: Steam | Diesel and Gas | Electric | S/D | S/E | D/E | All
*Engines: None | Shuntes | Freight | Pax | All
*MUs: Diesel and Gas | Electric | Both
*MUs: None | Regional | Intercity | Both
*Railbus: None | Diesel | Electric | Both

But I guess now the question is, how is the support for bitmasks and action14's ? This will probably be hard without just that.
I assume it would be something along theese lines:

-1 * -1 14 "C" "INFO"
"C" "PARA"
"C" PARAM0_D // Parameter 0
"T" "NAME" LANG_ID A14_PARAM0_NAME 00
"T" "DESC" LANG_ID A14_PARAM0_DISC 00
"C" "VALU"
"T" \d0 LANG_ID A14_PARAM0_VALU0 00 // Value Bit0
"T" \d1 LANG_ID A14_PARAM0_VALU1 00 // Value Bit1
"T" \d2 LANG_ID A14_PARAM0_VALU2 00 // Value Bit2
"T" \d4 LANG_ID A14_PARAM0_VALU3 00 // Value Bit3
"T" \d8 LANG_ID A14_PARAM0_VALU4 00 // Value Bit4
00
00
00
00
00

#5 Updated by Voyager1 over 8 years ago

Sorry, I've misunderstood you before Terkhen.

Now that I do, all I can say is good idea!

#6 Updated by DJNekkid over 8 years ago

Voyager1 wrote:

Sorry, I've misunderstood you before Terkhen.

Now that I do, all I can say is good idea!

any idea about parameters and how we can limit the chouise of engins voy1?

I dont mind if you dont know the techincal stuffs, thats up to me, and if it isnt, i hope the other guys can help me (as they usually do if im in a territory im not familiar with :D <3 devs)

</drunk>

#7 Updated by DJNekkid over 8 years ago

DJNekkid wrote:

Voyager1 wrote:

Sorry, I've misunderstood you before Terkhen.

Now that I do, all I can say is good idea!

any idea about parameters and how we can limit the chouise of engins voy1?

I dont mind if you dont know the techincal stuffs, thats up to me, and if it isnt, i hope the other guys** can help me (as they usually do if im in a territory im not familiar with :D <3 devs)<(fro

</drunk>

  • - Frosch, Yexo and Rubidium amongst others :D

<3 Beer

#8 Updated by Voyager1 over 8 years ago

The only idea I have is that one I've tried to suggest on the forums.

Assign an additional parameter for every "type" of engine. That number is always a double of the previously assigned number

I.e.
Steam engines - "1"
Diesel & gas locomotives - "2"
Electric locomotives - "4"
Railbuses - "8"
DMUs - "16"
EMUs - "32"
Metros - "64"
Maglevs - "128"

You add those numbers to get a "final" parameter for availability:
I.e.
"7" can be achieved only by adding 4+2+1 and it would mean steam, diesel and electrics
"129" can be achieved only by adding 128+1 and it would mean maglevs and steams
"76" can be achieved only by adding 64+8+4 and it would mean metros, railbuses and electrics
"49" can be achieved only by adding 32+16+1 and it would mean EMUs, DMUs and steamers

There are only that many combinations possible for that "final" parameter so there could be absolutely no mistakes. See what Pikka has done for his av8 parameters, it's pretty much the same idea.

#9 Updated by Voyager1 over 8 years ago

I've forgotten:
A "final" parameter "0" would mean all engines available.

#10 Updated by planetmaker over 8 years ago

Voyager1 wrote:

The only idea I have is that one I've tried to suggest on the forums.

Assign an additional parameter for every "type" of engine. That number is always a double of the previously assigned number

Requiring the user to make a calculations in order to get the parameter right is quite 2008 and referencing a deprecated user interface which is not user friendly at all. What you propose is basically a list of boolean yes/no decisions and should be implemented as such in the interface. The internal representation of the parameter should not concern the user and may well be such bit mask (and that is effectively what you suggest).

Pikka (and others) used this approach when it was not possible to do better and more user friendly. If you look at his new newgrfs he makes uses of the power of the new parameter interface, too.

#11 Updated by planetmaker over 8 years ago

DJNekkid wrote:

*Europe: None | Western | Eastern | Both (default) - Remove Scandinavia and southern, and maybe after 1990ish (2000?) everything is just "europe" as more and more stock is built in (an example) Switzerland and used in Romania
*America: On (default) | Off - Do we need to separate north and south? There arent to many south engines, and as far as ive understood, most south stock is US built.
*Other: None | Africa | Asia | Oceania | Af/As | Af/Os | As/Os | All

I'd implement these probably as value lists, it would allow for more details. I'd reserve a separate parameter for each region specification then;
Though you might just as well add 5 booleans:
america
western europe
eastern europe
africa+australia
asia

That is the regions, then to the rolling stock:
*Engines: Steam | Diesel and Gas | Electric | S/D | S/E | D/E | All
*Engines: None | Shuntes | Freight | Pax | All
*MUs: Diesel and Gas | Electric | Both
*MUs: None | Regional | Intercity | Both
*Railbus: None | Diesel | Electric | Both

I'd add these as separate parameter lists with the individual choices as separate strings (each of those engine types a separate parameter), too. Then these selections are no issue.

It'd leave you with like 3+5 or 5+5 parameter lines, however you chose to implement region availability. That's quite acceptable.

#12 Updated by Voyager1 over 8 years ago

I know, it's not very user friendly but that's all I can come up right now. BTW, Pikka's AV8 still uses this type of parameters.

The only other thing I can imagine is making a special GUI window for choosing these settings.

America - I agree on just one complete
Europe - OK
Africa + Australia - maybe to separate them after all?
Asia - OK

Rolling stock - THB I don't know. Do we need this at all?

#13 Updated by Terkhen over 8 years ago

Voyager1 wrote:

Rolling stock - THB I don't know. Do we need this at all?

The region parameters make the set itself customizable, but the rolling stock settings would make it easier to use 2cc with other sets. In my case, I want to use the metro trains with other train sets. IMO it does not need a lot of options; I would be happy with just a setting for each type (without separating between steam, electric and so on).

#14 Updated by planetmaker over 8 years ago

Voyager1 wrote:

I know, it's not very user friendly but that's all I can come up right now. BTW, Pikka's AV8 still uses this type of parameters.

Where?

#15 Updated by DJNekkid over 8 years ago

I do have an idea in my head how this could be done in a nice userfriendly way, but i need to test it out abit first :)

#17 Updated by Purno over 8 years ago

Is there a limit on the amount of parameters a GRF can have?

I don't think adding numbers like Av8 does is userfriendly, it seems Av8 chose that to be TTDPatch compatible. (Which I think we are not, considering the huge amount of VehIDs we use? :P )

If there's no limit on the amount of parameters, we could just use the ingame GUI and do a seperate parameter for each region? Kinda like;

European vehicles: Available / Unavailable
African vehicles: Available / Unavailable
American vehicles: Available / Unavailable
Asian vehicles: Available / Unavailable

that kinda looks very user friendly :P

Also available in: Atom PDF