Infrastructure Sharing

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

Post Reply
User avatar
NukeBuster
Traffic Manager
Traffic Manager
Posts: 222
Joined: 04 Jan 2006 18:16
Location: Alphen aan den Rijn, The Netherlands
Contact:

Re: Infrastructure Sharing

Post by NukeBuster »

Is there a server running with this patch, so I can give it a try?
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
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: Infrastructure Sharing

Post by Zuu »

Checkout the dev-server of #openttdcoop. It runs some tests of the patchpack for WWOTTDGD2 (World Wide OpenTTD Game Day 2) which I think include infrastructure sharing. See this topic: http://www.tt-forums.net/viewtopic.php?f=33&t=37547 then perhaps join #openttdcoop on irc.oftc.net and ask what version of the patch-pack to use etc, and get the password for the server.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Anunnaki
Engineer
Engineer
Posts: 64
Joined: 16 Aug 2005 16:09
Location: Prague, Czech Republic

Re: Infrastructure Sharing

Post by Anunnaki »

Gedemon wrote:
Anunnaki wrote:BTW: Can you release what you have actualy done from v0.4 ? The v0.35 for r13205 would be great :).
yes, but be warned this is a WIP, no code cleaning, not enought comment, and some parts buggy.

*TEST VERSION, DON'T USE FOR NORMAL GAME*

but if you want to check the pb with signals and airports, that will help... :mrgreen:
r13217_infrastructure_sharing_v0.4c.wip.patch
I was playing your test mod (patch) on mine dedicated server (in EPM mod) with 3 other players for cca 5 days (game is still running), and till now, everythings works ok. I was not trying bancrupcy while other train is on track, but sharing works great.

Have you other/new/updated version to test ? I am working right now on new EPMP modpack update, so i can implement there your newest test version if you wish.
HenkB
Engineer
Engineer
Posts: 3
Joined: 09 Jun 2007 08:54
Contact:

Re: Infrastructure Sharing

Post by HenkB »

I've played a game with a couple of friends last night, and we didn't encounter any bugs :)
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Infrastructure Sharing

Post by planetmaker »

bump & update to r13397. Would be nice, if there'd be actually a feature update :), even though, of course, RL has priority.
Attachments
is_v04beta_r13397.diff
is_v04beta_r13397.diff
(126.61 KiB) Downloaded 178 times
wozzar
Transport Coordinator
Transport Coordinator
Posts: 331
Joined: 27 Dec 2002 09:25

Re: Infrastructure Sharing

Post by wozzar »

I would like to see a feature where you can sell routes and assets to the AI.

I like to specialize in Aircraft. So if i take over a AI i get the Aircraft plus vehicles and trains. So i would like to sell these off to another AI. Is it possible to have this feature in the Infrastructure Sharing patch or would it have to be done separately or it isn't possible to do at all.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Infrastructure Sharing

Post by planetmaker »

wozzar wrote:I would like to see a feature where you can sell routes and assets to the AI.

I like to specialize in Aircraft. So if i take over a AI i get the Aircraft plus vehicles and trains. So i would like to sell these off to another AI. Is it possible to have this feature in the Infrastructure Sharing patch or would it have to be done separately or it isn't possible to do at all.
That's IMO a different feature. This is about paying for (temporary) usage - not about ownership transfer
wozzar
Transport Coordinator
Transport Coordinator
Posts: 331
Joined: 27 Dec 2002 09:25

Re: Infrastructure Sharing

Post by wozzar »

planetmaker wrote:
wozzar wrote:I would like to see a feature where you can sell routes and assets to the AI.

I like to specialize in Aircraft. So if i take over a AI i get the Aircraft plus vehicles and trains. So i would like to sell these off to another AI. Is it possible to have this feature in the Infrastructure Sharing patch or would it have to be done separately or it isn't possible to do at all.
That's IMO a different feature. This is about paying for (temporary) usage - not about ownership transfer
Can it be done though.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Infrastructure Sharing

Post by planetmaker »

wozzar wrote:
planetmaker wrote:
wozzar wrote:I would like to see a feature where you can sell routes and assets to the AI.

I like to specialize in Aircraft. So if i take over a AI i get the Aircraft plus vehicles and trains. So i would like to sell these off to another AI. Is it possible to have this feature in the Infrastructure Sharing patch or would it have to be done separately or it isn't possible to do at all.
That's IMO a different feature. This is about paying for (temporary) usage - not about ownership transfer
Can it be done though.
Sure. But it will be a lot of work for a person who knows what s/he does.

There're quite some points to decide on how to make the user interface for this feature and how to handle vehicles which are only available to one company etc pp. I guess it's approx as much work as this patch.
User avatar
Ammler
President
President
Posts: 953
Joined: 18 Jun 2006 18:18
Location: Switzerland
Contact:

Re: Infrastructure Sharing

Post by Ammler »

It seems, that the 2 patchers, Vikthor and Gedemon, aren't coding on that patch right now. Because we would like to use that patch for the next WWOTTDGD. I like to request for a small addon, needed for proper gaming. I would be really happy if someone could add the following Request, also possible as additional patch/hack.

Requests for WWOTTDGD/2:
  1. Trackowners should be able to start/stop the foreign trains. Train owners should not be able to start/stop on foreign tracks.
  2. Only owner can drive through WPs. (You can close you track for others.)


Greets
Ammler
User avatar
FooBar
Tycoon
Tycoon
Posts: 6553
Joined: 21 May 2007 11:47
Location: The Netherlands
Contact:

Re: Infrastructure Sharing

Post by FooBar »

Ammler wrote: [*]Trackowners should be able to start/stop the foreign trains. Train owners should not be able to start/stop on foreign tracks.
What would happen when I stop a forein train on my track, and let it just sit there. The owner of the train has no option to get it out of there. I'd find the following restrictions for trains on foreign tracks more suitable:
- No stopping on foreign track.
- No drive through signal on foreing track.
Grolsch
Transport Coordinator
Transport Coordinator
Posts: 283
Joined: 08 May 2004 07:48
Location: Alkmaar, The Netherlands

Re: Infrastructure Sharing

Post by Grolsch »

Why those options? If you don't trust another player on your tracks, don't give him permission. If you need to changer your tracks, you don't need to be able to stop other trains, just delete some piece of track.
Beer equals power
Vikthor
Engineer
Engineer
Posts: 69
Joined: 13 Jun 2004 16:57
Location: Prague, Czech republic

Re: Infrastructure Sharing

Post by Vikthor »

I still think that either of them should be able to stop the train, for safety concerns. It's same in the real life, everybody can pull the emergency brake, but he must face the consequences if he had done so without reason. And for ignoring signals I would consider joint agreement of both the vehicle and the track owner.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Infrastructure Sharing

Post by planetmaker »

Ammler wrote: Requests for WWOTTDGD/2:
  1. Trackowners should be able to start/stop the foreign trains. Train owners should not be able to start/stop on foreign tracks.
Done. See attached diff file. Only the track owner may now give orders to start and stop , force proceed through signals and turn trains.
Attachments
is_v04beta2_r13536.diff
infrastructure sharing updated for r13536. Changed behaviour: trackowner commands trains, not train owner.
(88.55 KiB) Downloaded 188 times
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Infrastructure Sharing

Post by planetmaker »

Another bump, update and modification.
Ammler wrote:Requests for WWOTTDGD/2:
  1. Trackowners should be able to start/stop the foreign trains. Train owners should not be able to start/stop on foreign tracks.
  2. Only owner can drive through WPs. (You can close you track for others.)
Your wish is my command :). Actually, the 2nd feature is really nice and allows much more sophisticated track building :). "here, I built a really nicely winding track for your ICE :P "

On your own tracks you (and only you) have control over all trains via:
- start/stop
- force proceed through signal
- reverse

You block a track for all other companies except your own by putting a waypoint on it.

There's not (yet) any way to switch off this behaviour.

Thanks SmatZ for very helpful advice :)
Attachments
is_v04beta3_r13552.diff
infrastructure sharing v04c for r13552 with above mentioned changes to behaviour
(129.96 KiB) Downloaded 224 times
audigex
Tycoon
Tycoon
Posts: 2056
Joined: 09 Dec 2007 21:28
Contact:

Re: Infrastructure Sharing

Post by audigex »

How about if it's left stopped for more than x ticks, the local owner can start it and/or send it back to its owner's track. Alternatively make ownership switch to the track owner if it's left for too long - but that might be a whole new kettle of fish.
Jon
yorick
Engineer
Engineer
Posts: 80
Joined: 23 Mar 2008 08:53

Re: Infrastructure Sharing

Post by yorick »

I have some suggestions:
  • Use SubtractMoneyFromAnyPlayer(Player *p, CommandCost cost) instead of SubtractMoneyFromPlayer(CommandCost cost) and setting the _current_player
  • Merge SharedRailwayStations, SharedRoadStops, SharedHarbours and SharedAirports into one function.
  • Have a fee for all types of stations, not only for ones owned by a player, but execute industry-stations like oil rigs and fishing grounds.
  • Remove timelimit for ENABLING sharing, but keep it for disabling or changing fees if it's enabled.
  • Rework CmdSetSharedBoolValues and CmdSetSharedIntValues to have the new value in p1 and the thing that changed in p2, because you can't change multiple at the time.
User avatar
ostlandr
Chairman
Chairman
Posts: 882
Joined: 12 May 2007 01:09
Location: Northeastern USA

Re: Infrastructure Sharing

Post by ostlandr »

Awesome patch! I really need to get into BuildOTTD. . .

In Railroad Tycoon 3, infrastructure is shared by default. If you attach your track to the AI's, expect their trains to wander onto your system if there's profit to be made. This is good (trackage use fees) and bad (congestion).
When an AI company in RRT3 goes under and is liquidated by its creditors, the track and stations are transferred to it's creditors, and still available for use (for a fee, of course.) Their infrastructure can then be bought for cash, without having to buy out the company.
Perhaps when a company goes bankrupt, their tracks, etc. could be transferred to a special "bank" AI? Or perhaps the original AI company just hangs around at $1 per share, with all of its vehicles sold, and no money to buy more.

Just throwing out ideas here- that's what I do. :idea:

What about having the game, after some time, announce that "Jones & Co.'s assets will be sold off", giving the player some time to either get his/her trains off the AI tracks or buy out the company? Then the game (after a year or so for the bankruptcy proceedings) will sell off the tracks except under player trains. Then the game will check once a month or so to see if there are still player trains on the tracks, and if not, tear up those rails also. A "stranded" train could be "rescued" by either laying track to its location, or building a depot along the track, driving the train to it, and selling it.
Sounds like building some of your own depots in AI territory might be a good idea.

Hmm. . . Company "A" is going bankrupt. Company "B" needs their infrastructure, and so takes on debt to buy them out. Then company "B" sells off unprofitable lines, etc., but now the debt drives company "B" into the red anyway. Old locomotives break down, service quality drops, traffic gets shifted to other modes. . .
Could never happen in real life. ** cough PENN CENTRAL cough** :rolleyes:
Who is John Galt?
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Infrastructure Sharing

Post by DaleStan »

ostlandr wrote:In Railroad Tycoon 3, infrastructure is shared by default. If you attach your track to the AI's, expect their trains to wander onto your system if there's profit to be made. This is good (trackage use fees) and bad (congestion).
But it doesn't cause congestion. At least not as far as the track owner is concerned. Foreign trains always yield.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Infrastructure Sharing

Post by planetmaker »

yorick wrote:I have some suggestions:
  • Use SubtractMoneyFromAnyPlayer(Player *p, CommandCost cost) instead of SubtractMoneyFromPlayer(CommandCost cost) and setting the _current_player
  • Merge SharedRailwayStations, SharedRoadStops, SharedHarbours and SharedAirports into one function.
  • Have a fee for all types of stations, not only for ones owned by a player, but execute industry-stations like oil rigs and fishing grounds.
  • Remove timelimit for ENABLING sharing, but keep it for disabling or changing fees if it's enabled.
  • Rework CmdSetSharedBoolValues and CmdSetSharedIntValues to have the new value in p1 and the thing that changed in p2, because you can't change multiple at the time.
Thanks, Yorick, for your input. Reading through this, it gives me actually the idea how to split the whole thing into two patches:
- receiving and paying royalties for the usage of property of a different owner (player and non-player all the same). Shared usage is already possible. e.g. for oil rigs. This would also allow for another patch: the construction of stations by the local authority. Especially downtown bus stations, ports or airports might come to my mind there.
- allowing the usage of other player's property, thus extending the shared infrastructure from towns to include also other players tracks and stations.

When time allows I'll have a close look at it :) .
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Google [Bot] and 2 guests