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

Feature: allow to do a hostile takeover of an AI company (in singleplayer) #10914

Merged
merged 1 commit into from Jun 5, 2023

Conversation

TrueBrain
Copy link
Member

@TrueBrain TrueBrain commented Jun 3, 2023

Motivation / Problem

With the removal of the share-system, you could no longer make an AI disappear in a single player game. At least, not without going into the console.

Description

Add a nice little button Hostile Takeover to allow you to take over any AI (in singleplayer) at any moment in time. But be careful: it can be really expensive if the AI is doing well.

I reused the bankruptcy flow, as it is very identical; just the amount (and text) is different.

image

Limitations

Finding a good value for what to pay is a bit tricky. The normal CalculateCompanyValue(.., false) doesn't work (this is what you pay when you go bankrupt), as the loan is "forgiven" there. Which is silly in a hostile takeover.
Additionally, I also added a penalty for companies that are doing well, as otherwise it is really cheap to buy out an AI early on, and even cheaper later in the game.
But, this is all based on an opinion .. it needs some input, before or after merging, what an actual good value is.

Checklist for review

Some things are not automated, and forgotten often. This list is a reminder for the reviewers.

  • The bug fix is important enough to be backported? (label: 'backport requested')
  • This PR touches english.txt or translations? Check the guidelines
  • This PR affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, gs_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')

src/lang/english.txt Outdated Show resolved Hide resolved
@PeterN
Copy link
Member

PeterN commented Jun 3, 2023

So a stop-gap until an unbroken shares system with hostile takeovers is implemented?

@TrueBrain
Copy link
Member Author

So a stop-gap until an unbroken shares system with hostile takeovers is implemented?

In sorts, yes. At least it is easier to maintain than the shares system was, and it fills that gap of players that like an AI for the first few years, but then want to get ride of them.

@TrueBrain TrueBrain force-pushed the hostile-takeover branch 2 times, most recently from f11791f to b27e40d Compare June 3, 2023 15:16
@nielsmh
Copy link
Contributor

nielsmh commented Jun 3, 2023

The purchase price should at the very least also include the value of fixed assets too, so you can't just get fifty brand new Yate Haugan, that never made a delivery yet, and thus have zero profit, for free.

@TrueBrain
Copy link
Member Author

The purchase price should at the very least also include the value of fixed assets too, so you can't just get fifty brand new Yate Haugan, that never made a delivery yet, and thus have zero profit, for free.

They are.

@nielsmh
Copy link
Contributor

nielsmh commented Jun 3, 2023

The purchase price should at the very least also include the value of fixed assets too, so you can't just get fifty brand new Yate Haugan, that never made a delivery yet, and thus have zero profit, for free.

They are.

Make sure that's reflected in the GUI too, right now the message shown does not mention anything about that.

@TrueBrain
Copy link
Member Author

The purchase price should at the very least also include the value of fixed assets too, so you can't just get fifty brand new Yate Haugan, that never made a delivery yet, and thus have zero profit, for free.

They are.

Make sure that's reflected in the GUI too, right now the message shown does not mention anything about that.

Yes boss. Wait, you are not my boss :P

Anyway, suggestions? I am having a hard time wording it clearly, so could use some suggestions :)

@Andrew350
Copy link

I thought "all their assets" made that pretty clear?

@TrueBrain TrueBrain force-pushed the hostile-takeover branch 2 times, most recently from 8b662da to 40b4aa8 Compare June 3, 2023 20:08
@TrueBrain
Copy link
Member Author

Tnx @nielsmh , talked on Discord to find a much better sentence. In a hostile takeover of {COMPANY} you will purchase all fixed assets, pay off all loans, and pay two years worth of profits.{}{}The total is estimated to be {CURRENCY_LONG}.{}{}Do you want to continue this hostile takeover?

Will update the screenshot soon.

@FLHerne
Copy link
Contributor

FLHerne commented Jun 3, 2023

I thought "all their assets" made that pretty clear?

It says "get all their assets, in exchange for paying off their loan plus two years of profits".

"all their assets in exchange for their book value, plus paying off any loan plus two years of profits", except that's too long.

To be honest I don't see why it's important to explain the cost at all. It is what it is, the approximate range of the company's value is fairly obvious, and no other estimated cost has a similar explanation.

Does it even have to be described as a "Hostile Takeover"? It's an AI, we don't know what the management thinks about the issue. Could just as well be a voluntary merger.

My concrete suggestion (off the top of my head):

[Buy Company]

You are about to buy Fast Transport Inc.
All infrastructure, vehicles and other assets will become part of your company, Anglian Logistics.
Estimated Cost: £131,445

[Buy Company] [Cancel]

@TrueBrain
Copy link
Member Author

I really like "Hostile Takeover", just because it is a bit tongue in cheek towards what you are doing. In reverse, "buy" gives the suggestion the AI is always fine with it. So I would rather keep this wording. Not everything has to be all that serious in OpenTTD :)

As for the rest of the text, I think the new text is fine, not? Being a bit clear it is not the same as a bankruptcy never hurts anyone.

@michicc
Copy link
Member

michicc commented Jun 3, 2023

Doing some more bike painting: "fixed assets" might be the correct financial term, but I would very much think that many players will interpret is as excluding vehicles (as the move and are not fixed in place).

@nielsmh
Copy link
Contributor

nielsmh commented Jun 3, 2023

Additional thought, which probably does not need to be part of this PR: A game script should be able to command the closure of a company and transfer of all its assets to someone else. Possibly with flags for what assets to transfer and what to void. When a GS does that, the GS should also be responsible for handling any payment it deems is required.

@Eddi-z
Copy link
Contributor

Eddi-z commented Jun 3, 2023

Afair the old feature had a protection period of 5 years before a complete takeover was possible, should this one have this as well?

@TrueBrain
Copy link
Member Author

Afair the old feature had a protection period of 5 years before a complete takeover was possible, should this one have this as well?

I did not see such need, given this is an AI and in single player only. If you want to do a hostile takeover earlier .. go nuts, I would say. Additionally, the costs are significantly higher than a share-buyout was, so that hopefully helps too.

src/company_gui.cpp Outdated Show resolved Hide resolved
src/company_gui.cpp Outdated Show resolved Hide resolved
src/economy.cpp Outdated Show resolved Hide resolved
src/economy.cpp Outdated Show resolved Hide resolved
…ayer)

With the removal of the share-system, you could no longer make an
AI disappear in a single player game. At least, not without going
into the console.
@TrueBrain TrueBrain merged commit 3b1407d into OpenTTD:master Jun 5, 2023
19 checks passed
@TrueBrain TrueBrain deleted the hostile-takeover branch June 5, 2023 17:32
mrmbernardi pushed a commit to mrmbernardi/OpenTTD that referenced this pull request Jul 2, 2023
…ayer) (OpenTTD#10914)

With the removal of the share-system, you could no longer make an
AI disappear in a single player game. At least, not without going
into the console.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants