News:

Simutrans Chat Room
Where cool people of Simutrans can meet up.

Balance discussion: applying the concept of classes to goods transport

Started by jamespetts, December 10, 2017, 06:18:50 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jamespetts

Arising out of this discussion, I have been considering what to do about the fact that, in early times (e.g., the 18th century, especially before the proliferation of canals, when pack horse was the only (and very inefficient) way of transporting things), the transport of goods was much more expensive than it later became, and the fact that the consequence of this was that fewer goods were transported at higher prices, affecting the prosperity of particularly inland areas away from navigable rivers.

For passengers and mail, we now have a good system for dealing with this, being the passenger and mail classes system: an inefficient form of transport (e.g. stage coach or post boy) can be set to accept only passengers/mail willing to pay a high price for that transport, which then limits the number of passengers/mail that can be conveyed by that means, as the number of passengers/mail able to pay a higher price is limited.

This system would not make any sense for industry: there is no such thing as first class coal; farms do not generate varying proportions of grain, each of which can afford to travel in different classes of wagon. This is why it was implemented for only passengers and mail.

However, I wonder whether a related but different system might work for industry. Suppose that each unit of freight generated by an industry at the beginning of a chain (i.e., a primary industry such as a farm or fishery) were always assigned a class of zero. Players would be able to set different prices for goods transport in a similar way to how it is now done for passenger/mail transport (i.e., choosing from a small range of fixed categories). Setting the lowest price would equate, as with passengers and mail, to a class of zero. As goods were transported, the class datum would be set to reflect the highest price journey leg on the whole trip.

At a producing industry (a secondary industry, such as a windmill), the highest class/price of input goods would determine the starting class of the output goods. Again, the goods produced by the secondary industry would either remain at their starting level or increase depending on the highest price journey leg on their transport.

At consumer industries (such as shops), only passengers whose class equals or exceeds those of the goods being sold would be able to visit the shops and buy them. For consumer industries with multiple goods, the same mechanism would be used as is used now for passengers who arrive at an industry that has stocks of only some goods.

The consequence of this would be that players who set the prices to higher levels would be able to transport goods at a higher profit margin, but would ultimately have much lower demand, and would also reduce the demand for passenger transport at the ultimate destination. This may be necessary for forms of transport (such as pack horse) which would make a loss at lower profit margins, but would, if calibrated properly, be less profitable in the long-term for more efficient transport systems (such as canals), which would be able to transport higher quantities of things for lower prices. This should, in turn, allow early transportation of goods to be viable without making later transportation excessively profitable or relying on poor proxies for this effect such as applying a differential rate of inflation (when the inflation feature is implemented) for the revenue from different types of goods.

Some significant matters need yet to be worked out, however. Firstly, there is the question of routing: should goods continue to be routed by journey time, as now, or should they be routed instead to prioritise the lowest price? I suspect that the latter will be necessary, but this will require a lot of work to modify the path explorer. This may well also require a further new mechanic, giving certain sorts of goods (e.g. milk or fish) journey time tolerances, so that they will not take slower, cheaper routes where they would go off in the time that it would take to complete them. In turn, this journey time tolerance for goods mechanic would require careful thought as to how it would interact with industry chain creation/spacing.

Secondly, what should happen to industries such as power stations, gasworks and dairies which do not attract passenger consumers because they dissipate their products automatically through power lines, pipes or milkmen/women to the local population? For gasworks and dairies, one might imagine some proportionate reduction in demand (how to calibrate this is another question), but this is not achievable with power stations because of the way in which electricity distribution works. Perhaps power stations would only receive class zero coal?

Finally, there is the question of the priority of coding this feature compared with other features, especially those necessary to achieve the balancing of costs. Is this a priority over those, as the passenger and mail classes feature was, because it affects revenue and makes revenue difficult to balance without it; or is it better to code cost balancing features (and then actually balance the cost in the pakset) first in any event?

I should be grateful for considered feedback on this topic.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ves

Interesting thought!
For stuff like cooled good, it could be used to determine the "quality of temperature" of the vehicle. This would only work if bad refrigerated vehicles are limited to lower class of coolant. This would be especially much useful if cooled good and normal crates where to become only one cargo type: crates good. This means, both the today's cooled vehicles and "piece good" vehicles would become "piece good" vehicles, but where the player can turn on or of (maybe to some degrees in between?) the cooling of the vehicles.

