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

Industry build cost does not take into account land clear costs #8215

Open
James103 opened this issue Jun 11, 2020 · 7 comments
Open

Industry build cost does not take into account land clear costs #8215

James103 opened this issue Jun 11, 2020 · 7 comments

Comments

@James103
Copy link
Contributor

@James103 James103 commented Jun 11, 2020

Version of OpenTTD

1.10.2 (and others)

Expected result

When funding a new industry, not only is the cost of building the industry itself deducted, but so does the cost to clear all of the tiles that the industry will occupy. For example, a company with exactly £150,000,000 tries to build a Forest, whose cost is £150,000,000. The action should fail with "Not enough cash, requires £150,000,270".

Actual result

When funding a new industry, the cost to clear all of the tiles that the industry will occupy is not taken into account when calculating the cost of building the industry. This can cause some problems - mainly, if clearing 16 grass tiles costs more compared to building an iron ore mine, that isn't taken into account when building said iron ore mine.

Steps to reproduce

  1. Use the BaseCosts newGRF to set "build raw industry" to x32.
  2. Set the game setting for the build raw industry mode to "As other industries".
  3. Start a new game.
  4. Cheat in exactly £150,000,000 and repay your loan.
  5. Do not do any other actions that affect your money.
  6. Open the fund new industry menu and select the "Forest" industry.
  7. Attempt to build the industry.
@andythenorth
Copy link
Contributor

@andythenorth andythenorth commented Jun 11, 2020

Thanks!

Do you have a proposal for how to display the new calculation of cost to the player?

Perhaps in the industry fund menu?

Using your example, the fund menu should show 'Forest: cost £150,000,270'?

@auge8472
Copy link
Contributor

@auge8472 auge8472 commented Jun 11, 2020

What exactly should be shown in the menu? The price for tile clearing will differ depending from the chosen place to place (pun intended). The clearing costs for a 12-tile industry planned to be built on only grass tiles will be different from the clearing costs when 5 of the tiles are populated with one tree each or from the costs when two if the tiles are populated with three trees each and one with four trees.

The overall cost is unknown until the moment one have chosen the area to place an industry. That said it would make IMHO more sense to create a popup dialogue that asks "Want you really build [industry] for [overall cost]?" or to calculate the price with the highest possible clearing cost per tile in mind (building cost (max) = industry_cost + clearing_cost).

@andythenorth
Copy link
Contributor

@andythenorth andythenorth commented Jun 11, 2020

I do think that for some players it is vitally important to solve the display issue.

When funding an industry, an industry that's worth a spend of £150,000,000 might not be worth a spend of £150,000,270. Or it might be worth a spend of £150,000,270, but not £150,000,540.

The cost shown really must match the cost incurred. It's an effective principle in UI design (WYSIWYG).

Therefore to satisfy the accurate cost goal, we really must have a way of calculating the actual tile cost in the industry fund menu.

One option would be to limit industries to only build on certain terrain types. This can already be done in the newgrf spec, and we could patch the default industries to do it?

Another option would be to normalise all terrain clearing costs. So that clearing costs the same for all land types.

Another option would be to remove the cost of clearing land.

Another option would be to remove the ability to fund industries.

@nielsmh
Copy link
Contributor

@nielsmh nielsmh commented Jun 11, 2020

Removing the cost of clearing and terraforming land for industry construction could be a good enough solution. The remaining cost of already so large you can easily imagine it just contains the cost of land preparation. Additionally, some industries represent open-pit mines, and having land clearing cost included separate for those is frankly pointless, the industry is already digging a huge hole in the ground.

@James103
Copy link
Contributor Author

@James103 James103 commented Jun 11, 2020

Perhaps something like this?

When you build an industry, the cost to clear the land is still included in the total industry build price, which remains the same as previous. But, the cost to clear the land is filed separately, in "Construction" instead of in "Other" (which is where the actual industry building cost is filed in).

  1. Use the BaseCosts newGRF to set "build raw industry" to x32.
  2. Set the game setting for the build raw industry mode to "As other industries".
  3. Start a new game.
  4. Cheat in exactly £150,000,000 and repay your loan.
  5. Do not do any other actions that affect your money.
  6. Open the fund new industry menu and select the "Forest" industry.
  7. Attempt to build the industry.
  8. Building the industry succeeds and sets your bank balance to 0.
  9. Look at the financial details window.
  10. You should see a cost of £270 under "Construction" and a net income of £270 under "Other". (The net income of £270 is made up of the £150,000,000 obtained using cheats and the cost of £149,999,730 for building the industry).
@2TallTyler
Copy link

@2TallTyler 2TallTyler commented Jun 13, 2020

Removing the cost of clearing and terraforming land for industry construction could be a good enough solution. The remaining cost of already so large you can easily imagine it just contains the cost of land preparation.

And nobody is going to fund an industry, then magic-bulldoze it to "cheat" and terraform without paying.

@andythenorth
Copy link
Contributor

@andythenorth andythenorth commented Jun 13, 2020

It would be much simpler to just remove industry funding.

It would absolutely achieve the goal of accurate costs in the most reliable way.

We could also then clean up elements of industry NewGRF spec and GS API. Deleting code almost always will have the extra benefit of reducing the defect count.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants
@nielsmh @auge8472 @andythenorth @James103 @2TallTyler and others
You can’t perform that action at this time.