OpenTTD

Tasklist

FS#6597 - bad refit cost implementation

Attached to Project: OpenTTD
Opened by Michael Blunck (mb) - Thursday, 03 August 2017, 08:27 GMT
Type Bug
Category Vehicles
Status New
Assigned To No-one
Operating System All
Severity Medium
Priority Normal
Reported Version trunk
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No

Details

"refitcost" (e.g., prop 1C for trains) is incorrectly implemented. The specs says "Refit cost, using 50% of the purchase price cost base", giving the impression that 50% of the purchase cost base (£1000 for wagons, using table 4B94) corresponds to the range 0 .. 255. But in fact, it is implemented as a *factor*, i.e. "1C 01" results into a refit cost of £1000, and "1C FF" results into £255,000, which is absurd, since it would exceed the purchase price of the usual freight wagon by numbers!

In addition, the calculated refit cost value is not handled properly with regards to the actual currency, but is displayed as it is, i.e. £1000 == 1000 DM.

As a result, it is impossible to achieve proper *low* refitting costs (e.g. 1% of the purchase price), e.g. in combination with CB 15E. E.g., the lowest refit cost achievable for a small and old freight car with a purchase price of 4000 DM would be "1C 01 .. FF" -> 1000 DM. But o/c, the current implementation could also offer 255,000 DM for refitting, but who´d need that!
This task depends upon

Comment by adf88 (adf88) - Friday, 04 August 2017, 07:11 GMT
Everything is OK here. Spec clearly says that this is a factor which will be multiplied by the base.

Also ranges are all OK. You are just reading the base costs table wrong. These numbers are not in pounds. 1 base cost = 1/1024 pounds. So the base cost for wagon refitting is about £1.95.

"In addition, the calculated refit cost value is not handled properly with regards to the actual currency, but is displayed as it is, i.e. £1000 == 1000 DM." Are you sure? What did you expect and what did you see exactly? It seems to be OK, when I'm changing currencies, the refit cost is displayed correctly.
Comment by Michael Blunck (mb) - Friday, 04 August 2017, 09:08 GMT
I am talking about a "bad implementation".

Since wagon refit costs should definitely be smaller than wagon purchase prices, it makes no sense to link them to prices in the wagon price table in a static way (i.e. 50%).

The underlying problem is that table 4B94 is "fixed", i.e. it will be used for wagon purchase in any case, there´s no choice. And when using a factor for this table to get higher purchase prices, refit costs are affected as well.

In my case, I´m using a factor of 64 to get a price range up to 128,000, and therefore refit costs are absurdly high.

This problem is related to http://bugs.openttd.org/task/6581, see there.
Comment by adf88 (adf88) - Friday, 04 August 2017, 19:36 GMT
"Since wagon refit costs should definitely be smaller than wagon purchase prices" That's questionable. You have a (relatively) wide factors range for wagons (0..255) and for refits (0, 2, 4, ..., 126) with common base. It's up to GRF creator to decide. Perhaps you would like the ranges to be wider?

"it makes no sense to link them to prices in the wagon price table in a static way (i.e. 50%)." Yes, it make sense. It makes implementation simpler (i.e. less price categories) and it's like "realistic" to have refit costs and wagon costs similar since producing a wagon should cost something around modifying it, right? More expensive wagon - more expensive refit, totally with sense. If you would like to be able to set base cost mod separately, then it's another feature request.

I'm not saying that we have "good implementation" but I see no bug here. Or maybe I'm still missing something.
Comment by Michael Blunck (mb) - Tuesday, 15 August 2017, 11:51 GMT
> I'm not saying that we have "good implementation" but I see no bug here.
> Or maybe I'm still missing something.

Yes, definitely.

I was trying to explain that for "wagon purchase", there´s only *one* base price. Right? So to get somewhat reasonable purchase prices for "wagons" (and coaches!) in a set for a time frame from 1900 to 2020, and a "wagon" range from the first tiny open freight wagon to the most modern bi-level express coach, you *need* to use a base cost factor for that wagon purchase base price.

In DBXL I´m using a base cost factor of 64 to get purchase prices up to DM 255,000. Meaning that the smallest refitting cost (factor 1) would be DM 500. Which would be way to expensive for a small freight wagon in 1910, which cost only DM 3000.

> It makes implementation simpler (i.e. less price categories)

Well, this is just the typical original TTD heritage. But it makes no longer sense for a game which already got scaled with regards to game time, map size and vehicle number to keep the vehicle set developer restricted in the availability of adequate prices and costs, and thus prevent him from taking advantage of possibilities beyond original TTD.

>>> In addition, the calculated refit cost value is not handled properly with regards to the actual currency, but is displayed as it is, i.e. £1000 == 1000 DM.

Sorry about that, I forgot that "language" and "currency units" are not linked but can be set individually.

Loading...