Other uses I could see is the level of cleaning done in bulk and bulk fluid vehicles. A high class would indicate a good cleanup and the lowest class would be no cleanup. The motivation for the player would be "high class" = no spoiled cargo but high loading time, and "low class" = some spoiled cargo but lower loading time.

Last use I could see would be for the handling of the good. Low class good would just be throwed around resulting in some spoiled good if good is fragile, but higher class good, like glass, would need to be nicely packed and carefully transported. As with the bulk good, the down side would be higher loading time.

All this being said, I think it can well be too an ambiguous project, as well as the end result might feel artificial as well.

jamespetts

The idea of different qualities of accommodation and handling are interesting, but are likely exponentially to increase the complexity of implementing this. It is also likely to be very difficult to get accurate data on the significance of cooling - just how much longer can milk be transported in a modern refrigerated lorry than it could be transported in milk churns in an ordinary box wagon in a railway train? What of UHT milk (and at what stage does it become UHT milk)? Does refrigeration have more of an effect for fish and/or meat than milk? What about vegetables? What about frozen meat - would that be transportable with an indefinite time? As to stock losses, would the player just receive slightly less revenue based on the amount actually delivered, or would the player have to pay compensation? If so, that would have to be calibrated to the actual value of the stock lost, which would be a whole other set of research to do and pakset data to implement.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

DrSuperGood

The reason goods are not profitable to transport is because 1 vegetable farm only makes 1 unit every 4 or 5 months. Convoys sit idle most of the time.

Vladki

I like the idea proposed by james, that the class of cunsumers will determine the demand for goods that travelled in higher class vehicles. But I think it should not be a simple maximum, but a weighted average. A coal or wood that was carried by horses for a short trip from the mine/forest to the harbor, then a long cheap trip by boat, and then again short trip by horse pulled cart, should not be much more expensive than stuff carried only on boat.

I like the cooling quality idea to allow for longer trips. A cooling car would have a multiplier how much longer any goods will last in it, and goods would have a maximum that is feasible. eg. Meat could have an unlimited lifetime if refrigerated, but fruit could be only cooled to get only double lifetime. And no increase in lifetime for newspapers at all. But this feature could be added later together with increasing the default class for vehicles with better cooling.

Spoiling goods due to bad handling is probably too much. Just like we don't simulate disasters.

For power consumption. All city houses have a proportion of how many passengers of each class they produce. That will be used for determining how much are they willing to pay for electricity. The city transformer station will show this. And if it is connected to a power plant making only expensive electricity, it will require less power. If there are more sources in the network with different prices the cheapest ones will be used first.

Sent from my ONEPLUS A3003 using Tapatalk


DrSuperGood

I think looking into a better factory economic model would solve the problem. In real life transport companies charge whatever people are willing to pay. If you set up a very low efficiency route it might be too expensive for the supplier and consumer to use. If you set up a low efficiency route then the product might become too expensive for the consumer reducing rate of sales (demand per month). A high efficiency route would have the opposite effect encouraging demand.

Factory routes would be mostly weighted on price. A factory does not care if coal takes 3 years to arrive to it as long as it is extremely cheap to do so. For players competing with each other it would become all about shifting goods as cheaply from one place to another.

Goods which are meant to have a limited shelf time would be mechanically implemented by "spoilage" based on the travel time. These apply to the factory and effectively mean that some of the product is lost upon arrival based on the calculated travel time (not actual travel time, so that convoy getting stuck for a while will not have high spoilage when it arrives but it might raise average spoilage due to raised calculated travel time). Using the above economic model this has the result of making the value of 1 unit more expensive to obtain for the factory as more than 1 unit must be ordered for 1 unit to arrive. This is then used when checking route viability allowing it to trade off travel time against cost in a way that makes sense. For example a factory that process fresh milk might prefer to use a very expensive but fast route with 0 spoilage over a very cheap but slow route with >50% spoilage due to the cost of the underlying milk. Ultimately there would be a time at which there is 100% spoilage, in which case the route is determined unviable anyway according to the above logic hence also limiting the maximum range one can move such goods.

