Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Apparent Infrastructure costs desych between host and client companies #9805

Open
FilmBoy84 opened this issue Feb 1, 2022 · 7 comments
Labels
needs triage This issue needs further investigation before it becomes actionable

Comments

@FilmBoy84
Copy link

Version of OpenTTD

12.1

Expected result

Both Host and Client Infrastructure Costs should be synched - or at least follow the same rules

Actual result

Across several games, all using different NewGRFs, the Host system Infrastructure Costs are considerably higher - often 3-5x the costs of any other player EVEN IF THEY START IN SYNCH.

Steps to reproduce

  1. Using the attached NewGRFs List as an example (it can be replicated with other sets, such as Timberwolf's Tracks) host a new local MP game
  2. Add a client or two on other systems, each running their own companies
  3. Build enough railway infrastructure in each company to warrant an annual cost - ideally, build identical lengths and track combinations
  4. Check the annual Infrastructure costs list (Company -> Details) between the companies
  5. It should become apparent the host company pays more

SAVEGAME ATTACHED
NEWGRF LIST ATTACHED
OPENTTD CONFIG ATTACHED

image
JDMS 6 (NARS Alpine 1850).zip
JDMS6 NewGRF List.txt
openttd config.zip

@James103
Copy link
Contributor

James103 commented Feb 1, 2022

This can be reproduced in Single player:

  1. Start a new game with infrastructure maintenance. This can be done without any NewGRFs.
  2. Build some maglev.
  3. Open up the infrastructure details. Divide the maintenance cost for maglev by the number of maglev and store it as A.
  4. Build a lot more maglev.
  5. Open up the infrastructure details. Divide the maintenance cost for maglev by the number of maglev and store it as B.
  6. Check that B > A, thereby proving that the per-unit maintenance cost goes up as quantity increases.

@FilmBoy84
Copy link
Author

FilmBoy84 commented Feb 1, 2022

I recognise some of it will be due to tiles being more complex (points, etc.)
However, the cost increase between host company and client company is always disproportionate it seems

In some MP games it can render the Host Company unable to build certain track types as their costs skyrocket in comparison to the cost to client companies who can build the same track types at a lower cost per tile

@glx22
Copy link
Contributor

glx22 commented Feb 1, 2022

Maintenance cost varies with number of owned tracks and it's not linear https://github.com/OpenTTD/OpenTTD/blob/master/src/rail.h#L430

@FilmBoy84
Copy link
Author

FilmBoy84 commented Feb 1, 2022

Thanks for prompt response - I gathered this was a factor

It does still not explain the vast gap between Host Company and and Client Companies though

It also shouldn't mean that to the host, whole track/road types become unavailable due to prohibitive costs BEFORE ANY OF THAT TYPE HAS BEEN BUILT

For example, in the save I attached above, 5 tiles of Maglev (none is already built) is over £40,000 for that amount of straight track

But for the Client Companies, also with no Maglev, it's around £16,000 for the same 5 tile straight

Indeed, in both cases, this makes Maglev none-viable for both parties, but the disconnect between the Host and Client companies for cost is vast

Infrastructure maintenance should NOT render entire modes of transport unavailable to a company by the time their introduction comes along

@TrueBrain
Copy link
Member

Just to check, the different currencies in your last reply are intentional? Dollar vs pound?

@FilmBoy84
Copy link
Author

FilmBoy84 commented Feb 1, 2022

Sorry my mistake, yeah, they're approximations of the £ cost
As you will see from the save, that's what I'm in :)

EDIT: Updated comment to better reflect the issue

@James103
Copy link
Contributor

James103 commented Feb 1, 2022

I just checked, and for rail, road, and their associated components, the infrastructure maintenance cost is proportional to O(x3/2), as deduced from the num * (1 + IntSqrt(total_num)) appearing in most such formulas.

@2TallTyler 2TallTyler added the needs triage This issue needs further investigation before it becomes actionable label Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage This issue needs further investigation before it becomes actionable
Projects
None yet
Development

No branches or pull requests

5 participants