Latest Posts

Topic: Set priorities for ports

ypopezios
Avatar
Topic Opener
Joined: 2018-04-20, 00:22
Posts: 220
Ranking
Widelands-Forum-Junkie
Posted at: 2018-08-05, 10:25

I had that idea while reworking ship-scheduling. If we want to give players some control, a quick addition could be to add to each port a priority GUI-element (like the one we have for wares). The three colors would get simply interpreted like this:

  • Green: Ships will consider this port as being at half the distance it really is (thus prefer serving it more often).
  • Yellow (default option): Ships will consider this port as being at the normal (real) distance.
  • Red: Ships will consider this port as being at double the distance it really is (thus prefer serving it less often).

Top Quote
einstein13
Avatar
Joined: 2013-07-29, 00:01
Posts: 1118
Ranking
One Elder of Players
Location: Poland
Posted at: 2018-08-05, 10:36

I don't think that it is the best idea. Just because it can cause that some wares will go to some ports with very big timing.

Also value of 2 is quite big. It is 100% change.


einstein13
calculations & maps packages: http://wuatek.no-ip.org/~rak/widelands/
backup website files: http://kartezjusz.ddns.net/upload/widelands/

Top Quote
Tibor

Joined: 2009-03-23, 23:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2018-08-05, 17:22

We I would not oppose it, because there would be no change in behavior if player does not play with new settings.

Also I would not express it that way - would not mention modified distance - this might be confusing for users.


Top Quote
einstein13
Avatar
Joined: 2013-07-29, 00:01
Posts: 1118
Ranking
One Elder of Players
Location: Poland
Posted at: 2018-08-05, 17:38

Good point. Maybe I am too conservative to changes? face-wink.png


einstein13
calculations & maps packages: http://wuatek.no-ip.org/~rak/widelands/
backup website files: http://kartezjusz.ddns.net/upload/widelands/

Top Quote
WorldSavior
Avatar
Joined: 2016-10-15, 04:10
Posts: 2091
OS: Linux
Version: Recent tournament version
Ranking
One Elder of Players
Location: Germany
Posted at: 2018-08-05, 18:34

einstein13 wrote:

Good point. Maybe I am too conservative to changes? face-wink.png

Depends on the change. You want ferries, while I see no point in developing them face-wink.png

The idea of ypopezios sounds fine

Edited: 2018-08-05, 18:35

Wanted to save the world, then I got widetracked

Top Quote
ypopezios
Avatar
Topic Opener
Joined: 2018-04-20, 00:22
Posts: 220
Ranking
Widelands-Forum-Junkie
Posted at: 2018-08-06, 11:14

Since not everyone understands the usefulness of such a feature, I'm going to give an example.

Imagine a port (P1) connected to production buildings (farms, wells, etc.) Then imagine two ports (P2 and P3) connected to separate economies of consumption buildings (e.g. animal farms). Therefore, both economies of P2 and P3 generate demand for the wares produced by the economy of P1, so P1 starts accumulating wares heading to the other two ports. Ships arriving to P1 will get loaded with wares both for P2 and for P3. Those ships will have to decide at which port to unload first. Let's say that the distance between P1 and P2 is 8, while the distance between P1 and P3 is 28. Ships will finally serve all three ports. But if every other factor is equal, ships will decide to give priority in serving P2, because it is closer to them, thus achieving optimal value to the average serving time. In most cases, this is the desirable behaviour.

Now imagine that P3 is connected to a more important economy than P2, so a player would like P3 to get served by priority over P2. With the proposed feature, the player could set P3's priority to green color, thus halving its effective distance from 28 down to 14. That would still be greater than 8, so the player would also have to set P2's priority to red color. If that was to give an increase of only 50%, it would be a change from 8 to 12, which would still be less than 14. While an increase of 100% would raise the change up to 16, which is greater than 14, thus succeeding in changing the priority between P2 and P3.

As Tibor said, this is not a change, but an enhancement for advanced players. If someone takes care of coding the GUI element, the change to ship-scheduling code is very simple.


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2018-08-06, 11:52

I think we should do that in a follow-up branch, to make the code review easier


Busy indexing nil values

Top Quote
einstein13
Avatar
Joined: 2013-07-29, 00:01
Posts: 1118
Ranking
One Elder of Players
Location: Poland
Posted at: 2018-08-06, 15:52

I see that this change would influence the routing, but what about ware prioritizing? As I remember, you set wares to any buildings with priority. Maybe better is to change the algorithm that it will take care about the wares that has higher priority? It should do the same job.

Another thing is a factor. From my point of view it is very high value. I will explain that in an examples:

1. Your idea of distances

  • A-B: 8
  • A-C: 24
  • B-C: value between 16...32, let's say 20

With "standard" version of ship transportation you will receive wares in two time cases:

  • A-B-C
    • B: 8 (+0% - fastest possible)
    • C: 28 (+16%)
  • A-C-B
  • B: 48 (+500%)
  • C: 24 (+0% - fastest possible)

The "manual" version will cause 500% lag for port B. Not important? Depends on economy and personal feelings.

2. Perfect triangle

  • A-B: 100
  • A-C: 100
  • B-C: 100

And timings are quite simple:

  • A-B-C:
    • B: 100 (+0% - fastest possible)
    • C: 200 (+100%)
  • A-C-B:
    • B: 200 (+100%)
    • C: 100 (+0% - fastest possible)

3.Border line case

If you are thinking about ports lying on line with distances A-B=A-C: 1, B-C: 2 the percentages will change to 0 or 200%.

Conclusion

If the port B is close to A and far away from C, it is almost always good to move to the port B first. Going first to port C has not much difference, while port (& economy) B is suffering much.

From my perspective, ships movements from Build 17 and 18 moved to Build 19 had significant technology increase (thanks @Tibor !), and even it is not perfect in all cases, it allows to move wares in some kind of "smart" way.

I would rather see (maybe it is already done?) that wares with "high priority" will change ship routing instead adding "port prioritizing" as a whole engine. Also smart wares routing should also help much. Let's automate! face-smile.png

*


einstein13
calculations & maps packages: http://wuatek.no-ip.org/~rak/widelands/
backup website files: http://kartezjusz.ddns.net/upload/widelands/

Top Quote
ypopezios
Avatar
Topic Opener
Joined: 2018-04-20, 00:22
Posts: 220
Ranking
Widelands-Forum-Junkie
Posted at: 2018-08-06, 17:41

@einstein13

Good effort. But since you changed the problem's definition to add the needed time for the low-priority port, you should also add the needed time for the ship returning back to the first port for a second load etc. If you do that, you'll find out that the order of delivery doesn't matter, cause the total time between two consecutive deliveries to the same port is constant and any time-penalty applies only to the first delivery, not getting multiplied with later deliveries. Therefore, if you expect to have long-term gains by the order of delivery, you'll get disappointed, cause the supposed suffering of the involved economies simply doesn't exist.

For a player to bother increasing the priority of a port, that port has to be important. If you cannot see how a port can be strategically more important than individual wares, feel free to ignore port-priority. As about existing ware-priority, it applies only at the flag-level, so it is irrelevant to port-priority. Someone could rework the whole system to make ware delivery really smart, but currently we are far from there. Moreover, incorrect logic cannot be helped by smart maths.

You tested Tibor's implementation in practice and you found it superior to previous implementations. Would you bother testing my implementation too, before reaching conclusions?


Top Quote