Infrastructure sharing 2.1.1

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

Gigigonzalez
Engineer
Engineer
Posts: 91
Joined: 12 Jun 2014 14:24

Re: Infrastructure sharing 2.1.1

Post by Gigigonzalez »

Seems to work is no guarantee for a desync less experience :p
hpfx
Engineer
Engineer
Posts: 43
Joined: 09 Nov 2013 00:19

Re: Infrastructure sharing 2.1.1

Post by hpfx »

Hi,
thank you,
teddydestodes wrote:upgraded my patch today
Can you post the patch, for people like me that don't know how to deal with github ?
thank you.
Wahazar
Tycoon
Tycoon
Posts: 1451
Joined: 18 Jan 2014 18:10

Re: Infrastructure sharing 2.1.1

Post by Wahazar »

Eddi wrote:...bankrupcy, i think the rails [and roads] should just stay there as "owner: none" [needs checking whether the needed bits are free in the map array]. stations, trains, etc. of the company are removed.
Similar action applies for roads and tram tracks, all non-shared infrastructure vanishes (including depots) whereas shared infrastructure can be still used.
I expect that it would apply also for tracks.

However there is one flaw, if infrastructure maintenance cost are on.
I observed that some users are cheating: setting one company, build roads, allow to bankrupt, fund another one and use this roads for free.
In case of shared railroads, such abuse would be much more significant.

My proposal is to add tolls for those, who are using "un-owned" infrastructure.
For example, running cost would be slightly higher.
Amount of this "slightly higher" should depend on infrastructure maintenance base cost,
and if this cost is zero (or infrastructure maintenance is switched off), no toll surplus is added.
In my opinion, such fix should be added for trunk, not only for this particular path.
Formerly known as: McZapkie
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, wired, ECS industry extension, V4 CEE train set, HotHut.
Another favorite games: freeciv longturn, OHOL/2HOL.
Luckz
Engineer
Engineer
Posts: 20
Joined: 02 Aug 2006 03:48
Location: CGN / VLN

Re: Infrastructure sharing 2.1.1

Post by Luckz »

McZapkie wrote: However there is one flaw, if infrastructure maintenance cost are on.
I observed that some users are cheating: setting one company, build roads, allow to bankrupt, fund another one and use this roads for free.
In case of shared railroads, such abuse would be much more significant.

My proposal is to add tolls for those, who are using "un-owned" infrastructure.
For example, running cost would be slightly higher.
Amount of this "slightly higher" should depend on infrastructure maintenance base cost,
and if this cost is zero (or infrastructure maintenance is switched off), no toll surplus is added.
In my opinion, such fix should be added for trunk, not only for this particular path.
I firmly believe the game should differentiate between sharing for free and sharing with payments, and in the former case sharing maintenance costs makes no sense, while in the latter case it could be an option to NOT ONLY levy fees for using but also share maintenance costs.

However, OpenTTD is not exactly focused on being a competitive MP game, so people 'cheating' via dummy companies doesn't strike me as something that needs to be prevented. An option to prevent it wouldn't be wrong, sure.
Eddi
Tycoon
Tycoon
Posts: 8257
Joined: 17 Jan 2007 00:14

Re: Infrastructure sharing 2.1.1

Post by Eddi »

err... isn't that backwards? surely i'd charge a fee because i'm paying the maintenance cost. if i want to offload the maintenance cost, i'd have to stop charging the fee.
ic111
Director
Director
Posts: 608
Joined: 17 Jul 2007 17:56

Re: Infrastructure sharing 2.1.1

Post by ic111 »

Luckz wrote: However, OpenTTD is not exactly focused on being a competitive MP game, so people 'cheating' via dummy companies doesn't strike me as something that needs to be prevented. An option to prevent it wouldn't be wrong, sure.
IMHO, such people might even be a symptom for another kind of problem: That maintenance costs scale more than just linear (as far as I remember from looking into the code in the order of sqrt(n)), i.e. there are situations, where even with a very good network design, enlarging a network isn´t possible any longer, since anything you could do just increases the maintenance costs without creating corresponding income.

