Playing around with FEAT_CARGOS profit callbacks in NML

Discuss, get help with, or post new graphics for TTDPatch and OpenTTD, using the NewGRF system, here. Graphics for plain TTD also acceptable here.

Moderator: Graphics Moderators

Post Reply
Cadde
Transport Coordinator
Transport Coordinator
Posts: 290
Joined: 07 Oct 2004 12:51

Playing around with FEAT_CARGOS profit callbacks in NML

Post by Cadde »

This isn't so much as a help request or anything as it is simply a request for review, input and ideas.

First and foremost, the idea here is to use GRF callbacks to change cargo payment rates to the values and shapes i really want from the game rather than the old boring BASE, T1, T2 format which only favors distance (all cargoes) and neglects time (passengers, perishables) or applies time where time is irrelevant. (raw bulk cargo)
... Ok, hear me out here. I get it that the idea is you pay for the distance you transport a cargo. But i just don't agree, especially for bulk cargo. I just can't think of it in any other way than "transporting raw goods = investment for transporting processed goods" so i am treating TTD as a mixed "industry tycoon" and "transport tycoon" game. Deal with it. ;)
Meanwhile, i of course want to have efficient transport networks in such a way that SOME raw goods MUST be transported quickly enough to where they don't rot away or become otherwise useless for the end destination(s). So some raw cargo would still need speedy transport solutions, but not all of them. And distance would have limited effect here unless it's a perishable cargo.

As for passengers, all would be well if passengers actually picked destinations based on their economy. Sure, cargodist helps some here but in the end, cargodist will happily let you send 100% of produced passengers diagonally across the map if you just shape the network as such. In my mind, passengers become tourists the moment they travel more than 400 tiles away. So i went about (trying to) making it unprofitable to transport passengers long distances.
Mind you, this is mainly an issue for train networks. Aircraft will still be super profitable, but also super expensive to compensate. So keep that in mind before looking at graphs thinking "lel, i can still make 100% profits using UFO X aircraft going 1 Ly/s.

--------------------------------------------------------------

Right, so what are we looking at?
openttd_2017-06-03_05-35-01.png
(38.67 KiB) Not downloaded yet
and...
OTTD Cargo Payment.vshost_2017-06-03_05-50-38.png
Wurst C# project evver
(208.91 KiB) Not downloaded yet
Yes, they are big. And yes, i am playing with all ECS vectors. In fact, the project is aimed at ECS Vectors only at the moment.

As you can tell from the second graph, the silly little C# app i made rather than set up a compile env for OTTD, i've reshaped the payment falloff in such a way that it becomes very unprofitable to transport passengers at distances that exceed their "designed time". Or, in other words. It might make more sense to transport passengers 50 tiles at a speed of 160 km/h (~8.6 days) than it is to do it at the same speed a distance of 100 tiles. Or that was the idea when i attempted to set it up.

So here's a question, how can i possibly do "pow(distance, 0.5)" in NML? I am currently looking at automating a switch with hard defined ranges with hardcoded values. But is there a better way?

Either way, i started writing this post about 6 hours ago and i am still not happy with the algorithm. In fact, i don't even know if the following NML is the same algo used in the pictures above.

Code: Select all

switch (FEAT_CARGOS, SELF, switch_passengers_profit,
	[
		// Distance
		STORE_TEMP(getbits(extra_callback_info2, 0, 16), 0),
		// Amount
		STORE_TEMP(getbits(extra_callback_info2, 16, 8), 1),
		// Time in "days" (~2.5 days per cargo cycle)
		STORE_TEMP(getbits(extra_callback_info2, 24, 8), 2),
		// Time "float" value
		STORE_TEMP(LOAD_TEMP(2) * 100, 3),
		// Time power base
		STORE_TEMP(max(0, LOAD_TEMP(3) / 2 - LOAD_TEMP(0)), 4)
	]
) {
	return max(1, (min(16384, LOAD_TEMP(0) * 16) - (LOAD_TEMP(4) * LOAD_TEMP(4)) / 10000));
}
But yeah, ideally the profits would not double with distance regardless of time. For example:
OTTD Cargo Payment.vshost_2017-06-03_12-31-40.png
(205.88 KiB) Not downloaded yet
And even better yet, if they were Pow(x, 0.5) or likewise.

Sorry for the confused post, but please share your thoughts and insights. Cheers!
Cadde
Transport Coordinator
Transport Coordinator
Posts: 290
Joined: 07 Oct 2004 12:51

Re: Playing around with FEAT_CARGOS profit callbacks in NML

Post by Cadde »

Ok, a new iteration. I think i am finally happy with this!
OTTD Cargo Payment.vshost_2017-06-04_06-50-03.png
(430.54 KiB) Not downloaded yet
Take 500 tiles distance as an example. (see picture)
I have reserved 20 days for station loading/unloading. That leaves 50 days in transport of passengers from A->B.

500/(70-20)/3.6 = 2.77...

Thus, to get the maximum possible payment on that trip, one would have to travel 277 km/h all the way. In other words, only the best of the high speed trains can do that.
At 200 tiles distance you need a train that goes 158 km/h to get max payment.
And at 100 tiles, you would need a train going 79 km/h.

On the other end of the spectrum... To go across 2,000 tiles, you need to go 505 km/h (with 40 days reserved loading time because aircraft) and being late is very unforgiving in that instance. You have 125 days of leeway on that distance. Or 83% of the trip is drop-off area where the 500 tile example has 142% drop-off area before you are paid a boot up the exhaust rather than your sweet fare.
And on top of that. You only get ~16000 callback return on 2000 tiles where you get 7008 on the 500 tile trip. That's only slightly more than twice the pay for 4 times the distance!

And as if that wasn't enough... Trips beyond 2000 tiles pay the SAME as 2000 tile trips. You only get some more (like 5 minutes per 100 tiles, good luck!) time to deliver your cargo.
In other words, no more diagonal cross map trips with planes! It's actually more profitable to do short trips now, all things considered.

OR, at least that's the idea. Here's the stuffs...

Code: Select all

