Subsidies for cargodist

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
Wahazar
Tycoon
Tycoon
Posts: 1451
Joined: 18 Jan 2014 18:10

Subsidies for cargodist

Post by Wahazar »

I wonder why subsidies are generating only if cargo distribution setting is manual one.
Are there any important reasons? I read discussions "should be transferred cargo count to subsidy", my answer is "no", just cargo generated in A and delivered to B is subsidy claim A-B payment. Cargodist is just automated transfers, you cannot have subsidy from cargo delivered from C to B via A in original TTD, is it true? So no need to touch this.

I have idea of simple patch, which would allow to generate subsidies if there is cargodist enabled, additionally to omit maximal percent of transported cargo check in such case.
Currently cargodist is counter-productive, there is less profit from large network then from several p2p services.
Original subsidies tend to promote abandoned industries/towns, which also doesn't make sense if cargodist is enabled.
But subsidies, generated also for already served towns, can act as bonus points to the large network (smaller amount of p2p cargo, but much higher chance to catch subsidy between existing stations, if many stations are connected, in contrary to separate p2p services).

EDIT: patch is here: viewtopic.php?f=33&t=77282&p=1194207#p1194207
Last edited by Wahazar on 21 Nov 2017 22:08, edited 1 time in total.
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.
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: Subsidies for cargodist

Post by Alberth »

Does cargo picked up at A, brought to B for transfer to another train count as "delivered"?

The problem is not whether you can pick an answer and implement it, but whether general community members would also come to the same conclusion (that is, the other options must be "wrong enough" not to be selected as valid answer). If they don't you get an endless debate and stream of bug reports "foo should count as subsidy".
Being a retired OpenTTD developer does not mean I know what I am doing.
Wahazar
Tycoon
Tycoon
Posts: 1451
Joined: 18 Jan 2014 18:10

Re: Subsidies for cargodist

Post by Wahazar »

Alberth wrote:Does cargo picked up at A, brought to B for transfer to another train count as "delivered"?
And how it work when you make it intentionally when cargodist is disabled?
Rhetoric question, it work as it should be. Only cargo produced in A and finally delivered to B is subsidised.
And I don't expect different behaviour in case of cargodist enabled.
The only issue is, that subsidy system work for abandoned places, it have sense in case of standard game (to lure player to make new p2p services), but is bad feature in case of cargodist. Omitting transported percentage check in case of cargodist should work better - minimal distance should also be ignored.
The problem is not whether you can pick an answer and implement it, but whether general community members would also come to the same conclusion (that is, the other options must be "wrong enough" not to be selected as valid answer). If they don't you get an endless debate and stream of bug reports "foo should count as subsidy".
So the only reason to ban cargodist subsidies is to avoid discussion?
Well, I need to add setting switch when.
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.
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: Subsidies for cargodist

Post by Alberth »

McZapkie wrote:Rhetoric question, it work as it should be. Only cargo produced in A and finally delivered to B is subsidised.
That means you may not be able to fulfil some of the subsidies, as cargodist may decide the cargo you deliver should move to another destination (if you happen to move the same cargo from B to elsewhere).

While you may not have a problem with that, others will. At the very least it's counter-intuitive.
McZapkie wrote:And I don't expect different behaviour in case of cargodist enabled.
Except you don't control cargodist, thus it may interfere with your intentions, as its mind-reading service has not been implemented.

Instead of patching the game, you can also make a gamescript, or use eg Bee Award.
McZapkie wrote:So the only reason to ban cargodist subsidies is to avoid discussion?
Well, I need to add setting switch when.
It's not explainable that cargo-dist interferes, and messes with the subsidy, and there is no good solution for it.
Being a retired OpenTTD developer does not mean I know what I am doing.
Wahazar
Tycoon
Tycoon
Posts: 1451
Joined: 18 Jan 2014 18:10

Re: Subsidies for cargodist

Post by Wahazar »

Alberth wrote:That means you may not be able to fulfil some of the subsidies, as cargodist may decide the cargo you deliver should move to another destination...
But it is intrinsic behaviour of cargodist. If someone doesn't like such behaviour, he can play without cargodist.
Additionally, I provided setting to switch off cargodist subsidies, by default off.

I started this thread because I was curious, if there are any real problems behind subsidies, but if there is only a psychological problem, it is a good news. We can work on it in a group ;-)
Alberth wrote: While you may not have a problem with that, others will. At the very least it's counter-intuitive.
I don't follow such argumentation. Local government tends to subsidy his own citizens (and voters :) rather than tourists.

I agree, that current state of art of TTD subsidies doesn't mix with automatic cargo destinations, because subsidies are assigned only to not (or poor) served towns/industries, and there is rather no chance to catch subsidy or have any revenue from it, if new station is attached to linkgraph, due to long time of linkgraph update compared to short term of subsidy offer or contract.

