Subsidiaries management (latest build: r7213)

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

KING
Traffic Manager
Traffic Manager
Posts: 180
Joined: 12 Dec 2005 08:03

Post by KING »

can we make it so the run red signal and stop is disabled if the train is on someone elses track? Cause i can see people useing it to crash or jam other players trains.
even better make those options controlled by the owner of the track not the train.
Image
User avatar
Thief^
Route Supervisor
Route Supervisor
Posts: 469
Joined: 10 Oct 2004 00:11

Post by Thief^ »

I think it should be disabled full stop if it's on another player's track, it can be very abused otherwise by either player.
Melt with the Shadows,
Embrace your destiny...
gagarin
Engineer
Engineer
Posts: 57
Joined: 26 Feb 2006 18:52
Location: Berlin, Germany

Post by gagarin »

I will do this, but i'm not sure if I should allow it for sister companies. What do you think?

I thought about allowing to build and remove signlas on sister companies tracks, because its unnerving when you play withother players and want to connect your rails and there is a signal in way or you want to build signls there and could not.
Should this be genreral enabled or just an option?

Edit:
New patchversion:
1. StartStop train is allowed only on your own tracks and in depots
2. ForceTrainProceed is allowed only on your own tracks
3. you can now build signals on sister-companies tracks
4. fixed a Bug, witch causes an assert when buying shares in network games
Attachments
subsidiaries_r5186.diff
(190.45 KiB) Downloaded 255 times
User avatar
Thief^
Route Supervisor
Route Supervisor
Posts: 469
Joined: 10 Oct 2004 00:11

Post by Thief^ »

I think that building or removing signals or modifying track (like to join on etc) on a sister/non-sister company's tile should be another option in the settings.
Melt with the Shadows,
Embrace your destiny...
gagarin
Engineer
Engineer
Posts: 57
Joined: 26 Feb 2006 18:52
Location: Berlin, Germany

Post by gagarin »

Hi!

I updated the patch and added an option to dis-/allow sister companies to build/remove each others signals.
I think other companies should to be allowed to do that.

The option-string is only avaliable in english and german yet. If someones doing another language i will add it:
STR_CONFIG_PATCHES_SUBS_BR_SIGNAL :{LTBLUE}Allow subsidiaries to build/remove each others singals: {ORANGE}{STRING}

Greetings,
gagarin.

Edit:
I forgot the diff ...
Attachments
subsidiaries_r5234.diff
(191.1 KiB) Downloaded 322 times
gagarin
Engineer
Engineer
Posts: 57
Joined: 26 Feb 2006 18:52
Location: Berlin, Germany

Post by gagarin »

Hi!

I had the idea to make "contracts" possible, so that you can set the costs and allow sharing stations for each player seperatly in network games.
Maybe with the possibility to say a contract may last for 5 years or for ever os so.

What do you think of it?

It would be a hell of a lot of coding, so I will do it only if someone else is interrested.

Greetings,
gagarin.
User avatar
The Master
Engineer
Engineer
Posts: 80
Joined: 02 Apr 2005 20:50
Location: Italy
Contact:

Post by The Master »

Contract, sounds good for me.
Contract need:
Initial contract cost
Tracks using cost (x squares)
Station using cost
Max Vehicle
Max Train & Max train length
Max Aircraft
Max Ship?

I can't aid you to coding.
-----------------------------------
I play OpenTTD in italian under Debian GNU/Linux
User avatar
NukeBuster
Traffic Manager
Traffic Manager
Posts: 222
Joined: 04 Jan 2006 18:16
Location: Alphen aan den Rijn, The Netherlands
Contact:

Post by NukeBuster »

The Master wrote:Contract, sounds good for me.
Contract need:
Initial contract cost
Tracks using cost (x squares)
Station using cost
Max Vehicle
Max Train & Max train length
Max Aircraft
Max Ship?

I can't aid you to coding.

This would be awesome if this was possible.

Maybe it would also be possible to include a fine for when a crash occurs caused by the foreign player.
NukeBuster