switch (FEAT_CARGOS, SELF, switch_passengers_profit,
	[
		// Distance (2 decimal places)
		STORE_TEMP(getbits(extra_callback_info2, 0, 16) * 100, 0),
		// Amount
		STORE_TEMP(getbits(extra_callback_info2, 16, 8), 1),
		// Time in "days" (2 decimal places)
		STORE_TEMP(getbits(extra_callback_info2, 24, 8) * 100, 2),
		// Start the time power calcs late depending on distance.
		STORE_TEMP(max(0, LOAD_TEMP(2) - max(0, 1600 - LOAD_TEMP(0) / 150) - LOAD_TEMP(0) / 35), 3),
		// Store max working distance.
		STORE_TEMP(min(200000, LOAD_TEMP(0)), 4),
		// Calculate the dropoff power.
		STORE_TEMP(LOAD_TEMP(3) * LOAD_TEMP(3) / max(1, 4800 / max(1, LOAD_TEMP(0) / 4000)), 5),
	]
) {
	return max(1, min(16383,
		(
			LOAD_TEMP(4) - LOAD_TEMP(4) / 750 * LOAD_TEMP(4) / 750 -
			LOAD_TEMP(4) / 1200 * LOAD_TEMP(4) / 1200 -
			LOAD_TEMP(5)
		) / 100 * 16
	));
}
Or, if you are human like me and want humanly readable format...

Code: Select all

        private double CalculateProfits(int dist, int amount, int time) {
            dist *= 100;
            time *= 100;
            var t3 = Max(0, time - Max(0, 1600 - dist / 150) - dist / 35);
            var t4 = Min(200000, dist);
            var t5 = t3 * t3 / Max(1, 4800 / Max(1, dist / 4000));
            var res = Max(1, Min(16384, (t4 - t4 / 750 * t4 / 750 - t4 / 1200 * t4 / 1200 - t5) / 100 * 16));
            return res;
        }
Or maybe not so easy to read there either. But if you can, please let me know of any fatal flaws.
That being said, i know distances around 16000 tiles will eventually stop calculating the drop-off time. But i doubt one would transport passengers 16k tiles when doing so for 2k tiles pays just the same as isn't a complete chore.

Cheers!
Cadde
Transport Coordinator
Transport Coordinator
Posts: 290
Joined: 07 Oct 2004 12:51

Re: Playing around with FEAT_CARGOS profit callbacks in NML

Post by Cadde »

NOPE.avi, i wasn't happy with my last iteration at all!
OTTD Cargo Payment.vshost_2017-06-05_09-00-09.png
(345.12 KiB) Not downloaded yet
Stupid boats!
Now i've set it up so that there's "boat time / revenue" included in the calculations.
Basically, boats earn less than 10% around 16.6% of what a faster vehicle would on the same distance. Unless you have some kind of hax boat ofc that can cover the distance in the designed time.
This can in turn be adjusted by the boat running costs if need be.

Oh, and i spent way too much time getting some figures for my sanity... As in, i can look up in the table if the results match my expectations and adjust accordingly.

Code: Select all

========================================================================================================================================================================================================
PASSENGERS
········································································································································································································
Distance   Time to drop    Res   (inc%)        Speed   Load    Speed   Load    Speed   Load    Speed   Load    Speed   Load    Boat Time Start     Speed (LT 20)       Boat Time Drop  Speed (LT 20)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
10         72.5            38    (0%)          4.1     4       4.3     8       4.6     12      4.9     16      5.3     20      77.5                4.8                 80              4.6
20         72.5            78    (105.3%)      8.1     4       8.6     8       9.2     12      9.8     16      10.6    20      137.5               4.7                 317.5           1.9
30         67.5            118   (51.3%)       13.1    4       14      8       15      12      16.2    16      17.5    20      70                  16.7                72.5            15.9
40         67.5            158   (33.9%)       17.5    4       18.7    8       20      12      21.6    16      23.4    20      137.5               9.5                 315             3.8
50         67.5            197   (24.7%)       21.9    4       23.3    8       25      12      27      16      29.2    20      130                 12.6                315             4.7
60         67.5            236   (19.8%)       26.2    4       28      8       30      12      32.4    16      35.1    20      127.5               15.5                312.5           5.7
70         67.5            276   (16.9%)       30.6    4       32.7    8       35      12      37.8    16      40.9    20      132.5               17.3                310             6.7
80         67.5            315   (14.1%)       35      4       37.3    8       40      12      43.1    16      46.8    20      130                 20.2                310             7.7
90         67.5            354   (12.4%)       39.4    4       42      8       45      12      48.5    16      52.6    20      127.5               23.3                307.5           8.7
100        67.5            393   (11%)         43.7    4       46.7    8       50.1    12      53.9    16      58.5    20      132.5               24.7                307.5           9.7
200        67.5            776   (97.5%)       87.5    4       93.4    8       100.1   12      107.9   16      117     20      130                 50.5                290             20.6
300        67.5            1147  (47.8%)       131.2   4       140.1   8       150.2   12      161.8   16      175.4   20      130                 75.8                275             32.7
400        70              1506  (31.3%)       168.4   4       179.2   8       191.6   12      205.8   16      222.2   20      132.5               98.8                260             46.3
500        70              1855  (23.2%)       210.4   4       224     8       239.5   12      257.2   16      277.8   20      132.5               123.5               245             61.7
600        72.5            2188  (18%)         243.3   4       258.4   8       275.5   12      295     16      317.5   20      132.5               148.1               230             79.4
700        72.5            2517  (15%)         283.9   4       301.5   8       321.4   12      344.1   16      370.4   20      132.5               172.8               215             99.7
800        75              2826  (12.3%)       313     4       331.7   8       352.7   12      376.6   16      404     20      135                 193.2               200             123.5
900        75              3130  (10.8%)       352.1   4       373.1   8       396.8   12      423.7   16      454.5   20      135                 217.4               182.5           153.8
1000       77.5            3418  (9.2%)        377.9   4       399.7   8       424.1   12      451.7   16      483.1   20      135                 241.5               167.5           188.3
1100       77.5            3700  (8.3%)        415.7   4       439.6   8       466.5   12      496.8   16      531.4   20      135                 265.7               152.5           230.6
1200       80              3961  (7.1%)        438.6   4       463     8       490.2   12      520.8   16      555.6   20      155                 246.9               635             54.2
1300       80              4224  (6.6%)        475.1   4       501.5   8       531     12      564.2   16      601.9   20      142.5               294.8               635             58.7
1400       82.5            4460  (5.6%)        495.4   4       522     8       551.6   12      584.8   16      622.2   20      142.5               317.5               635             63.2
1500       82.5            4697  (5.3%)        530.8   4       559.3   8       591     12      626.6   16      666.7   20      145                 333.3               635             67.8
1600       85              4914  (4.6%)        548.7   4       577.2   8       608.8   12      644.1   16      683.8   20      145                 355.6               635             72.3
1700       85              5129  (4.4%)        583     4       613.3   8       646.9   12      684.4   16      726.5   20      145                 377.8               635             76.8
1800       87.5            5318  (3.7%)        598.8   4       628.9   8       662.3   12      699.3   16      740.7   20      147.5               392.2               635             81.3
1900       87.5            5515  (3.7%)        632.1   4       663.9   8       699     12      738.2   16      781.9   20      147.5               413.9               635             85.8
2000       90              5679  (3%)          646     4       677.5   8       712.3   12      750.8   16      793.7   20      147.5               435.7               635             90.3
2100       90              5687  (0.1%)        678.3   4       711.4   8       747.9   12      788.3   16      833.3   20      147.5               457.5               635             94.9
2200       92.5            5678  (-0.2%)       690.5   4       723.2   8       759.1   12      798.8   16      842.9   20      147.5               479.3               635             99.4
2300       92.5            5687  (0.2%)        721.9   4       756.1   8       793.7   12      835.1   16      881.2   20      147.5               501.1               635             103.9
2400       95              5677  (-0.2%)       732.6   4       766.3   8       803.2   12      843.9   16      888.9   20      147.5               522.9               635             108.4
2500       95              5687  (0.2%)        763.1   4       798.2   8       836.7   12      879     16      925.9   20      147.5               544.7               635             112.9
2600       97.5            5675  (-0.2%)       772.4   4       807     8       844.7   12      886.2   16      931.9   20      147.5               566.4               635             117.4
2700       97.5            5686  (0.2%)        802.1   4       838     8       877.2   12      920.2   16      967.7   20      147.5               588.2               635             122
2800       100             5674  (-0.2%)       810.2   4       845.4   8       883.8   12      925.9   16      972.2   20      147.5               610                 635             126.5
2900       100             5686  (0.2%)        839.1   4       875.6   8       915.4   12      959     16      1006.9  20      147.5               631.8               635             131
3000       102.5           5674  (-0.2%)       846     4       881.8   8       920.8   12      963.4   16      1010.1  20      150                 641                 635             135.5
3100       102.5           5686  (0.2%)        874.2   4       911.2   8       951.5   12      995.5   16      1043.8  20      150                 662.4               635             140
3200       105             5672  (-0.2%)       880.1   4       916.4   8       955.8   12      998.8   16      1045.8  20      150                 683.8               635             144.5
3300       105             5685  (0.2%)        907.6   4       945     8       985.7   12      1030    16      1078.4  20      150                 705.1               635             149.1
3400       107.5           5671  (-0.2%)       912.5   4       949.2   8       988.9   12      1032.2  16      1079.4  20      152.5               712.8               635             153.6
3500       107.5           5685  (0.2%)        939.3   4       977.1   8       1018    12      1062.5  16      1111.1  20      152.5               733.8               635             158.1
3600       110             5670  (-0.3%)       943.4   4       980.4   8       1020.4  12      1063.8  16      1111.1  20      152.5               754.7               635             162.6
3700       110             5685  (0.3%)        969.6   4       1007.6  8       1048.8  12      1093.4  16      1142    20      152.5               775.7               635             167.1
3800       112.5           5668  (-0.3%)       972.9   4       1010.1  8       1050.3  12      1093.8  16      1141.1  20      152.5               796.6               635             171.6
3900       112.5           5685  (0.3%)        998.5   4       1036.7  8       1077.9  12      1122.6  16      1171.2  20      155                 802.5               635             176.2
4000       115             5668  (-0.3%)       1001    4       1038.4  8       1078.7  12      1122.3  16      1169.6  20      155                 823                 635             180.7
Times are in days. Speeds are in km/h. I will leave the rest up to you to figure out.