Another part of this would be a knock-on effect in the case of factory chains. For example one might deliver hardware from a factory to a hardware shop very economically however the hardware still sells very badly because the coal and iron ore being delivered to the factory costs a fortune so the hardware it produces is already very expensive.

jamespetts

Thank you both for your feedback: that is helpful. Firstly, as to the farms' production, as discussed in detail in this thread, the level of production in farms is entirely realistic (and remember, this is one tonne of vegetables every 25 hours rather than per month, as the industry production works on the short timescale). Given that it was clearly not uneconomic to transport products from farms in real life (or else farms would not have existed), it must be possible using a realistic simulation to cause farm transport not to be uneconomic.

Part of that, as discussed elsewhere, is having the roads to the farms built from the outset so that it is no longer necessary to pay for a road to the farm. Part of that is intelligent use of convoys by players to transport goods from multiple farms to market, using a single convoy to convey more than one pair of industries. Part of that is the lay-over feature for idle convoys discussed here; and part of that is the balancing of costs which is yet to be achieved.

However, when a player has to use a very low efficiency means of transporting goods from farms, such as pack-horses, it may well be necessary to increase the price charged - there must then be a mechanism to simulate the adverse consequences of charging a higher price, or else players would always charge the higher price. That is the aim behind the feature discussed here: the idea is to balance the cost of industrial transport in the early game, rather than to introduce any new game mechanics for their own sake. The latter sort of thing will have to wait until balance has been achieved at least for the most part.

Secondly, as to the suggested mechanics, Vladki's idea is interesting, although does anyone have any real data on the additional journey time tolerance for, e.g., fruit, meat, milk? Also, this may be very complex to implement; suppose that a single line had some convoys that were and were not refrigerated; how would it work in that case? Cooling seems to me to be an additional game mechanic that is not necessary to achieve balance but might be good to have one day (although could be implemented sooner if someone were willing to code it so that it worked reliably).

Thirdly, as to Dr. Supergood's suggestion of re-designing the path explorer entirely so that goods routes compete on price rather than journey time, and then adding proportionate spoilage by distance which affects the notional price - this would be perhaps three or four times more work to implement than my original suggestion because it would need fundamental changes to the path explorer to use prices (presumably, exactly set prices rather than broad price bands?) rather than times. My original proposal was carefully designed so as to change only minimally the workings of the path explorer, as with the passenger and mail classes: with the system that I proposed, the path explorer in its existing state could simply run X times for each type of goods (where X is the number of possible price bands), starting with the lowest price, and stop when it finds a route within the goods' journey time tolerance (if any).

Also, there are problems with taking journey time out of account for routing entirely. For example, in reality, railways quickly out competed canals for goods transport. It is unlikely that this was just on price, but rather because trains were much faster than canals, which would have been important for the type of goods (e.g. manufactured goods) for which canals were able to charge higher prices; it may well not have mattered for minerals, but canals would not be able to turn a profit just transporting low margin goods such as coal and ore. In reality, they sold themselves out to railway companies at an early stage. We need to be able to simulate accurately this aspect of competition between canals and railways so as to be able to deal realistically with the rise of railways in the 19th century.

In relation to the spoilage mechanic, I am not sure that this entirely works: a batch of perishable goods would all go off within a relatively short time of each other, not at a steady rate starting from some specified time after production. Also, for newspapers, for example, they would not go off as such - just all be less valuable to their end consumer if delivered late (although that lower value would not result in lower prices if there were no alternative, faster sources of news).

As to power, because of the way in which power consumption works (electricity goes into a grid, consumption is set by various consumer substations attached to industries and cities, the latter of which simply take an overall population figure), it would be extremely difficult (and require a major rewrite of much of the electricity code, which might then make that code a significant drain on performance), it is not practical to have a system in which the classes of consuming buildings would affect electricity consumption. There are also major conceptual problems: how would non-residential buildings be treated? What about circumstances in which cheap and expensive electricity are mixed on the same grid? If, in that latter case, there is a surplus of supply, would there have to be a mechanism to make sure that it would be fulfilled primarily by the cheaper supplier (and this feature by itself would be a huge amount of work)? Would industries being supplied with expensive electricity increase their prices? What if a coal mine feeding a power station were to increase its prices owing to the electricity being expensive - would this lead to positive feedback?