Transport Empire: The Transport Empire Linux effort
Join the Transport Empire IRC channel: [url]irc://irc.oftc.net/transportempire[/url] !

OpenTTD patch(es): Password at join
Sebastiaan
Engineer
Engineer
Posts: 110
Joined: 20 Jun 2005 19:22
Location: Leuven, Belgium

Post by Sebastiaan »

The Master wrote:Contract, sounds good for me.
Max Vehicle
Max Train & Max train length
Max Aircraft
Max Ship?
There are a few problems one must be aware of.

1) To make these things dynamically users must have a way to negotiate efficiently with nothing but a user interface. That's quite hard, given the fact that you can only send such small text messages in multiplayer.

2) If you set a max train length (which definitely makes sense) you run into the very big problem of verification and penalties. If a player violates the train lenght, there are a few options:
- money penalty
- don't allow the train on the track

The latter seems the better, but brings other problems with it. First, if a train gets blocked because of this, it will most likely block all other trains behind it. Even trains from the player who owns the network where the violating train would want to drive on. This thus would force one to accept trains in oversize.

Thus, you would also have to have the pathfinder exclude routes where a train may not drive because of it's lenght. And, a notice beforehand if the destination isn't reachable too, because it might not be obvious that it cannot be reached in the first place.

Guess we will have to stick to a money penalty.. and the option to break the contract in case of a violation.

3) This brings me to the next point: how about contract endings? One would want to ensure that all trains who are on the network can leave the foreign network once the contract gets terminated. Could maybe be solved by checking the contract every time a train switches networks.

4) I would make the contract indefinitely, but with an option to cancel it with a fairly long notice time (about a year?). Otherwise you'll more be negotiating than building networks. And, the notice time is necessary to give players an option of searching a backup solution for their trains using the network that got cancelled...

5) There are definitely more difficult points at this idea than I can think of now... ;)
gagarin
Engineer
Engineer
Posts: 57
Joined: 26 Feb 2006 18:52
Location: Berlin, Germany

Post by gagarin »

1) I thought about something that look like the paches configwindow, with an accept and a cancle button, both have to accept to enable the contract. If one has accepted and the other changes a setiing, both have to accept new.

2) I didn't thought about a max train length yet. Maybe later.

3) Thats the way I want to do it

4) I had in mind, that you can set 5 years, 10 years 20 years and indefinitly but you can cancel it with about 6 month notice time

5) There are problems. I have to change the savegame format to save contracts and syncronise them over network (the network server makes a savegame and sends it to the client)

Greetings,
gagarin.
patrick_kn
Engineer
Engineer
Posts: 8
Joined: 12 Oct 2005 15:53
Location: Constance, Germany

Post by patrick_kn »

Hi there,

I've installed the miniIN-Version yesterday evening. It read anywhere, that subsidaries are implemented there. So i tried to handle with it a bit.
I loadad an older savegame and wanted to start subsidaries. But I realized that there was no free ending track. In result I couldn't connect to other company-networks.

Is there a possibility to place junctions on tracks of other companies?
Maybe it would be much better, if a player could even rebuilt the other comapnies' track, so that it has second track with signals? Therefor it would be really pretty, that the other companiy would have to agree with rebuilding its tracks...

Is there any possibility to code something like this?

Thankyou for your help!
Bye
Patrick_kn
User avatar
Thief^
Route Supervisor
Route Supervisor
Posts: 469
Joined: 10 Oct 2004 00:11

Post by Thief^ »

patrick_kn wrote:Is there a possibility to place junctions on tracks of other companies?
Yes, you can build more tracks on another company's tracks. It's actually a problem, because they can't stop you...
Melt with the Shadows,
Embrace your destiny...
patrick_kn
Engineer
Engineer
Posts: 8
Joined: 12 Oct 2005 15:53
Location: Constance, Germany

Post by patrick_kn »

But what special setting do I need for it? I tried to build a junction. But anyway, there occured a message that I'm not allowed to build on other tracks (i mean that it was displayed that it dindnt' belong to me).

