Latest Posts

Topic: Solution proposals for maritime shipping problems

Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 1929
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2020-02-01, 13:42

Solstice_s_Return wrote:

Couldn't there also be a change in the algorithm that doesn't order the ship to get a ware but instead just orders an amount of ships according to the number of goods required to transport. So then it does not allocate them to any ship but just orders enough ships to handle the demand. Then when the first ship arrives it takes as much wares as available for the demand and continues to the destination port. When the next ship arrives, it again takes as much wares as possible at that given moment. If there's still wares left over for the demand when the allocated amount of ships are all on their route to the destination, the algorithm orders as many additional ships as necessary to fill the demand. The difference to the current system is that there's no direct ware orders while the ships are on the sea but just an amount of goods that sets the demand of ships. Then the algorithm orders, for example, one ship per 10 units of cargo. That unit amount might have to be dependent of the sea route length to be the most effective.

Congratulations, you are describing almost exactly how the algorithm works face-wink.png

A port says, I need X ships (based on the number of waiting items). The fleet sends ships when available. The fleet bases this decision on number of waiting items in this port, number of waiting items in all ports, distance to ships, and how many items and destinations a ship currently has.

When a ship arrives at a port, it takes wares heading for ports it´s already heading to, and additional wares as well if their destinations are not too far away (or if it doesn´t have more destinations yet). (If another ship is heading to the port that could transport a ware much faster due to less detours, the ware is left at the port for the next ship)

Edited: 2020-02-01, 13:44

Top Quote
Tibor

Joined: 2009-03-23, 23:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2020-02-01, 13:45

Solstice_s_Return wrote: This has to be so that the first destination warehouse is the final destination as long as the destination is warehouse. When demanded, the ware can be reallocated to a different warehouse. Otherwise it may lead to wandering wares which overload road system.

I think the current logic is that a new ware (e.g. just produced) looks for a warehouse. The warehouses are passive here, they do not ask for a ware from another warehouses. Or from elsewhere....


Top Quote
Solstice_s_Return
Avatar
Topic Opener
Joined: 2020-01-28, 13:24
Posts: 62
Ranking
Likes to be here
Location: Finland
Posted at: 2020-02-01, 13:52

Nordfriese wrote:

Solstice_s_Return wrote:

Couldn't there also be a change in the algorithm that doesn't order the ship to get a ware but instead just orders an amount of ships according to the number of goods required to transport. So then it does not allocate them to any ship but just orders enough ships to handle the demand. Then when the first ship arrives it takes as much wares as available for the demand and continues to the destination port. When the next ship arrives, it again takes as much wares as possible at that given moment. If there's still wares left over for the demand when the allocated amount of ships are all on their route to the destination, the algorithm orders as many additional ships as necessary to fill the demand. The difference to the current system is that there's no direct ware orders while the ships are on the sea but just an amount of goods that sets the demand of ships. Then the algorithm orders, for example, one ship per 10 units of cargo. That unit amount might have to be dependent of the sea route length to be the most effective.

Congratulations, you are describing almost exactly how the algorithm works face-wink.png

A port says, I need X ships (based on the number of waiting items). The fleet sends ships when available. The fleet bases this decision on number of waiting items in this port, number of waiting items in all ports, distance to ships, and how many items and destinations a ship currently has.

When a ship arrives at a port, it takes wares heading for ports it´s already heading to, and additional wares as well if their destinations are not too far away (or if it doesn´t have more destinations yet). (If another ship is heading to the port that could transport a ware much faster due to less detours, the ware is left at the port for the next ship)

Is it that way already in b19? If not, then I must learn compiling now.


Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 2646
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2020-02-01, 13:59

Solstice_s_Return wrote:

hessenfarmer wrote:

Hm,
I still believe shipping isn't the reason behind this it just makes some flaws more obvious than road transportation.
I still think the root cause is in the ware allocation algorithm, and this can't be fixed in shipping.
For me the idea of simplypeachy is at leat discussable.
If we change the don't stock, prefer, normal and remove buttons with the same buttons as for the economy targets we have more control without losing any capability. In the beginning we should have the economy target as given in the lua of each ware. with each warehouse we should increase this by a defined value. the sum of the targets gets evenly distributed to all warehouses. If we increase the target in one warehouse the target is decreased in all others leading to transportation immediatley stated without having to press a remove button risking a major congestion. If the increased demand is overseas we would much likely having a ship transporting a large amount of the ware at once rather shipping one single piece of log while other transport has to wait. Furthermore the foreign colony gets baked up permanently with a higher stock. So I think this would indeed solve a lot of problems and gives more control to the player.

I think this is a good sum up of the most useful ideas here. I would add the home port idea to these through as then those ships would more likely be available quickly - maybe even too quickly which warrants using some short delay for loading wares to a ship.

I don't think this to be useful as you need to predict constantly where the most demand will be and how routes evolve. This would lead to a lot of micromanagement in my eyes.


Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 1929
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2020-02-01, 14:00

I think the current logic is that a new ware (e.g. just produced) looks for a warehouse. The warehouses are passive here, they do not ask for a ware from another warehouses. Or from elsewhere....

Warehouses can issue requests to get the tools they need to produce workers. If a worker is needed, the Economy decides which warehouse should request the required wares. Apart from that, wares are distributed only by the Economy.

Is it that way already in b19? If not, then I must learn compiling now.

I´m not sure, the agorithm was actually reworked twice since then. I´m only familiar with the changes introduced by the second rework because that´s the one I did myself face-wink.png


Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 2646
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2020-02-01, 14:01

JanO wrote:

I like it, too. But I would do it the other way round: Set absolute numbers for each warehouse which can be globally increased or decreased with the economy target window.

global increase should still be possible yes. however the individual targets need to be adjustable to achieve the desired effect of routing a dedicated type of wares do a dedicated place.


Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 2646
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2020-02-01, 14:03

Tibor wrote:

So these per ware per warehouse targets will work like upper limit - they would not allow another ware and force provider to look for another warehouse to send the ware to.

But is is still possible that count of existing wares will exceed the sum of all targets and thus the engine will be forced to pick one of the warehouses.

they will work like the current economy setting already does. they generate demand for wares, so buildings keep producing. if there are more wares they get distributed like it is currently so no big change else then the wares are distributed differently until limits are reached.


Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 1929
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2020-02-01, 14:07

So those limits would work like this:

  • When a newly produced brick is intended to be stored at a warehouse:

  • If there are warehouses with less bricks than their individual target, send the brick to the closest of those

  • Otherwise, send the brick to the closest warehouse

Did I understand correctly?

This would have the side effect that if there is 1 warehouse with less bricks than its target, a brick might be brought from the other end of the map just to be stored there.


Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 2646
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2020-02-01, 14:18

Nordfriese wrote:

So those limits would work like this:

  • When a newly produced brick is intended to be stored at a warehouse:

  • If there are warehouses with less bricks than their individual target, send the brick to the closest of those

  • Otherwise, send the brick to the closest warehouse

Did I understand correctly?

Almost. I would prefer to have the brick being brought to the warehouse with the biggest difference of target and amount. And productionsites and constructionsites would have precedence over warehouses of course.

This would have the side effect that if there is 1 warehouse with less bricks than its target, a brick might be brought from the other end of the map just to be stored there.

I believe that is exactly what is intended by this change because all other warehouses would have enough of them stored.


Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 1929
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2020-02-01, 14:22

This would have the side effect that if there is 1 warehouse with less bricks than its target, a brick might be brought from the other end of the map just to be stored there.

I believe that is exactly what is intended by this change because all other warehouses would have enough of them stored.

IMHO this rather speaks against this suggestion, because then it might clog up the road network. So how about instead:

  • Newly produced wares are brought to a close by warehouse

  • Warehouses with more wares than their target frequently send wares to understocked warehouses (preferreably close-by destinations) whenever there is low traffic on the route between them so it won´t affect the economy too much.


Top Quote