News:

Do you need help?
Simutrans Wiki Manual can help you to play and extend Simutrans. In 9 languages.

Passenger cars of the 21st century

Started by Ters, October 05, 2012, 06:14:10 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ters

Will the look of the container depend on its contents, just like open bulk vehicles do? That would add a nice touch to such trains where lots of different goods lines are interconnected.

prissi

The km/h to tons formula is correct. But it seems the speedbonus is not what I think it should be. This gives the wrong income in the game compared to the one in the spreadsheet. I think it it due to only half of the speed is actually used or so. Otherwise I had a full convoi running at full speed the correct distance but got like 30% less than expected.

I think a corrected formula is needed anyway. The way the number came out before was quite ok for the players, so I think if the income from the spreadsheet matches again the one from the game than everything is well. Apart maybe some tweaking with pure freight locos.

About container cars: Unfourtunately those are not player colors, only the base is. That needs still to be done manually. Different containers were planned. I would like to get also liquid containers for Oil, but nobody did them so far in a recognisable way. (I may need to check my OpenTTD files though).

Ters

Had it been 30 % percent of the expected price, a certain odd division could be to blame.

I have also plugged the formulas (I think it's the right ones) from the game into my pak browser, allowing me to set up convoys and see how they should work at any given year in the game. As far as passenger trains go, after about 2005, only the double decker car seems to be profitable.

greenling

The Next NightlyPakset from pak64 comes on monday.
Opening hours 20:00 - 23:00
(In Night from friday on saturday and saturday on sunday it possibly that i be keep longer in Forum.)
I am The Assistant from Pakfilearcheologist!
Working on a big Problem!

prissi

#39
Good list shows the expected values from the XLS. But aparently the vehciles do not gain thoses incomes.

EDIT: The differences are subtle. Good list for the X2000 say 0,32 per passenger, but actual revenue is 0,3033. It seems somewhere my 10% are lost. Need to look longer at the formulas.

Ters

They are tricky these formulas. I have trouble getting my calculations to fit the game also, and I've copy-pasted most of it. Lots of "unnatural math" in order to stay integer.

prissi

Well my spreadsheet was correct until half a year or so. I think somewhat the formula was messed up. This needs to be checked before next release.

Ters

#42
Another thing is that the formulas are repeated all over the place. That way it is easy for one of them not to match up with the others. I was considering refactoring out at least some of it into a common place, but there are slight variations in how things are calculated in the goods list, in the convoy details window, and when calculating income on arrival. Perhaps one should write out the definitive formula in an unoptimized fashion, along with important notes on how this is transformed into a pute integer calculation. It might be easier to check against that. Or does this exist already?

EDIT:
The calculation in calc_speedbonus_kmh() doesn't seem to cope well with weights close to, but less than, power. As far as I can tell, when power and weight are equal, the speed (0) is less than when weight is greater than power (1).

prissi

Putting them into one place would be were nice. Maybe even have an unoptimized one for testing and an optimized one below for the use in the game. I would vote for simhalt.h ...

TurfIt

Quote from: Ters on October 16, 2012, 03:16:34 PM
The calculation in calc_speedbonus_kmh() doesn't seem to cope well with weights close to, but less than, power. As far as I can tell, when power and weight are equal, the speed (0) is less than when weight is greater than power (1).
The calculation could easily be clamped to always return at least (1).
But if the convoi is so overloaded to trigger this... not really significant effect. It's going be limited by the min payment anyways (grundwert128?).

Fifty

#45
The specifics of the code are way over my head, but, in game,

(((100MaxSpeed/BonusSpeed)-100)*BonusPercentage)+100)/1000)*GoodBasePrice


Seems to work for matching both the goods list and actual revenue. I built a test track in 2020 with a Panthress and 5 cars. The test track was 81 tiles long. By the formula above, the price per km was .3475 credits, which rounds to the goods table value of .35 credits. The base speed is 180 km/h and the bonus is 15%. The actual revenue was 8917.0 credits.

If you take the raw 2020 value, .3475 credits, you get a revenue of 9007.2 credits, close, but not exact. Now, speedbonus in 2020 is still increasing, in fact by a rate of 6.375 km/h per year. Since this test track run was was very close to February, the speedbonus base speed had actually increased a bit, to a little over 180.5 km/h. This reduces the revenue per km to about .3462 credits. Using this value you get 8974.97 for total revenue. Close, but not quite.