It must be borne in mind that implementing even a relatively straightforward feature such as the passenger and mail classes feature can take many, many months of coding, testing, fixing, adjusting, more testing and fixing and then the long tail of pakset work necessary to catch up with the new features (and even now, there is a huge queue of first class railway carriages waiting to be created). Some of the versions of what is being proposed here would be likely to take me over a year to implement successfully given my available spare time and the need to spend such of that as I can on Simutrans on fixing bugs as a priority over adding features. What I proposed was specifically designed to be as minimal as possible in terms of changes to difficult parts of the code, such as the path explorer, for this reason.

This calculus changes, of course, if someone else were to volunteer to work on coding the features in question. At present, however, such a feature is likely to have to stand to be considered after implementation of the mechanics necessary for cost balancing, when it will be able to be seen whether this is really necessary or not.

In the meantime, do people have any feedback on the idea as originally proposed, or do we have any volunteers to code the more advanced suggestions (in so far as they will not cause balance problems as discussed above or adversely affect performance)?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Jando

I have to admit that James' model sounds over-complex to me, sorry.

Let me re-phrase in my own words what the actual problem is: we have producers of agricultural goods that produce so few goods in so many odd locations that transporting the goods doesn't pay for the cost of the transportation infrastructure. That's actually not even a new problem introduced with version 13, it existed since quite some time, version 13 just made it worse and better visible. It's also not limited to producers but extends to end-consumers as well because supplying some end-consumers (example bakery or greengrocer) doesn't pay for the infrastructure costs too because demand of the consumer is so low.

Thus we can generalize the problem: low-volume transportation doesn't pay because the monthly cost of infrastructure (roads, tracks, stations, loading bays, stables, etc.) is higher than the monthly revenue a player can get from establishing low-volume transportation routes. Now, obviously there are two possible strategies to solve this problem (or a combination of the two):

  • Reduce cost of infrastructure
  • Increase revenue by either increasing volume or increasing revenue per cargo
Both strategies have drawbacks: reducing cost of infrastructure would also make infrastructure for high-volume transport cheaper, what we don't want, and increasing revenue or volume would throw off the balance of producers that James carefully researched to fit real life numbers.

As usual real life provides a solution however too: In real life (and certainly in early years) there would have been no transportation companies to bring grain from a farm in the countryside to a windmill - instead the farmer would bring his grain to the mill or market or canal dock in the next town or village. Same for most other low-volume transports and the cost for transportation would have been factored into the price the farmer would get for his grain. Thus the real problem we encounter is that we try to simulate a transportation pattern that didn't exist in real life.

What I would do in terms of Simutrans-Extended is to just give every village/town a market where the combined supplies of all farms around that village would magically show up as supplies that the player's transportation company can pick-up for transport to consumers and to other towns. In this case consumers would not demand their grain from a little grain farm in the countryside but from a market in the village instead. Bonus points if farms would be created around smaller villages during map creation so that the player can transport agricultural goods from markets in the country to consumers in the larger towns.

Okay, I know this is quite a long shot. :)

jamespetts

Thank you for your feedback. Unfortunately, what you suggest is actually considerably more complex from an implementation perspective at least than the original suggestion (which I designed very carefully to require the minimum amount of coding). This suggestion amounts in essence to a simulation of private goods transport, in a similar way to that in which passenger transport by private car is simulated (but more sophisticated, in that it would require the ability for a journey to be made partly by private goods transport and partly by player transport). I have long considered whether to implement a "private vans" feature, and, if so, how this would work, and it remains a possibility one day, but this is currently a long way off, as there are a huge range of things about how this would interact with existing game mechanics that would need to be considered. Even from a player's perspective, if properly implemented, it is hard to see how a private vans feature would be any less complex ultimately than a system for pricing goods transport.

If the only problem with the balance is that the maintenance cost of the ways exceeds the profit that can be earned by running loaded vehicles on them, then reducing the maintenance cost of the ways is indeed likely to be the answer. We already have a mechanism for making the maintenance cost of ways effectively scale with the intensity of the usage of ways, which is that ways wear out in proportion to the usage of them by vehicles (and also, albeit much more slowly, with the passage of time) and eventually need renewing at a capital cost equivalent to upgrading the way (which cost is now less than the cost of building a new way because of the forge cost mechanic). This issue should be mitigated further by the planned feature to have industries connected by road at map generation in the same way as towns are so connected, although that would still mean bridleways in 1750, which could only take pack horses and post boys unless upgraded (although, as discussed, the upgrade would be less expensive than building the road anew).