If anyone wants the formulas etc then ask. I am not done converting to NML quite yet.
But here's the C# version so far...

Code: Select all

        private int CalculateProfitsNMLPerishable(int dist, int amount, int time, int lowDistanceOffset = 1600, int lowDistanceReductionInterval = 150, int longDistanceOffsetInterval = 35,
                                                     int dropoffRateBaseLength = 4800, int dropoffRateDistanceIncreaseInterval = 4000,
                                                     int distanceDiminishingReturns1 = 750, int distanceDiminishingReturns2 = 1200, 
                                                     int maxDistance = 2000, int lastDropoffOffset = 12800) {
            var t0 = dist * 100;
            var t1 = amount * 100;
            var t2 = time * 100;
            var t3 = lowDistanceOffset;
            var t4 = lowDistanceReductionInterval;
            var t5 = longDistanceOffsetInterval;
            var t6 = dropoffRateBaseLength;
            var t7 = dropoffRateDistanceIncreaseInterval;
            var t8 = distanceDiminishingReturns1;
            var t9 = distanceDiminishingReturns2;
            var t10 = maxDistance;
            var t11 = lastDropoffOffset;

            var t12 = Max(0, t2 - Max(0, t11 - t0 / (t4 / 14)) - t0 / t5) / 2;
            var t13 = Max(0, t2 - Max(0, t3 - t0 / t4) - t0 / t5);
            var t14 = Min(t10 * 100, t0);
            var t15 = t13 * t13 / Max(1, t6 / Max(1, t0 / t7));
            var t16 = t14 - t14 / t8 * t14 / t8 - t14 / t9 * t14 / t9;

            var res = Max(1, Min(16384,
                                 Max(
                                     (t16 - t15) / 25,
                                     (t16 - t12 * t12) / 150
                                 )
                          ));
            return res;
        }
Yes, as you can see, i have prepared to feed parameters into a switch_perishable_cargo branch in NML. Each cargo type will store temp values with parameters to feed into the respective formulas for cargoes.

Here's the specs for passengers:

Code: Select all

new PerishableCargoDefinition {
                              ID = "PASS",
                              LowDistanceOffset = 2500,
                              LowDistanceReductionInterval = 200,
                              LongDistanceOffsetInterval = 100,
                              DropoffRateBaseLength = 4800,
                              DropoffRateDistanceIncreaseInterval = 1500,
                              DistanceDiminishingReturns1 = 1000,
                              DistanceDiminishingReturns2 = 1500,
                              MaxDistance = 2000,
                              LastDropoffOffset = 12800,
                          }

... One of these days... I might actually be able to play again!

EDIT: Oh and yes, there's no "need" for supersonic jets according to the table. But that's before one considers the fact that passengers need to leave the airport as well. So there's time allotted for that.

Also, boats stop "working for you" after 500 to 700 tiles or so. And then you need the hovercraft either way.
The target distance for boats is 200 tiles. Then you can run ferries. Beyond that, you are looking at tourists for profits. :D
Last edited by Cadde on 05 Jun 2017 15:18, edited 1 time in total.
User avatar
Leanden
Tycoon
Tycoon
Posts: 2613
Joined: 19 Mar 2009 19:25
Location: Kent

Re: Playing around with FEAT_CARGOS profit callbacks in NML

Post by Leanden »

Very interesting project your are working on.

I cant comment much on the code as i havent delved into NML cargoes as of yet, but the concept would certainly increase the level of difficulty beyond just increasing costs.

Watching intently.
Image
Cadde
Transport Coordinator
Transport Coordinator
Posts: 290
Joined: 07 Oct 2004 12:51

Re: Playing around with FEAT_CARGOS profit callbacks in NML

Post by Cadde »

Thank you Leanden!

I have been a bit busy lately but here's my idea for non-perishable cargoes... But eeh, mail is kinda perishable... So it's a cargo with a possible timeout.
OTTD Cargo Payment.vshost_2017-06-08_00-06-32.png
(326.99 KiB) Not downloaded yet
Now, before you ask... 600 days? Nah, more like 600 minutes! Because that's how i play! 600 minutes is 10 hours BTW, so basically, one would have 10 hours (yes, the dropoff is behind the legend in the graph) to deliver mail unlike other non-perishable cargoes like coal and steel for example. I am going to use the same function for those but with the timeout at 256 so you can take a whole millennium to transport those.

And here's the debug output:

Code: Select all

========================================================================================================================================================================================================
MAIL
········································································································································································································
Distance   Time to drop    Res   (inc%)        Speed   Load    Speed   Load    Speed   Load    Speed   Load    Speed   Load    Boat Time Start     Speed (LT 20)       Boat Time Drop  Speed (LT 20)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1          600.0           900   (0%)          0.0     20
50         600.0           4237  (370.8%)      2.4     20
100        600.0           4837  (14.2%)       4.8     20
150        600.0           5203  (7.6%)        7.2     20
200        600.0           5437  (4.5%)        9.6     20
250        600.0           5671  (4.3%)        12.0    20
300        600.0           5803  (2.3%)        14.4    20
350        600.0           5920  (2%)          16.8    20
400        600.0           6037  (2%)          19.2    20
450        600.0           6154  (1.9%)        21.6    20
500        600.0           6271  (1.9%)        23.9    20
550        600.0           6344  (1.2%)        26.3    20
600        600.0           6403  (0.9%)        28.7    20
650        600.0           6461  (0.9%)        31.1    20
700        600.0           6520  (0.9%)        33.5    20
750        600.0           6578  (0.9%)        35.9    20
800        600.0           6637  (0.9%)        38.3    20
850        600.0           6696  (0.9%)        40.7    20
900        600.0           6754  (0.9%)        43.1    20
950        600.0           6813  (0.9%)        45.5    20
1000       600.0           6871  (0.9%)        47.9    20
1050       600.0           6915  (0.6%)        50.3    20
1100       600.0           6944  (0.4%)        52.7    20
1150       600.0           6973  (0.4%)        55.1    20
1200       600.0           7003  (0.4%)        57.5    20
1250       600.0           7032  (0.4%)        59.9    20
1300       600.0           7061  (0.4%)        62.3    20
1350       600.0           7091  (0.4%)        64.7    20
1400       600.0           7120  (0.4%)        67.0    20
1450       600.0           7149  (0.4%)        69.4    20
1500       600.0           7178  (0.4%)        71.8    20
1550       600.0           7208  (0.4%)        74.2    20
1600       600.0           7237  (0.4%)        76.6    20
1650       600.0           7266  (0.4%)        79.0    20
1700       600.0           7296  (0.4%)        81.4    20
1750       600.0           7325  (0.4%)        83.8    20
1800       600.0           7354  (0.4%)        86.2    20
1850       600.0           7383  (0.4%)        88.6    20
1900       600.0           7413  (0.4%)        91.0    20
1950       600.0           7442  (0.4%)        93.4    20
2000       600.0           7471  (0.4%)        95.8    20
As you can see, boats can feasibly carry mail about 600 tiles on 32 km/h with 20 minutes of loading time.
And pretty much any train can deliver mail in time as well on distances up to and beyond 2000 tiles. So it's just a matter of getting it over there without stalling (or loading) for too long.

I've left passengers in the graph for comparison. Unless you deliver mail on very short distances, it will generally pay as much as carrying passengers some 1,700 tiles. I actually intend to keep it that way in the "price_factor" variable as well. Mail is quite "rare" compared to passengers and other cargoes. Transporting mail therefore should be somewhat more profitable IMHO.

Of course, my idea here is to share my plans in full with you guys as well as make it easy to modify the parameters. So you could just change that later if you feel like it.

This time around i went with a simpler formula, still diminishing returns but easier to modify.