Then I started playing around with numbers, and it seems that simutrans actually counted the total distance as 80.5 tiles. Unclear why, but using 80.5 tiles and the revenue of .3462 credits, I calculated a revenue of 8919 credits, only 2 credits away from the actual value.

So Perhaps, the formulas have not changed after all: the constant increase of speedbonus and this odd way of calculating .5 tiles too few of revenue is throwing off revenue in your testing, prissi.

If the formula above is correct, then this formula in the XLS must be incorrect:

(1+((100*MaxVelocity/BonusSpeed)-100)*(BonusPercentage/1000))*(MaxVelocity/100)

EDIT: I can upload this test track save if you want to take a look at the behavior.

EDIT 2: Just looked at the nightly, the new trailers look nice, but the paper and steel ones are flipped (the one with paper takes steel and vice-versa)
Why do we park on the driveway and drive on the parkway?

TurfIt

IIRC the speedbonus is only updated yearly each Jan 1st.

Integer calculations in the code will introduce some differences vs if you use floating point ala Excel. The spreadsheet I'm using for checking forces int where needed; And matched 100% the in game revenue, but I've not looked in ~2 years if somethings changed...

Note the distance is applied on a per vehicle basis. The distance travelled by each car in the convoy is tracked seperately starting from their position when loading. If the train turns around before starting its journey, and then heads straight into the destination station, the cars at the end will have travelled less distance than the front front.

Ters

My attempt at getting to the core of the formula gave me:
speedFactor = convoySpeed/referenceSpeed - 1
price = basePrice * (1 + 10 * speedFactor * speedBonus) / 3

Note that here 100% = 1 (affects speedFactor and speedBonus). I've just run a simple test against the goods list in the game, and except from speedFactor being off by 1 (not sure if that's because the goods list calculates backwards here), it yielded the correct result.

Fifty

Quote from: TurfIt on October 17, 2012, 05:02:01 PM
Note the distance is applied on a per vehicle basis. The distance travelled by each car in the convoy is tracked seperately starting from their position when loading. If the train turns around before starting its journey, and then heads straight into the destination station, the cars at the end will have travelled less distance than the front front.

Ah, that makes sense: because of my setup, the average car traveled 80.5 km, while the locomotive traveled 81. So, the formula would give 8951.6 for revenue, only a 0.3% difference, which must be due to integer rounding.
Why do we park on the driveway and drive on the parkway?

Ters

I agree with Fifty that the graphics for the paper and steel trailers have been mixed up. Easy to fix without one, but I've attached a patch nonetheless.

I've also attached another patch for the X2000. That patch wasn't as important as I thought it might be. Although unable to reach maximum speed, my overlong X2000s still generate a nice profit, and a double set with enough cars to cover the running cost of additional locomotive might be too long for my platforms. Still, realistically, it should be possible to combine two X2000s, and other players might like longer platforms than me.

prissi

In reality X2000 were never coupled, since the swedish platforms would not have allowed for that. But if it helps gamesplay, why not.

I will check the XLS and apply new values depending on the outcome of it. Hopefully tomorrow, so a new corrected release can be done.

Fifty

In the same vein as Ters' request, I would suggest that the SD40-2 allow more than 2 locomotives back-to-back, as triple or quadrouple headers were (and still are, maybe not completely dash 2s anymore) common on US railroads.

I've changed this setting and re-paked to allow me to use more than 2 locomotives in game; I don't know how to make a patch file, but all that needs to be added to the dat of the SD40-2 Back is:

Constraint[Prev][1]=SD40-2-back
Why do we park on the driveway and drive on the parkway?

Ters

Quote from: prissi on October 19, 2012, 10:26:57 PM
In reality X2000 were never coupled, since the swedish platforms would not have allowed for that. But if it helps gamesplay, why not.

Actually, it was a picture of a 5 car X2000 coupled to a 4 car X2000 that prompted me to make the change. Judging by the comment made by a person working as conductor in Sweden (I think it was he who posted the picture), it didn't seem unusual. Most (but not all) pictures in the gallery the picture was posted in feature a single X2000, but it is very common for the covering over the coupling to be removed. The Norwegian descendants of X2000 routinely run two together, even if that's not the norm. They have a fixed length that might shorter than a typical X2000, though.

How much it helps gameplay, I don't know. It wasn't as much help to me as I thought.

prissi

Oh, sorry, when I added the X2000 I found six cars, single unit. Sicne those are (internally) more like engine and normal cars, any size variation (and coupling) should be possible. Thank you for that.

Still have to do proper rebalancing to do.

Ters

