[OTTD] PolTrams: newgrf with Polish trams

Discuss, get help with, or post new graphics for TTDPatch and OpenTTD, using the NewGRF system, here. Graphics for plain TTD also acceptable here.

Moderator: Graphics Moderators

Wahazar
Tycoon
Tycoon
Posts: 1451
Joined: 18 Jan 2014 18:10

[OTTD] PolTrams: newgrf with Polish trams

Post by Wahazar »

Three years ago small set of Polish trams was created by Sojita with use of GRF Maker:
Image
Due to some GRF Maker limitations, this set has some graphical glitches related to articulated trams, moreover, set was not suitable to work with ECS tourists.
Difference of purchase and running costs of trams with and without trailers were flat due to limited cost span.
There were also some other flaws: low capacity and very low loading speed.
When cargodist was introduced in stable version, needs for efficient urban transport led me to refurbish this tram set with use of NML and add some missing vehicles
(original set has only post-war trams).

Additionally, some new features were implemented.

New set have different approach to trailers: instead of separate vehicles with and without trailers, you can buy single car
and use refit to purchase additional trailer(s).
Such approach help to keep purchase list relatively short.
Once vehicle is refitted to more trailers/units, you can use autoreplace and new vehicle will inherit consist of replaced vehicles,
if such refit is supported by the given vehicle.
To distinguish which vehicle have capability to change consist, there is refit icon in the tram purchase menu.
Vehicle image on purchase menu depict maximal number of trailers/units available via refit procedure:
Image

Because both sitting and standing places are counted, overall capacity of tram with additional trailers can exceed 400.
To avoid misuse of trams instead of long distance trains, which was mentioned here: http://www.tt-forums.net/viewtopic.php?f=31&t=70070
I decided to decrease cargo_age_period - travelling on large distances in overcrowded tram is not comfortable thus passengers would be stow instead of pay fare. Modern air-conditioned trams have larger cargo_age_period, but still lower then train standard.

Running cost are calculated using following formula:

Code: Select all

#define basic_running_cost(m, v)  STAFF_RUNNING_COST + m * (1296 + v * v) / 2592     // m [t], v [km/h]
It works pretty well, because usually tram with high capacity is heavy, vehicle with higher speed earn money twice (larger single income and troughput).
After refit, because trailers weight is added, running costs are increased (but due to constant staff running cost, tram with trailers is cheaper then two single motor cars).
Old type, rheostat controlled trams have fixed running costs (vmax is taken into account), whereas actual speed is used for running cost switch in case of fast modern trams with thyristor control and energy recuperation.
Is is useful for tweaking running costs/income in case of low passenger streams.
For example, if you have timetabled trams, after autoreplace to faster model, you need to rebuild all timetable.
With dynamic running cost, you can set timetable maximal speed to match previously used model without much vast of money.
Of course please note that above discussed formula is not linear - it is quadratic with large constant base.
Noticeable differences are only for speed slightly lower than maximal.
Passenger income would be also lower. Decreasing of running cost via "economic speed" make sense only if trams are almost empty.

Currently set cover vehicles within 1912-2014 time span, the latter 120N Pesa Swing (courtesy of Voyager One) and NGt8 Bombardier never expire.

I have plans to add some cargo cars to this set, more specifically "work trams", but with limited functionality - only goods (or MNSP, ENSP etc).

I would be very grateful for any correction of english.lng file, because it is not my native language.
Potrams newgrf v.8 is available via content online and its source was maintained here:
http://dev.openttdcoop.org/projects/poltrams
now was moved here:
https://github.com/Wahazar/openttd-newgrf-poltrams
Last edited by Wahazar on 23 Dec 2020 23:00, edited 1 time in total.
Formerly known as: McZapkie
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, wired, ECS industry extension, V4 CEE train set, HotHut.
Another favorite games: freeciv longturn, OHOL/2HOL.
Transportman
Tycoon
Tycoon
Posts: 2781
Joined: 22 Feb 2011 18:34

Re: [OTTD] PolTrams: newgrf with Polish trams

Post by Transportman »

Nice to see more people recoding old things.

Just some minor corrections on your english.lng:
STR_GRF_DESCRIPTION: graphics instead of graphic
STR_PARAM_DESC_PURCHASE_COST: costs instead of cost
STR_PARAM_DESC_RUNNING_COST: costs instead of cost
STR_PARAM_DESC_KEEP_OLD_VEHS: other set instead of another

Several vehicle strings contain "up to x MU", but I think "up to x units" would be better. Also, various strings start with a space, not sure if that is intended.

What is the range of running costs you have in this set? Is there a large difference between running costs or are they close to each other?
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: [OTTD] PolTrams: newgrf with Polish trams

Post by Alberth »

Be careful with #define arguments. It's literal text replacement, so

Code: Select all

basic_running_cost(5+1, 3+2)
becomes

Code: Select all