The issue, however, that the suggestion in this thread was designed to deal with was not so much that of the infrastructure cost of ways, but rather the high cost to capacity ratio of early convoys, especially pack horses. Each pack horse can only carry a fraction of what a horse pulling a wagon or barge can carry (per horse), and the costs of keeping horses are relatively high. Even if the infrastructure cost nothing to the player (as may well be the case when the feature for connecting industries is implemented, and assuming that players do not upgrade the bridleways), the actual profit of transporting goods by pack horse, once the costs have been calibrated to a realistic level, may exceed the profit, especially for inherently low value items, such as coal. This is where applying a class based price mechanic such as described in the original post might well enable the player to make a (limited) profit by carrying bulk goods using very inefficient means of transport, but be easily able to be out-competed by more cost efficient means of transport when they become available. It would also have the secondary effect of inhibiting the growth of towns connected only by cost-inefficient goods transport, which is also a worthwhile thing to simulate in and of itself.

However, all of this does suggest that it is better to leave a final consideration of whether to implement this or something like it until after the main run of costs balancing has been completed so that we can see whether realistically costed pack horses on realistically costed roads automatically connected to industries really do turn a loss with current goods prices (which are based on 19th century railway prices).

Incidentally, I realise that I omitted to reply to one of Ves's suggestions above regarding combining the various different prices of travel. Whilst I can see why this was suggested, this would have two principal problems: firstly, it would be unclear what to do in cases where the combined value were not an integer, although one could solve that simply by rounding up or down (although doing so would then remove much of the benefit of such a system). Secondly, and more significantly, this would require much more heavyweight memory structures (and a consequent considerable increase in memory bandwidth usage, possibly), as it would be necessary to store, not just a single 8-bit integer representing the price for each packet of goods, but rather a large number of values representing the distance and price of each leg of the journey. This would considerably increase the complexity of implementation as well as the performance impact of this feature.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Jando

Thanks for your answer, James!

Yeah, I understand the argument of complexity although players can almost do it on their own. I had tried that concept some time ago (pre 13.0) by creating another company (Farmer's Guild) that was responsible for bringing raw materials from farms to town to the main company's stops. Main company would pickup there and deliver to other towns and customers. Worked well for a time, of course the Farmer's Guild was soon broke and that was when the experiment ended, hehe. And of course that won't be a solution for server games I assume.

Road maintenance is sadly not the main point with these low-volume routes, it's stables, loading bays and building the road in the first place. Road maintenance is a minor point. As I wrote a few months ago in this thread: https://forum.simutrans.com/index.php?topic=17262.0

"And - the third reason - even with more smaller consumers it would need another step to create better balanced industry chains, and that is that esp. the smaller producers (farms, orchards, sheep farms, etc.) would need to be closer to towns than they are now. Building a road out to an orchard for example is in many cases a money-losing project because the smaller producers may supply enough freight for 4 or 5 truckloads per Simutrans-month, but the profit made from transporting that cargo won't pay the building costs for the road in any reasonable time frame."

As to revenue vs. running costs (pack horses) I see no pressing need to change any game mechanics for the time being, I reckon these can be balanced along the way.

jamespetts

As stated above, the capital cost of building roads should be able to be dealt with by the planned mechanic of automatically connecting industries by road on map or industry generation. Upgrading a bridleway to an unsurfaced road will probably not be particularly expensive, although I will need to research this. It should in principle be possible to have inexpensive loading bays with a low capacity for such situations as these. As to stables, a single stable should be able to deal with a whole town's worth of industry and passenger transport.

Whether these will be sufficient, or whether it is necessary to implement what I described in the first post, remains to be seen once balancing has progressed further.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

zook2

I typed up a long-winded post about cargo transport and pricing, but I guess it requires a little more thought.

One tidbit I just noted in my game, though, is that with many outlying farms and other industries, the cost of connecting them to the world is not only the cost of horse wagons, trucks, roads, bridges, stables, depots and stops, but you also need to supply them with workers. Possibly at a loss, too, but otherwise industries too far from towns for people to walk to won't produce anything.