Therefore I created patch, which not only allow subsidies in cargodist, but also provide different behaviour:
  • if cargodist for given cargo group is enabled and cargodist subsidies are enabled,
  • subsidies are generated regardless of percentage of transported cargo
  • maximal subsidy distance is scaled with map size (70 tiles for 256x256 and smaller, 210 for 512x512, 280 for 512x1024 etc)
Such approach allow to change strategy, instead of checking subsidy window and hasty making new connections, player can expand his network on his own and catch subsidies like additional bonus points. The larger network is, the higher chance that subsidy will hit two stations already connected by linkgraph. Of course, overall income would be small if not negligible, because only small amount of cargo will fulfil such subsidy, but it is balanced by higher chance of any subsidy obtained without any effort.
Another strategy is to build many p2p services - singular subsidy would provide high revenue because all cargo count, but probability that given pair is chosen, is much smaller, seems that both strategies give same net profit, however cargodist network is usually more efficient in terms of station rating.

Of course if cargo distribution is in manual mode, subsidies works as usual.
Instead of patching the game, you can also make a gamescript, or use eg Bee Award.
Unfortunately there is only one gamescript slot.
By the way, how often players are using subsidies? In my opinion, it is rather useless feature, especially in case of complex economy, large map or hard settings, because short subsidy terms are not worth either invested money or just effort to make new connection. Players usually prefer to focus on expanding their own transport network instead and doesn't like being interrupted by side tasks.
My approach is to reuse subsidies to add bonuses for people using cargodist, which by now is counter-productive in comparison to single p2p service.
Currently I'm testing this patch, and by now it work fine. I just get not only neighbouring town subsidies, but also subsidy from town A to D with passengers going trough B and C. I will publish it after more tests.
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.
Wahazar
Tycoon
Tycoon
Posts: 1451
Joined: 18 Jan 2014 18:10

Re: Subsidies for cargodist

Post by Wahazar »

Subsidy patch attached.
Mostly subsidy.cpp is changed, and of course setting and version bump added.

If cargo distribution is set to manual, subsidy system work as usual.
In case of automatic cargo distribution, if "Allow subsidies...For manual or automatic cargo distribution" option is not choosen, subsidies are not generating as usual.
If given cargo group distribution is symmetric/asymetric and cargodist subsidies are allowed, they would appear regardless of percentage of cargo transported from source, while maximal distance between source and drain depend on map size and "distance effect on demand" linkgraph setting.
Attachments
subsidy2.patch
Cargodist subsidy v.2 patched on r27930
(12.24 KiB) Downloaded 132 times
Last edited by Wahazar on 21 Nov 2017 22:08, edited 1 time in total.
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.
Wahazar
Tycoon
Tycoon
Posts: 1451
Joined: 18 Jan 2014 18:10

Re: Subsidies for cargodist

Post by Wahazar »

IRC chat gave me idea of more general subsidy setting, with 3 states:
no subsidies, subsidies only in manual distribution mode, subsidies for all distribution modes.
I wonder, where I should insert such settings, in difficulty or economy settings?
User avatar
Gwyd
Chief Executive
Chief Executive
Posts: 721
Joined: 17 Apr 2017 16:52
Location: Western Ile-de-France Region

Re: Subsidies for cargodist

Post by Gwyd »

I think it'd be appropriate to put it under economy.
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: Subsidies for cargodist

Post by Alberth »

Gwyd wrote:I think it'd be appropriate to put it under economy.
+1
Being a retired OpenTTD developer does not mean I know what I am doing.
Wahazar
Tycoon
Tycoon
Posts: 1451
Joined: 18 Jan 2014 18:10

Re: Subsidies for cargodist

Post by Wahazar »

I uploaded ver.2 of subsidy patch in original post, now subsidy setting have three options - no subsidies at all, subsidies for manual cargo distribution only (standard) and subsidies also for automatic cargo distribution.

I tested this patch with 512x256 map, 32 towns, two independent networks (6 town interconnected in each one), effect of distance on demand 255, subsidy multiplier x4.
Without subsidies, I got 317kGPB after 10 years, with cargodist subsidies it was 395kGPB - at least one subsidy was captured during blind run. Of course such difference is small, but not negligible.
Larger network would be more effective, but it depend also on other settings.

I was testing also with two large networks and few p2p services, I never captured subsidy for these p2p services, while passenger and mail subsidies were claimed for networks (it works fine even if passengers must change trains/buses, of course amount of subsidized passengers with many hops is very low, but if you have such subsidy year by year, it is very satisfactory :)
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 12 guests