STAFF_RUNNING_COST + 5+1 * (1296 + 3+2 * 3+2) / 2592
which may not be what you want. Also, I removed your comment, but I am not sure that actually happens, it may become part of the replacement, and get copied too. For safety, it's probably better to move that comment to above the #define.

You can fix the problem with the parameters by adding a few parentheses:

Code: Select all

// m [t], v [km/h]
#define basic_running_cost(m, v)  STAFF_RUNNING_COST + (m) * (1296 + (v) * (v)) / 2592
Being a retired OpenTTD developer does not mean I know what I am doing.
Wahazar
Tycoon
Tycoon
Posts: 1451
Joined: 18 Jan 2014 18:10

Re: [OTTD] PolTrams: newgrf with Polish trams

Post by Wahazar »

Thank you for corrections. Of course there should be unit instead of multiple unit.
Transportman wrote: What is the range of running costs you have in this set? Is there a large difference between running costs or are they close to each other?
Difference depend on mass and velocity, for example:
Konstal N 1947: 81 pax, 40 km/h, 351 GPB/yr
same after refit to N+2 ND trailers: 244 pax, 36 km/h, 478 GPB/yr (constant running cost)
Bombardier NGT8 2014: 225 pax, 80 km/h, 717...2207 GPB/yr depending on velocity.
Formerly known as: McZapkie
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, wired, ECS industry extension, V4 CEE train set, HotHut.
Another favorite games: freeciv longturn, OHOL/2HOL.
Transportman
Tycoon
Tycoon
Posts: 2781
Joined: 22 Feb 2011 18:34

Re: [OTTD] PolTrams: newgrf with Polish trams

Post by Transportman »

Alberth wrote:Also, I removed your comment, but I am not sure that actually happens, it may become part of the replacement, and get copied too. For safety, it's probably better to move that comment to above the #define.
Everything on the line* after a #define is part of it, so the comment would also be part of it. It is indeed better to leave the comment out of the #define.

*When the last character on a line is a \, the #define also includes the next line and so forth until it finds a line that ends without a \. I use that in the 2cc TrainsInNML set for the sorting order.
McZapkie wrote:Difference depend on mass and velocity, for example:
Konstal N 1947: 81 pax, 40 km/h, 351 GPB/yr
same after refit to N+2 ND trailers: 244 pax, 36 km/h, 478 GPB/yr (constant running cost)
Bombardier NGT8 2014: 225 pax, 80 km/h, 717...2207 GPB/yr depending on velocity.
Okay, that seems okay, I just wanted to be sure that you get some variety in cost factors, and not have a dominant STAFF_RUNNING_COST compared to the mass/speed part
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML
Wahazar
Tycoon
Tycoon
Posts: 1451
Joined: 18 Jan 2014 18:10

Re: [OTTD] PolTrams: newgrf with Polish trams

Post by Wahazar »

Alberth wrote:Be careful with #define arguments. It's literal text replacement
Ups, you hit the point. I didn't noticed that bug because accidentally results were similar to expected.
Note to myself: always check .nml precompiled file.
Formerly known as: McZapkie
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, wired, ECS industry extension, V4 CEE train set, HotHut.
Another favorite games: freeciv longturn, OHOL/2HOL.
Wahazar
Tycoon
Tycoon
Posts: 1451
Joined: 18 Jan 2014 18:10

Re: [OTTD] PolTrams: newgrf with Polish trams

Post by Wahazar »

Version 1.00 available on bananas.
There is 15 passenger trams available and additionally 4 worktrams (for CC_EXPRESS cargoes).
Formerly known as: McZapkie
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, wired, ECS industry extension, V4 CEE train set, HotHut.
Another favorite games: freeciv longturn, OHOL/2HOL.
User avatar
Voyager One
Tycoon
Tycoon
Posts: 11204
Joined: 28 Dec 2009 09:47
Location: Rijeka, Croatia

Re: [OTTD] PolTrams: newgrf with Polish trams

Post by Voyager One »

Hey people! I've been translating this set to Croatian and I've applied for Italian translation as well but I'm getting "No access" for this set. Can I ask for a change please. :)
Leon

Image Image Image Image
"... all I ask is a tall ship and a star to steer her by..." - John Masefield
Wahazar
Tycoon
Tycoon
Posts: 1451
Joined: 18 Jan 2014 18:10

Re: [OTTD] PolTrams: newgrf with Polish trams

Post by Wahazar »

I added Italy translation group to Italy translation role (and fixed some others translation assignments), hope it is working now.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: [OTTD] PolTrams: newgrf with Polish trams

Post by planetmaker »

If you select "inherit members" in http://dev.openttdcoop.org/projects/poltrams/settings then all translators registered with DevZone can help you. Not sure whether you (de)selected that checkbox intentionally
Supercheese
Tycoon
Tycoon
Posts: 1660
Joined: 16 Dec 2007 22:24
Location: Idaho, USA