Code: Select all

       private int CalculateProfitsNMLBulkCargo(int dist, int amount, int time, int baseOffset = 900, int distanceMultiplier = 600, int maxDeliveryTime = 256) {
            var t0 = dist;
            var t2 = time;

            var t3 = baseOffset;
            var t4 = distanceMultiplier;
            var t5 = maxDeliveryTime;

            var t10 =
                (t0 & 0x8000) > 1 ? 15 :
                (t0 & 0x4000) > 1 ? 14 :
                (t0 & 0x2000) > 1 ? 13 :
                (t0 & 0x1000) > 1 ? 12 :
                (t0 & 0x800) > 1 ? 11 :
                (t0 & 0x400) > 1 ? 10 :
                (t0 & 0x200) > 1 ? 9 :
                (t0 & 0x100) > 1 ? 8 :
                (t0 & 0x80) > 1 ? 7 :
                (t0 & 0x40) > 1 ? 6 :
                (t0 & 0x20) > 1 ? 5 :
                (t0 & 0x10) > 1 ? 4 :
                (t0 & 0x8) > 1 ? 3 :
                (t0 & 0x4) > 1 ? 2 :
                (t0 & 0x2) > 1 ? 1 :
                0;

            var t11 = t0 % (1 << t10);
            var t12 = t10 > 0 ? (t4 * 10000) / (1 << t10) * t11 : 0;
            var res = Max(1, Min(8192, (t3 + t10 * t4 + t12 / 10000) * (t2 >= t5 ? 0 : 1)));
No NML version yet. Ask i will formulate it for you.

It's basically...

(base_distance + log2(distance) * distanceMultiplier + distanceMultiplier / pow(2, log2(distance)) * (time >= maxDeliveryTime ? 0 : 1)

The latter part is a on/off switch that multiplies the whole formula by one IF time hasn't elapsed past the designated point.

Code: Select all

                { "MAIL", new BulkCargoDefinition {
                    ID = "MAIL",
                    BaseOffset = 900,
                    DistanceMultiplier = 600,
                    MaxDeliveryTime = 240,
                } },
So, every doubling of the distance, the result value linearly interpolates between log2(distance) * 600 and (log2(distance) + 1) * 600 and adds 900 to that.
Because of that linear interpolation, you get some "grouping" in the graph between each doubling of distance.

Please let me know if i made any stupid mistakes. Also, if you are mathematically inclined (which i am not) then please comment on my perishable cargo formula. I just kept adding, changing and removing stuff until i saw values that i liked. I barely understand it at all myself. And i feel there's some unnecessary calculations in there that could be replaced with less confusing and less demanding formulas.
After all, it's based on 1 - 1/n and a square drop off curve. There's so much unnecessary stuff in there i am sure!

... If only NewGRF could work with floating point values in temporary storage as well as returns.
Cadde
Transport Coordinator
Transport Coordinator
Posts: 290
Joined: 07 Oct 2004 12:51

Re: Playing around with FEAT_CARGOS profit callbacks in NML

Post by Cadde »

I know it's been a long long while since i posted in this thread. But there's been so much else going on alongside this project... Such as "fixing" 2ccts in NML, altering ECS Vectors cargo acceptance limits on certain industries, walking my dogs, riding my bike...

But every once in a while, i've found time to actually play the game and find out that the parameters i've given are not really up to par just yet. And as such, growing ever so tired of manually updating, compiling, looking at graphs, wondering, doing math like a methhead does meth...
Here be something that should (hopefully already, or in the future if people are interested) make it possible to edit cargo profits using a visual GUI.

Nuff talk, huge images plox!
Image

And instead of me typing any more than necessary, just look at the repository: https://github.com/TheCadde/OTTD-Cargo-payment

And as per usual, yes, it's absolutely horrible. Towards the end (reaching the milestone of actually writing NML code and compiling it) i got fed up with the project. So let me know if you want more or if it's just going to be yet another forgotten code on my drive and github account.

EDIT: Oh and i will make a binary release right now so you won't have to compile yourself. Obviously windows only.
EDIT #2: Here's the binary release: https://github.com/TheCadde/OTTD-Cargo- ... re-alpha-1

Make sure you crash it a lot and blame me for it.
kayrice
Engineer
Engineer
Posts: 4
Joined: 04 Jul 2017 09:42

Re: Playing around with FEAT_CARGOS profit callbacks in NML

Post by kayrice »

Hi! Awesome work so far.

My friends and I want basically the same thing as you, except we simply want distance to be ignored for all cargo types except passengers. That or we want the setting to only apply penalties but not bonuses if that makes sense. However, we understand little about NewGRF or NML. Looking at your code posted above you describe that switch() but what we don't understand is how to "install" that switch for all cargo types or any of that. Can someone help a guy out?
Cadde
Transport Coordinator
Transport Coordinator
Posts: 290
Joined: 07 Oct 2004 12:51

Re: Playing around with FEAT_CARGOS profit callbacks in NML

Post by Cadde »

kayrice wrote:Hi! Awesome work so far.
Thank you!
kayrice wrote:My friends and I want basically the same thing as you, except we simply want distance to be ignored for all cargo types except passengers.
Unfortunately, there is no (currently) formula in the application i've made that handles linear distances. But you can get pretty close...

Setting the parameters of a bulk cargo as such:
Image

Results in this:
Image

Here's the detailed info:
Image

As you can see, it's not perfect. 1000 tiles distance gives 15.8% of the maximum possible profits. Whereas double that distance (2000 tiles) gives 30.4% when it should have been 31.6% and technically they should be evenly distributed.
But as i said, it's because i only have formulas set up for diminishing returns at distances. However, the differences with these settings are hardly noticeable when playing. So you could do that, or you could add another formula.

On the flip side...

If you want distance to not matter at all. Then you can simply change the linearity value to 1.

Image

Code: Select all

==========================================================================================================================================================================================================================
MAIL        Speeds are in km/h, values in paratheses such as in "Speed(4)" refers to loading time in days/minutes.
··························································································································································································································
Distance    ║   Primary time    Result  |   Speed(4)    Speed(8)    Speed(12)   Speed(16)   Speed(20)   ║   Secondary time      Result  |   Speed(4)    Speed(8)    Speed(12)   Speed(16)   Speed(20)   ║   Last result
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1           ║   Infinity        500     |   0           0           0           0           0           ║   Infinity            500     |   0           0           0           0           0           ║   500
1           ║   Infinity        500     |   0           0           0           0           0           ║   Infinity            500     |   0           0           0           0           0           ║   500
2           ║   Infinity        666     |   0           0           0           0           0           ║   Infinity            666     |   0           0           0           0           0           ║   666
3           ║   Infinity        750     |   0           0           0           0           0           ║   Infinity            750     |   0           0           0           0           0           ║   750
4           ║   Infinity        800     |   0           0           0           0           0           ║   Infinity            800     |   0           0           0           0           0           ║   800
5           ║   Infinity        833     |   0           0           0           0           0           ║   Infinity            833     |   0           0           0           0           0           ║   833
6           ║   Infinity        857     |   0           0           0           0           0           ║   Infinity            857     |   0           0           0           0           0           ║   857
7           ║   Infinity        875     |   0           0           0           0           0           ║   Infinity            875     |   0           0           0           0           0           ║   875
8           ║   Infinity        888     |   0           0           0           0           0           ║   Infinity            888     |   0           0           0           0           0           ║   888
9           ║   Infinity        900     |   0           0           0           0           0           ║   Infinity            900     |   0           0           0           0           0           ║   900
10          ║   Infinity        909     |   0           0           0           0           0           ║   Infinity            909     |   0           0           0           0           0           ║   909
11          ║   Infinity        916     |   0           0           0           0           0           ║   Infinity            916     |   0           0           0           0           0           ║   916
12          ║   Infinity        923     |   0           0           0           0           0           ║   Infinity            923     |   0           0           0           0           0           ║   923
13          ║   Infinity        928     |   0           0           0           0           0           ║   Infinity            928     |   0           0           0           0           0           ║   928
14          ║   Infinity        933     |   0           0           0           0           0           ║   Infinity            933     |   0           0           0           0           0           ║   933
15          ║   Infinity        937     |   0           0           0           0           0           ║   Infinity            937     |   0           0           0           0           0           ║   937
16          ║   Infinity        941     |   0           0           0           0           0           ║   Infinity            941     |   0           0           0           0           0           ║   941
17          ║   Infinity        944     |   0           0           0           0           0           ║   Infinity            944     |   0           0           0           0           0           ║   944
18          ║   Infinity        947     |   0           0           0           0           0           ║   Infinity            947     |   0           0           0           0           0           ║   947
19          ║   Infinity        950     |   0           0           0           0           0           ║   Infinity            950     |   0           0           0           0           0           ║   950
20          ║   Infinity        952     |   0           0           0           0           0           ║   Infinity            952     |   0           0           0           0           0           ║   952
21          ║   Infinity        954     |   0           0           0           0           0           ║   Infinity            954     |   0           0           0           0           0           ║   954
22          ║   Infinity        956     |   0           0           0           0           0           ║   Infinity            956     |   0           0           0           0           0           ║   956
23          ║   Infinity        958     |   0           0           0           0           0           ║   Infinity            958     |   0           0           0           0           0           ║   958
24          ║   Infinity        960     |   0           0           0           0           0           ║   Infinity            960     |   0           0           0           0           0           ║   960
25          ║   Infinity        961     |   0           0           0           0           0           ║   Infinity            961     |   0           0           0           0           0           ║   961
26          ║   Infinity        962     |   0           0           0           0           0           ║   Infinity            962     |   0           0           0           0           0           ║   962
27          ║   Infinity        964     |   0           0           0           0           0           ║   Infinity            964     |   0           0           0           0           0           ║   964
28          ║   Infinity        965     |   0           0           0           0           0           ║   Infinity            965     |   0           0           0           0           0           ║   965
29          ║   Infinity        966     |   0           0           0           0           0           ║   Infinity            966     |   0           0           0           0           0           ║   966
30          ║   Infinity        967     |   0           0           0           0           0           ║   Infinity            967     |   0           0           0           0           0           ║   967
31          ║   Infinity        968     |   0           0           0           0           0           ║   Infinity            968     |   0           0           0           0           0           ║   968
32          ║   Infinity        969     |   0           0           0           0           0           ║   Infinity            969     |   0           0           0           0           0           ║   969
33          ║   Infinity        970     |   0           0           0           0           0           ║   Infinity            970     |   0           0           0           0           0           ║   970
34          ║   Infinity        971     |   0           0           0           0           0           ║   Infinity            971     |   0           0           0           0           0           ║   971
35          ║   Infinity        972     |   0           0           0           0           0           ║   Infinity            972     |   0           0           0           0           0           ║   972
36          ║   Infinity        972     |   0           0           0           0           0           ║   Infinity            972     |   0           0           0           0           0           ║   972
37          ║   Infinity        973     |   0           0           0           0           0           ║   Infinity            973     |   0           0           0           0           0           ║   973
38          ║   Infinity        974     |   0           0           0           0           0           ║   Infinity            974     |   0           0           0           0           0           ║   974
39          ║   Infinity        975     |   0           0           0           0           0           ║   Infinity            975     |   0           0           0           0           0           ║   975
40          ║   Infinity        975     |   0           0           0           0           0           ║   Infinity            975     |   0           0           0           0           0           ║   975
41          ║   Infinity        976     |   0           0           0           0           0           ║   Infinity            976     |   0           0           0           0           0           ║   976
42          ║   Infinity        976     |   0           0           0           0           0           ║   Infinity            976     |   0           0           0           0           0           ║   976
43          ║   Infinity        977     |   0           0           0           0           0           ║   Infinity            977     |   0           0           0           0           0           ║   977
44          ║   Infinity        977     |   0           0           0           0           0           ║   Infinity            977     |   0           0           0           0           0           ║   977
45          ║   Infinity        978     |   0           0           0           0           0           ║   Infinity            978     |   0           0           0           0           0           ║   978
46          ║   Infinity        978     |   0           0           0           0           0           ║   Infinity            978     |   0           0           0           0           0           ║   978
47          ║   Infinity        979     |   0           0           0           0           0           ║   Infinity            979     |   0           0           0           0           0           ║   979
48          ║   Infinity        979     |   0           0           0           0           0           ║   Infinity            979     |   0           0           0           0           0           ║   979
49          ║   Infinity        980     |   0           0           0           0           0           ║   Infinity            980     |   0           0           0           0           0           ║   980
50          ║   Infinity        980     |   0           0           0           0           0           ║   Infinity            980     |   0           0           0           0           0           ║   980
51          ║   Infinity        980     |   0           0           0           0           0           ║   Infinity            980     |   0           0           0           0           0           ║   980
52          ║   Infinity        981     |   0           0           0           0           0           ║   Infinity            981     |   0           0           0           0           0           ║   981
53          ║   Infinity        981     |   0           0           0           0           0           ║   Infinity            981     |   0           0           0           0           0           ║   981
54          ║   Infinity        981     |   0           0           0           0           0           ║   Infinity            981     |   0           0           0           0           0           ║   981
55          ║   Infinity        982     |   0           0           0           0           0           ║   Infinity            982     |   0           0           0           0           0           ║   982
56          ║   Infinity        982     |   0           0           0           0           0           ║   Infinity            982     |   0           0           0           0           0           ║   982
57          ║   Infinity        982     |   0           0           0           0           0           ║   Infinity            982     |   0           0           0           0           0           ║   982
58          ║   Infinity        983     |   0           0           0           0           0           ║   Infinity            983     |   0           0           0           0           0           ║   983
59          ║   Infinity        983     |   0           0           0           0           0           ║   Infinity            983     |   0           0           0           0           0           ║   983
60          ║   Infinity        983     |   0           0           0           0           0           ║   Infinity            983     |   0           0           0           0           0           ║   983
61          ║   Infinity        983     |   0           0           0           0           0           ║   Infinity            983     |   0           0           0           0           0           ║   983
62          ║   Infinity        984     |   0           0           0           0           0           ║   Infinity            984     |   0           0           0           0           0           ║   984
63          ║   Infinity        984     |   0           0           0           0           0           ║   Infinity            984     |   0           0           0           0           0           ║   984
64          ║   Infinity        984     |   0           0           0           0           0           ║   Infinity            984     |   0           0           0           0           0           ║   984
65          ║   Infinity        984     |   0           0           0           0           0           ║   Infinity            984     |   0           0           0           0           0           ║   984
66          ║   Infinity        985     |   0           0           0           0           0           ║   Infinity            985     |   0           0           0           0           0           ║   985
67          ║   Infinity        985     |   0           0           0           0           0           ║   Infinity            985     |   0           0           0           0           0           ║   985
68          ║   Infinity        985     |   0           0           0           0           0           ║   Infinity            985     |   0           0           0           0           0           ║   985
69          ║   Infinity        985     |   0           0           0           0           0           ║   Infinity            985     |   0           0           0           0           0           ║   985
70          ║   Infinity        985     |   0           0           0           0           0           ║   Infinity            985     |   0           0           0           0           0           ║   985
71          ║   Infinity        986     |   0           0           0           0           0           ║   Infinity            986     |   0           0           0           0           0           ║   986
72          ║   Infinity        986     |   0           0           0           0           0           ║   Infinity            986     |   0           0           0           0           0           ║   986
73          ║   Infinity        986     |   0           0           0           0           0           ║   Infinity            986     |   0           0           0           0           0           ║   986
74          ║   Infinity        986     |   0           0           0           0           0           ║   Infinity            986     |   0           0           0           0           0           ║   986
75          ║   Infinity        986     |   0           0           0           0           0           ║   Infinity            986     |   0           0           0           0           0           ║   986
76          ║   Infinity        987     |   0           0           0           0           0           ║   Infinity            987     |   0           0           0           0           0           ║   987
77          ║   Infinity        987     |   0           0           0           0           0           ║   Infinity            987     |   0           0           0           0           0           ║   987
78          ║   Infinity        987     |   0           0           0           0           0           ║   Infinity            987     |   0           0           0           0           0           ║   987
79          ║   Infinity        987     |   0           0           0           0           0           ║   Infinity            987     |   0           0           0           0           0           ║   987
80          ║   Infinity        987     |   0           0           0           0           0           ║   Infinity            987     |   0           0           0           0           0           ║   987
81          ║   Infinity        987     |   0           0           0           0           0           ║   Infinity            987     |   0           0           0           0           0           ║   987
82          ║   Infinity        987     |   0           0           0           0           0           ║   Infinity            987     |   0           0           0           0           0           ║   987
83          ║   Infinity        988     |   0           0           0           0           0           ║   Infinity            988     |   0           0           0           0           0           ║   988
84          ║   Infinity        988     |   0           0           0           0           0           ║   Infinity            988     |   0           0           0           0           0           ║   988
85          ║   Infinity        988     |   0           0           0           0           0           ║   Infinity            988     |   0           0           0           0           0           ║   988
86          ║   Infinity        988     |   0           0           0           0           0           ║   Infinity            988     |   0           0           0           0           0           ║   988
87          ║   Infinity        988     |   0           0           0           0           0           ║   Infinity            988     |   0           0           0           0           0           ║   988
88          ║   Infinity        988     |   0           0           0           0           0           ║   Infinity            988     |   0           0           0           0           0           ║   988
89          ║   Infinity        988     |   0           0           0           0           0           ║   Infinity            988     |   0           0           0           0           0           ║   988
90          ║   Infinity        989     |   0           0           0           0           0           ║   Infinity            989     |   0           0           0           0           0           ║   989
91          ║   Infinity        989     |   0           0           0           0           0           ║   Infinity            989     |   0           0           0           0           0           ║   989
92          ║   Infinity        989     |   0           0           0           0           0           ║   Infinity            989     |   0           0           0           0           0           ║   989
93          ║   Infinity        989     |   0           0           0           0           0           ║   Infinity            989     |   0           0           0           0           0           ║   989
94          ║   Infinity        989     |   0           0           0           0           0           ║   Infinity            989     |   0           0           0           0           0           ║   989
95          ║   Infinity        989     |   0           0           0           0           0           ║   Infinity            989     |   0           0           0           0           0           ║   989
96          ║   Infinity        989     |   0           0           0           0           0           ║   Infinity            989     |   0           0           0           0           0           ║   989
97          ║   Infinity        989     |   0           0           0           0           0           ║   Infinity            989     |   0           0           0           0           0           ║   989
98          ║   Infinity        989     |   0           0           0           0           0           ║   Infinity            989     |   0           0           0           0           0           ║   989
99          ║   Infinity        990     |   0           0           0           0           0           ║   Infinity            990     |   0           0           0           0           0           ║   990
100         ║   Infinity        990     |   0           0           0           0           0           ║   Infinity            990     |   0           0           0           0           0           ║   990

I could make a formula that completely ignores distance, quite easily in fact. And even then, once you've pressed the "compile" button, the autogenerated NML file is still there.
One could simply replace the diminishing returns formula in the NML file with a constant value.
kayrice wrote:That or we want the setting to only apply penalties but not bonuses if that makes sense.
There are no bonuses in my formulas or in callbacks in general. Only penalties (as far as the vanilla game is concerned) that are limited in severity by altering the parameters.

The one thing you cannot alter is how much you get in the OTTD source code itself. IIRC, it's something along the lines of "callback * amount * price_factor / 8192", that is, the amount variable cannot be changed.
But you could technically return the max value (12748) and divide that by the amount variable that one can get in the callback itself to negate it.
kayrice wrote:However, we understand little about NewGRF or NML. Looking at your code posted above you describe that switch() but what we don't understand is how to "install" that switch for all cargo types or any of that. Can someone help a guy out?
Well, you could use a bunch of different methods but i would recommend using the application i've made for that ofc.
First and foremost, you need to know what cargoes you are working on. If they are vanilla cargoes then you can check here for their defaults: https://newgrf-specs.tt-wiki.net/wiki/CargoDefaultProps
Otherwise, you need to check the sources of the industry set(s) you are using.

Then you simply save a clone of the default ECS Vectors template i have set up currently and remove/edit the cargoes to your liking. Making sure their ItemID's are the same as the slot (ID) from the default cargoes linked above or whatever they are in their respective industry sets.
Unfortunately, it's not possible (currently) to convert a perishable cargo to a bulk cargo in the application. The perishable cargoes are Passengers, Tourists, Food, Fruit, Fish, Cereals and livestock in the ECS vectors template.

Which brings me to another point. Templates... You would have to add the relevant "cargo scheme" template files to the "NMLTemplates" folder in the applications directory. Or manually add the necessary GRF information yourself to the auto generated NML file in the "Output" directory.
At this point, i feel it's better if users of the application would ask specific questions if they get stuck trying to implement my templating technique to other industry sets / vanilla rather than me explaining every step.

Returning to your specific question about ignoring distances completely, in the output file you would find this switch:

Code: Select all

switch (FEAT_CARGOS, SELF, switch_perishable_cargo_profit,
[
    // CALLBACK VARIABLES
    // 0: distance
    STORE_TEMP(getbits(extra_callback_info2, 0, 16), 0),
    // 1: time
    STORE_TEMP(getbits(extra_callback_info2, 24, 8), 1),
    
...
    // CALCULATION VARIABLES
    // 21: diminishingReturns
    STORE_TEMP((100000 - LOAD_TEMP(3) * 100000 / (min(LOAD_TEMP(0), LOAD_TEMP(2)) + LOAD_TEMP(3))) / (100 - LOAD_TEMP(3) * 100 / (LOAD_TEMP(2) + LOAD_TEMP(3))), 21),
...
]) {
    return max(1,
        min(1000,
            max(
                LOAD_TEMP(21) - LOAD_TEMP(23),
                max(LOAD_TEMP(21) / LOAD_TEMP(15) - LOAD_TEMP(25),
                    LOAD_TEMP(21) / LOAD_TEMP(16))
                )
        ));
}
And replace the "diminishingReturns" calculation with a hardcoded value. For example:

Code: Select all

// 21: diminishingReturns
    STORE_TEMP(1000, 21),
...
As that's the maximum return value of the diminishing returns formula. Consequently, in the template, 1000 is also the maximum possible return value of the callback. If you want higher returns you would have to edit the related perishable/bulk templates as well changing "return max(1, min(1000..." to a different value.
Of course, there's a similar switch for bulk cargo calculations in the same file. You need to find and edit that as well.
Or, if you want SOME cargoes to care about distance but not others, you can simply duplicate the switch and rename it, alter it and reference it on a per cargo basis.

Once you are done with adding cargoes, templates and editing the output NML file. You just compile with NMLC as per usual and copy the grf file to your documents\ottd\newgrf folder.

Have you tried this and it's still unclear? Feel free to ask about where you got stuck.
And i could add more formulas and templates to the application itself but that would take longer than me responding here.
kayrice
Engineer
Engineer
Posts: 4
Joined: 04 Jul 2017 09:42

Re: Playing around with FEAT_CARGOS profit callbacks in NML

Post by kayrice »

Here is what we came up with:

https://github.com/krisives/openttd-simple-cargo-profit

Does your tool generate NPL NML btw?
Last edited by kayrice on 04 Jul 2017 17:24, edited 1 time in total.
Cadde
Transport Coordinator
Transport Coordinator
Posts: 290
Joined: 07 Oct 2004 12:51

Re: Playing around with FEAT_CARGOS profit callbacks in NML

Post by Cadde »

kayrice wrote:... Does your tool generate NPL btw?
I don't know what you mean by NPL?
If you meant NML then yes, it generates NML. I've uploaded a sample NML file here: https://github.com/TheCadde/OTTD-Cargo- ... 202012.nml

But looking at your NML in your repo, sure that would work. That is of course assuming Coal is defined as cargo id 0 which is almost always exclusively taken by passengers normally.
Allow me to explain it in some detail:

Code: Select all

item (FEAT_CARGOS, <item_identifier>, <cargo_id>) {
  graphics {
    profit: simple_profit_callback;
  }
}
<switch_identifier> - Can be anything you want it to be. It's used to refer to that specific cargo elsewhere for whatever reason.
<cargo_id> - This is the ID of the cargo in question. Since you aren't setting any properties for the cargo, your "simple_coal" is actually going to apply to passengers unless you have a GRF that redefines passengers elsewhere.

Your callback doesn't use any variables. You could replace the call to "simple_profit_callback" with "8192 / 250" as it currently stands and save some CPU time. Unless of course you meant to include other stuff later in the switch block.

But most importantly currently, are you sure you have supplied the correct cargo id's? Again, look here if you don't know the vanilla ones: https://newgrf-specs.tt-wiki.net/wiki/CargoDefaultProps
Because like i said, the cargo ID is unique across the whole game. Passengers are for compatibility reasons always 0 (0x00), Mail is 2 (0x02), Goods is 5 (0x05), steel is 9 (0x09) and valuables/gold is 10 (0x0A) etc etc. This is also true for Coal, Oil, Livestock, Grain (which is Cereals in ECS but essentially the same thing), Wood and Iron ore.

And while i won't deny you the pleasure of playing with fixed payments whatever the distance is, there's a problem in that it now makes a heck of a lot more sense to set up chains that are super short in distance. Basically a coal mine some 20 tiles away from a steel mill and use the cheapest of cheap means of transportation to make tonnes of money just the same as doing it diagonally across the whole map did before.

My method removes the benefits of transporting cargo excessive distances, while not making it entirely pointless to at least squeeze out a few extra pennies in the medium distances rather than just going short short distances.
It then removes the time factor because, like you said, i also feel that cargoes such as coal doesn't really care about how long it takes to travel. If there were more than 255 time units in the callback then i would have set a time limit. But as it currently stands, i don't see coal being such an express cargo that you have to deliver it in under a "day" minutes wise.
And ofc, most importantly of all, it makes perishable cargoes (living things) very time sensitive to emphasize the importance of giving way to express transport over snail transports. It's still possible to make profits on express cargoes even when they time out but one can make 16 times as much with an efficient transport network.
kayrice
Engineer
Engineer
Posts: 4
Joined: 04 Jul 2017 09:42

Re: Playing around with FEAT_CARGOS profit callbacks in NML

Post by kayrice »

Doesnt the cargotable remap the IDs?
Cadde
Transport Coordinator
Transport Coordinator
Posts: 290
Joined: 07 Oct 2004 12:51

Re: Playing around with FEAT_CARGOS profit callbacks in NML

Post by Cadde »

Indeed correct, i wasn't aware of this.
kayrice
Engineer
Engineer
Posts: 4
Joined: 04 Jul 2017 09:42

Re: Playing around with FEAT_CARGOS profit callbacks in NML

Post by kayrice »

And while i won't deny you the pleasure of playing with fixed payments whatever the distance is, there's a problem in that it now makes a heck of a lot more sense to set up chains that are super short in distance. Basically a coal mine some 20 tiles away from a steel mill and use the cheapest of cheap means of transportation to make tonnes of money just the same as doing it diagonally across the whole map did before.
Yeah it's an experiment for now. Your stuff is a lot better of a long-term idea.
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: Bing [Bot] and 64 guests