I personally like the concept of maintenance costs, but in some single-player-games I played, at some point in time, I just had to turn them off (which fortunately is possible in-game).
teddydestodes
Engineer
Engineer
Posts: 2
Joined: 12 Feb 2012 21:06

Re: Infrastructure sharing 2.1.1

Post by teddydestodes »

hpfx wrote: Can you post the patch, for people like me that don't know how to deal with github ?
thank you.
here you go, its against r26767
http://data.trafficking.agency/ce2a7971 ... 7cba.patch

windows visualstudio support is broken though. sorry about that
Wahazar
Tycoon
Tycoon
Posts: 1451
Joined: 18 Jan 2014 18:10

Re: Infrastructure sharing 2.1.1

Post by Wahazar »

There are undefined string issues in setting menu:
ispbug.png
ispbug.png (7.86 KiB) Viewed 7538 times
seems that strval = STR_JUST_CURRENCY_SHORT must be added to solve this problem (not counting replacing STR_CONFIG_SETTING_SHARING_DUMMY by less abusive content).
Wahazar
Tycoon
Tycoon
Posts: 1451
Joined: 18 Jan 2014 18:10

Re: Infrastructure sharing 2.1.1

Post by Wahazar »

I found the following bug: in case of bankruptcy, train is removed, but reserved path (on the shared railway) still exists.
Any idea, how to fix it (I have no clue, which piece of code I should seek)?

Another problem - trains list in station window are hard to distinguish, if no cc are used.
Is it possible to format train number (or rather background of train number text) using company colours?
Formerly known as: McZapkie
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, wired, ECS industry extension, V4 CEE train set, HotHut.
Another favorite games: freeciv longturn, OHOL/2HOL.
Eddi
Tycoon
Tycoon
Posts: 8257
Joined: 17 Jan 2007 00:14

Re: Infrastructure sharing 2.1.1

Post by Eddi »

McZapkie wrote:(I have no clue, which piece of code I should seek)?
i'd start with the code that clears crashed vehicles, and compare that with the code that handles bankrupcy cleaning.
Wahazar
Tycoon
Tycoon
Posts: 1451
Joined: 18 Jan 2014 18:10

Re: Infrastructure sharing 2.1.1

Post by Wahazar »

Both functions (standard Train::Crash and added DeleteVisibleTrain called from RemoveAndSellVehicle function, are using FreeTrainTrackReservation(v).
However in case of Crash, ClearPathReservation is also in use.
I must check, how exactly looks reserved path after train deletion.

Here is example of reseverd track piece of train waiting for PBS and deleted after bancruptcy:
path shadow
path shadow
pathstucked.png (28.01 KiB) Viewed 7383 times
EDIT: checked with long train on block-signal only track - track under train remains dark - I will try to add ClearPathReservation then.
User avatar
lawton27
Tycoon
Tycoon
Posts: 1418
Joined: 03 Aug 2009 14:29
Location: Manchester

Re: Infrastructure sharing 2.1.1

Post by lawton27 »

It makes me happy to see someone working on IS again, it's really something I'd love to see reach the trunk one day :).
Wahazar
Tycoon
Tycoon
Posts: 1451
Joined: 18 Jan 2014 18:10

Re: Infrastructure sharing 2.1.1

Post by Wahazar »

Path reservation issues mentioned above were due to lack of HandleSharingCompanyDeletion call in economy.cpp (probably teddydestodes forgot to include this file into patch).
I fixed it with current economy.cpp version, besides it I fixed also airport circle bug.
Additionally two features were added:
1. company colour strip above vehicle in station vehicles list (see picture), useful if real-life liveries are used (or recoloured 2cc liveries),
2. option for excluding depots from sharing (despite problems with proper autorenew in case of "go to the nearest depot" order, non-shared depot allow to divide line onto private and public part).

Known bugs: only NPF pathfinder works fine, YAPF needs to be fixed for this patch.

Patch and win32 bundle are uploaded here:
http://tinyurl.com/k3zfvup
stationsharing.png
stationsharing.png (122.59 KiB) Viewed 7225 times
Todo: solve problem with rail infrastructure after bankruptcy. In my opinion, tracks should behave like roads (stay intact), with increased share fee (or decreased speed) and possibility of purchase via convert tool.

lawton27 wrote:It makes me happy to see someone working on IS again, it's really something I'd love to see reach the trunk one day :).
Honestly, I'm not convinced, if it is necessary to include this patch in trunk - regular multiplayer game with random audience could be though... Game on dedicated client/server act as some kind of filter.
Formerly known as: McZapkie
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, wired, ECS industry extension, V4 CEE train set, HotHut.
Another favorite games: freeciv longturn, OHOL/2HOL.
User avatar
JacobD88
Chief Executive
Chief Executive
Posts: 708
Joined: 16 Aug 2008 17:51
Location: Long Eaton, Nottinghamshire. UK
Contact:

Re: Infrastructure sharing 2.1.1

Post by JacobD88 »

McZapkie wrote:Todo: solve problem with rail infrastructure after bankruptcy. In my opinion, tracks should behave like roads (stay intact), with increased share fee (or decreased speed) and possibility of purchase via convert tool.
I agree, this sounds like the best method to apply.

However, you would need to find some solution to the infrastructure maintenance issue/share fee... Who is paid?
In an ideal world, It would be good to see, as with roads, the ownership fall into the hands of the nearest local authority; money paid in share fees could go to them and this in turn could allow towns to expand in a similar manner to paying for additional buildings allows... However, it is likely this would require a wholly separate patch as oppose to simply making it part of IS as each town would need to be given a "budget" and an account as well as costings for each type of buildings... A nightmare to code in it's own right...

Another proposal would be that on company failure, all infrastructure goes to a "Dummy" company in it's place that does nothing but act as a place-holder until someone buys all their track or otherwise goes bankrupt and again is replaced. The only issue with this is you could end up with a large number of such "Dummy" companies after some play time... Effectively one company for every failed player or AI company unless someone buys out the dummy... It is however the most immediate solution.
McZapkie wrote:
lawton27 wrote:It makes me happy to see someone working on IS again, it's really something I'd love to see reach the trunk one day :).
Honestly, I'm not convinced, if it is necessary to include this patch in trunk - regular multiplayer game with random audience could be though... Game on dedicated client/server act as some kind of filter.
As i often have said on such matters; if you can't get a feature to work in MP, make the patch not permit such a function in MP until a workaround can be found. It can't break it, if it isn't allowed and becomes an SP only function... I imagine it also makes any dev who reviews the patch's job much easier as they don't have to test in MP...

Nonetheless, i agree with Lawton27, it's great to see some work on such a wonderful patch. Thank-you for your efforts :)
Wahazar
Tycoon
Tycoon
Posts: 1451
Joined: 18 Jan 2014 18:10

Re: Infrastructure sharing 2.1.1

Post by Wahazar »

JacobD88 wrote:However, you would need to find some solution to the infrastructure maintenance issue/share fee... Who is paid?
If infrastructure belongs to nobody, nobody is paid. The question is, if share fee should be subtracted from vehicle owner account and "wasted", or just keep running free as in case of roads (running on nobody rails is risky in MP, and additional patch with speed degradation would restrain bankruptcy abuse for avoiding maintenance/building costs).
Providing special instance for collecting state infrastructure fee, or a tax in general, and using it to develop cities/industry is a great idea, but rather for different patch or even fork.

Dummy company for track preservation is not a convenient solution, because such tracks should not be unmovable obstacles.
With real player one can try negotiate to push track to another tile or build viaduct, which is unlikely in case of AI, especially dummy one.