Re: [OTTD] PolTrams: newgrf with Polish trams

Post by Supercheese »

It seems like you need to set some sound effects for the trams in this set, because the version on Bananas just has the fallback sound effect of a "splash", which happens when no sfx are defined in the code.

You can choose from one of the default sound effects or of course make your own. Places like freesound.org have some good material that are often useful.
Eyecandy Road Vehicles | Fake Subways | Supercheese's NewObjects

"Fashions and cultures change, but steam trains shall always be majestic."
-Professor Hershel Layton
Wahazar
Tycoon
Tycoon
Posts: 1451
Joined: 18 Jan 2014 18:10

Re: [OTTD] PolTrams: newgrf with Polish trams

Post by Wahazar »

There is sound_effect property or sound event callback. Whereas I understand the last one, I dont know, how sound_effect works - if defined - when is played?
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5602
Joined: 13 Sep 2004 13:21
Location: The Moon

Re: [OTTD] PolTrams: newgrf with Polish trams

Post by PikkaBird »

McZapkie wrote:There is sound_effect property or sound event callback. Whereas I understand the last one, I dont know, how sound_effect works - if defined - when is played?
Any event the default vehicles make a sound, I'd guess (leaving a station or depot, for road vehicles) - and unless the callback returns a result for the event.
Wahazar
Tycoon
Tycoon
Posts: 1451
Joined: 18 Jan 2014 18:10

Re: [OTTD] PolTrams: newgrf with Polish trams

Post by Wahazar »

If event callback is used, it will play sound regardless of game settings?
Personally I'm playing without sounds and all "extra" sounds are annoying.
Is SFX setting available for NML or special additional newgrf parameter setting is necessary?
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5602
Joined: 13 Sep 2004 13:21
Location: The Moon

Re: [OTTD] PolTrams: newgrf with Polish trams

Post by PikkaBird »

McZapkie wrote:If event callback is used, it will play sound regardless of game settings?
What game settings did you have in mind? Obviously it won't play a sound if you have the sound off...
Wahazar
Tycoon
Tycoon
Posts: 1451
Joined: 18 Jan 2014 18:10

Re: [OTTD] PolTrams: newgrf with Polish trams

Post by Wahazar »

PikkaBird wrote: What game settings did you have in mind? Obviously it won't play a sound if you have the sound off...
Newgrfs like Sailing Ships, are making noise regardless of soundsset = "NoSound"
Supercheese
Tycoon
Tycoon
Posts: 1660
Joined: 16 Dec 2007 22:24
Location: Idaho, USA

Re: [OTTD] PolTrams: newgrf with Polish trams

Post by Supercheese »

McZapkie wrote:
PikkaBird wrote: What game settings did you have in mind? Obviously it won't play a sound if you have the sound off...
Newgrfs like Sailing Ships, are making noise regardless of soundsset = "NoSound"
That is because they define their own custom sfx and do not rely on the base sound set.
Eyecandy Road Vehicles | Fake Subways | Supercheese's NewObjects

"Fashions and cultures change, but steam trains shall always be majestic."
-Professor Hershel Layton
Wahazar
Tycoon
Tycoon
Posts: 1451
Joined: 18 Jan 2014 18:10

Re: [OTTD] PolTrams: newgrf with Polish trams

Post by Wahazar »

Supercheese wrote: That is because they define their own custom sfx and do not rely on the base sound set.
Yes, and because I also need to define own sounds (ring depend on tram era), therefore my question was as follows: "Is SFX setting available for NML?"
However instead of checking SFX settings itself, better idea is just to check [sound] section vehicle = true/false
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5602
Joined: 13 Sep 2004 13:21
Location: The Moon

Re: [OTTD] PolTrams: newgrf with Polish trams

Post by PikkaBird »

McZapkie wrote:therefore my question was as follows: "Is SFX setting available for NML?"
You still haven't really explained what you mean by "SFX setting".

If you mean "which base sound set is being used", then that information is not available to newGRFs for exactly the same reasons as "which base graphic set is being used" is not.
Eddy Arfik
Transport Coordinator
Transport Coordinator
Posts: 260
Joined: 09 Apr 2014 11:10

Re: [OTTD] PolTrams: newgrf with Polish trams

Post by Eddy Arfik »

McZapkie wrote:If event callback is used, it will play sound regardless of game settings?
Personally I'm playing without sounds and all "extra" sounds are annoying.
Is SFX setting available for NML or special additional newgrf parameter setting is necessary?

...

Newgrfs like Sailing Ships, are making noise regardless of soundsset = "NoSound"
I sometimes play without sounds so I can watch videos or such without interference, but it seems strange to do that by disabling the soundset, most modern OS have sound mixer that can adjust/mute volume on a per-task basis, also the game has a built-in volume control slider.
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: No registered users and 72 guests