Makes me wonder whether one (in real life) can put an X2 (X2000 actually seems to be a brand name for high speed lines) locomotive in both ends. I have also seen a photo of just the locomotive unit driving around, but I think it's quite okay for Simutrans+pak64 to require one or more full sets with just one locomotive per set.

(I also found the image: http://www.jernbane.net/bo/subpage.php?s=0&id=159263 Looks like it was 5+6, not 5+4, locomotives not included. The photographer wrote that it was train 428 between Stockholm and Göteborg/Gothenburg with 114 1st class and 430 2nd class seats.)

greenling

Ters
The Photo it up to date it was be make at 07.09.2012 it.
Opening hours 20:00 - 23:00
(In Night from friday on saturday and saturday on sunday it possibly that i be keep longer in Forum.)
I am The Assistant from Pakfilearcheologist!
Working on a big Problem!

prissi

#56
OK, I found the error. The data in the spreadsheet were using the raw values from good prices (0.15) so the /3 was omitted. Aparently when that change was added, the /3 was not added to the list. Simplest solution is multiply all prices by a factor.

EDIT: But the goods file still has 0,45 written. Using the 1/3 in the list should give the right result. One time 1/3 too many crept in. That should actually affect all paks ...

In the Excel, I used the indicated prices. However, the price in the good list I only get with the 1/3 ???

EDIT: To make it more clear: In Excel, I only get the correct result, when I use 15 as the good price, but keep the division by 3.

prissi

Excel and most pak files are fixed by now. I will work on the container trailers.

Ters

Good work.

A recent thing I've begun wondering about is whether the most profitable way to transport mail inside a city is by train. Modern mail truck and trailer can't reach more than half of max speed inside a city, while trains are not restricted in that way.

prissi

A very good remark. That is not factored into the costs of the mail trucks.

Ters

All this time, I just thought it was that way to prevent mail trucks from being too profitable outside cities.

Fifty

I wonder also if it is factored into the costs of busses? Particularly the jointed bus seems to have fairly high running costs to run inside of a city at 50 km/h.

For mail, moblet and I made a profit in the later years with a fairly large network in this netgame if you want to look (RF&P):
http://entropy.me.uk/simutrans/networksavegames/sim64b/sim64_r5583_pak64-r810_05_09_2012.sve
I used the old "copy convoy" trick to keep the old mail trucks for use in cities, and still made good profit. Now that we have a semitrailer for long-distance hauling, you could lower the max speed of the newer mail truck. I know here in the USA at least many of our mail delivery vans top out at ~80km/h.

The mail container wagon in this game is the reason I suggested flattening the speedbonus curve. It made a killing in 1970 at .29 credits per km at 140 km/h, But in the later years, it makes a reasonable profit at 140 km/h at less than a third of the revenue, only .08 credits per km. Because pak 64 has a relatively limited selection of vehicles, many need to span a long number of years and thus tend to be either too cheap at entry or too expensive in later years.

Also in this game, you can see another player using the panthress profitably for freight service, and Garratts still in service in 2174: iirc in cars.xls it has a considerably higher running cost for garratt, this needs to be fixed in-game because these locomotives are very lucrative.
Why do we park on the driveway and drive on the parkway?

Ters

The jointed bus doesn't have as high max speed, and from my experience, it can be profitable while for mail trucks that seems impossible. Lowering the speed of the mail truck seems like a good idea to me.

prissi

The mail truck has 60kmh and city roads is 50kmh. That is in the calculation.

The garrat cost were increased.

Fifty

Thank you for your hard work prissi!

The 60 km/h mail truck is retired in the 1970s: perhaps that retire date could be removed? I was talking about dropping the max speed and cost of the 100 km/h (HVPosttransporter) mail truck to make it essentially a replacement for the older one if you don't remove the retire date.
Why do we park on the driveway and drive on the parkway?

greenling

Fifty
That´s it a very good idea they you speak on.
Opening hours 20:00 - 23:00
(In Night from friday on saturday and saturday on sunday it possibly that i be keep longer in Forum.)
I am The Assistant from Pakfilearcheologist!
Working on a big Problem!

Ters

The containers cars for boxed goods seem to be working fine for me now.

Though not part of the pak64 core, another thing that seems to break down around 2025 are cooled goods on trains. At least one of them (I don't remember if it's meat, fish or both) become even less profitable than paper. The challenge might be that for trains, speeds for passengers and freight diverge extremely towards the end, and the speed bonus follows the former.

prissi

Maybe best to reintroduce the same car with different costs ...