Generally, there is no ideal method for handling trains after infrastructure owner bankruptcy.
In my opinion, if tracks remain without ownership, additional company setting "How to handle trains on abandoned track" should be provided.
Company owner should have opportunity to choose lesser evil: remove all trains entering abandoned track section (and broke existing cargo delivery links) or continue with trains exposed on sabotage risk.

JacobD88 wrote: As i often have said on such matters; if you can't get a feature to work in MP, make the patch not permit such a function in MP until a workaround can be found.
I'm afraid I was misunderstood, due to my poor English language.
Despite some minor bugs, whole patched client/server system works fine, until now I did not get any desync or crashes.
I enjoyed some MP sessions and they were great, but it was possible because other players were fair.
I wanted just to express my toughs, that whole ISP idea would fail on regular openttd server, because such game would be volatile on misbehaviour of random players.

BTW, buffers provided by ISR have not just an aesthetic function is case of this path - you can protect your terminal against unwanted sharing :)
Formerly known as: McZapkie
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, wired, ECS industry extension, V4 CEE train set, HotHut.
Another favorite games: freeciv longturn, OHOL/2HOL.
kingrein
Engineer
Engineer
Posts: 37
Joined: 12 Feb 2013 14:40
Location: somewhere on this world where they speak Dutch.

Re: Infrastructure sharing 2.1.1

Post by kingrein »

Hey there,
i was hoping someone could help me, i cant get tortoisesvn to apply a patch to the trunk.
i wanted to make a version with infrastructure sharing and with http://www.tt-forums.net/viewtopic.php?f=33&t=35402, but it refuses to add infrastructure sharing... without even adding the other patch file. both patches are being refused. could someone apply these patches and compile them for me? if so, you would be my hero, that i needed all these years, been trying this for about 4 years now.

Rein
Maybe you should try something else, or at least, think in a different way. like someone with autism, it could be usefull.
ksora
Engineer
Engineer
Posts: 11
Joined: 28 Oct 2014 16:49
Location: Osaka, Japan
Contact:

Re: Infrastructure sharing 2.1.1

Post by ksora »

I built IS 2.1.2(http://www.tt-forums.net/viewtopic.php? ... 0#p1008843) patch for r27462 (1.5.3).

Don't know it works or not but at least it makes me to see main menu.

Sorry about git style diff but I prefer git.

You can get whole source code at my GitHub page.

https://github.com/koreapyj/openttd-1.5.3/tree/IS2.1.2

-------

Update on 2016-01-22: Fixed some really old bugs and make little changes. See commit log on my GitHub page for details. -> https://github.com/koreapyj/openttd-1.5 ... ts/IS2.1.2
Attachments
is2.1.2_r27462_160122.diff
(67.92 KiB) Downloaded 121 times
ksora
Engineer
Engineer
Posts: 11
Joined: 28 Oct 2014 16:49
Location: Osaka, Japan
Contact:

Re: Infrastructure sharing 2.1.1

Post by ksora »

I fixed some annoyances.

- Can be set sharing settings individually. Settings are stored by company.
- Can be crashed with trains belong to other company.
Attachments
is2.1.2_r27462_160124.diff
(70.24 KiB) Downloaded 170 times
dromer20
Engineer
Engineer
Posts: 9
Joined: 19 Feb 2016 16:19

Re: Infrastructure sharing 2.1.1

Post by dromer20 »

Where can i find the sharing window? The patched game doesn't seem to be working for me (I only see the settings in the settings menu, but i can't connect to other user's track in multiplayer.
Wahazar
Tycoon
Tycoon
Posts: 1451
Joined: 18 Jan 2014 18:10

Re: Infrastructure sharing 2.1.1

Post by Wahazar »

You need to go competitors setting and set infrastructure sharing on, separately for each of 4 meanings of transport.
Personally I recommend to not share docks.
Formerly known as: McZapkie
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, wired, ECS industry extension, V4 CEE train set, HotHut.
Another favorite games: freeciv longturn, OHOL/2HOL.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 14 guests