Is there a special button to alow this?
Bye
Patrick_kn
User avatar
Thief^
Route Supervisor
Route Supervisor
Posts: 469
Joined: 10 Oct 2004 00:11

Post by Thief^ »

I think "Allow track sharing for everyone" must be on in configure patches.
Melt with the Shadows,
Embrace your destiny...
patrick_kn
Engineer
Engineer
Posts: 8
Joined: 12 Oct 2005 15:53
Location: Constance, Germany

Post by patrick_kn »

Yes, thats already enabled. I watched the configuration-menu and enabled everything that could have to do with subsidaries (just to see how it works).
But building junctions dindn't work yet. :(
Bye
Patrick_kn
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Post by Rubidium »

There is a bug in MiniIN which is as far as I'm concerned due to the subsidiaries patch.

It is possible to recreate the bug from scratch, but it is pretty difficult, as you need a lot of luck. You can 'create' it using the following steps:
- build a bridge
- let anonther player build a road under the bridge
- let the other player go bankrupt, so the road piece below the bridge becomes of owner OWNER_NONE. This last step is the most important one, as that (indirectly triggers the bug).

The bug triggers the following assertion:
openttd: player.h:218: GetPlayer: Assertion `i < (sizeof(_players)/sizeof(_players[0]))' failed.

This is due to the fact that on line 709 of tunnelbridge_cmd.c GetPlayer() is called, with OWNER_NONE as argument (as GetTileOwner(tile) returns OWNER_NONE). It can be solved by adding the extra "GetTileOwner(tile) != OWNER_NONE" predicate to the if-statement before the GetPlayer(...)->is_active predicate, like in the attached diff/patch.
Attachments
subsidiaries_OWNER_NONE_bug.diff
(868 Bytes) Downloaded 253 times
Hazelrah
Traffic Manager
Traffic Manager
Posts: 196
Joined: 13 Apr 2005 05:41

Post by Hazelrah »

patrick_kn
Engineer
Engineer
Posts: 8
Joined: 12 Oct 2005 15:53
Location: Constance, Germany

Post by patrick_kn »

OK, now it works! But is it true, that I can start subsidaries only on subcomanys? I wondered why I couldn't build on tracks of other companys that didn't belong to me!?

Whatever, thanks for your help!
Bye
Patrick_kn
Grolsch
Transport Coordinator
Transport Coordinator
Posts: 283
Joined: 08 May 2004 07:48
Location: Alkmaar, The Netherlands

Post by Grolsch »

I asked this question in a seperate topic, but since this is the subsidiaries topic, I'll ask it here again:

Is it possible in a multiplayer game with 3 players, to let 1 player use my rail, while the other player can't?
Beer equals power
EddieB
Engineer
Engineer
Posts: 3
Joined: 18 Aug 2006 13:36

Post by EddieB »

I've just gone through the whole thread in the hope that I would find what I'm about to post but couldn't see anything. If this has already been asked, please accept my apologies.

There seems to be too much scope for cheating with subsidaries. I know in real life the parent company would not be liable for the debts of a subsidiary, but I think they should in OpenTTD.

If not, then it is possible for Company A to set up train lines everywhere, found Company B as its subsidiary, give Company B some cash to buy the trains, run them as normal, but charge Company B massive amounts in fees for doing so through the tax function. (€100/tile, €100/unit etc.)

So while Company A receives large amounts of cash, Company B is plunged into debt. Eventually the game will bankrupt Company B for obvious reasons, but here's where I think it turns into a bug...

In my games, a bankrupted subsidiary happens - it is announced in the newspaper - and yet nothing changes. Company B still exists, its trains still run, and Company A gets to sit back and rake in the cash while Company B is apparently bankrupt.

Surely if a subsidary goes bankrupt, all of its assets should be sold off and any resulting funds/deficit should be transferred back to Company A so they are punished accordingly? This would discourage Company A from doing such actions as it would be liable for the debts of its subsidiary.

Any thoughts?

Thanks for all the work everyone has ever done on this patch. It is fantastic.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 3 guests