Latest Posts

Topic: Production Time

WorldSavior
Avatar
Joined: 2016-10-15, 03:10
Posts: 2094
OS: Linux
Version: Recent tournament version
Ranking
One Elder of Players
Location: Germany
Posted at: 2018-08-06, 18:13

stonerl wrote:

Sorry I was wrong about the 1 Unit construction site:

Shipyard_1unit.png

It is indeed possible to force a 1 unit or 2 unit construction site. But on its own the shipwright would never do this if there wouldn't be any roads.

Interesting...

No, the distance is 5 units.

Sorry to be pedantic, but the distance for the upper shipyard is 3. Have a look at the map without buildings:

water_test.png

The distance between 2 flags is 1 unit isn't it?

No, the distance between 2 flags is always at least 2 units...

The black line I drew was the way the shipwright was walking.

But this is in this direction equivalent to distance, isn't it?

He walks from the 2nd left flag to the 5th left one. I can give you the map if you want to test it yourself.

I'm still convinced that I understand most parts of the geometry of Widelands face-wink.png


Wanted to save the world, then I got widetracked

Top Quote
stonerl
Avatar
Topic Opener
Joined: 2018-07-29, 23:03
Posts: 327
Ranking
Tribe Member
Posted at: 2018-08-06, 18:53

No, the distance between 2 flags is always at least 2 units...

Sorry, I meant the yellow flags. When nothing is build. Not the one on the roads.

I'm still convinced that I understand most parts of the geometry of Widelands

I don't question this at all.

But I stopped the time with a stopwatch, many times. The worker from the north shipyard took 5.4 seconds to walk from the flag to the construction side. In contrast the one on from the west shipyard took 9 seconds. Please have a look at this video:

shipyard.mp4

The the worker from the west has a lead of almost 14 seconds. After the second build-phase they are equal.

The first starts at 58 seconds and the second at 2:29minutes. (I had to crop the video, since a notification popped in...)


Top Quote
stonerl
Avatar
Topic Opener
Joined: 2018-07-29, 23:03
Posts: 327
Ranking
Tribe Member
Posted at: 2018-08-06, 21:35

I'm sorry if I annoy anybody, but I had to make some drawings to understand the problem. Since I'm not a programmer myself I cannot look in the code and spot every detail but I think I understand how and why this works currently.

As far as I understand it, tiles consist of an hexagon with a seventh knot in the middle:

Tiles.jpg

The distance from evry knot to its neighbor is 1 vector. The problem is how roads work. Although the distance from A to E is 1, it can only be reached using the auxiliary knot G (or F). So that distance increases from one to two. On the horizontal axes every neighbor can be reached within 1 vector. But on the vertical axis two are needed.

Tiles2.jpg

Back to the problem with the shipyard. The shipyard's flag is knot B. Since the minimum distance under normal circumstances is 3 knots, the closest knot for the construction site would be O. Since roads cannot be constructed between neighbors in the vertical axes, and the workers can only walk on paths that can be converted into roads, the worker has to use the auxiliary knots C and J.

Knot O is indeed a 3-way-hop and the closest distance. But not the shortest to reach by roads. This would be J.

Is this correct?

Edited: 2018-08-08, 23:41

Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 22:16
Posts: 2648
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2018-08-06, 22:08

from a coordinate point of view (x, y) the distance between A and E is 2 cause their y value differs by two. to get an impression about the coordinate system simply open the map editor and see the x,y readout while the cursor moves.


Top Quote
stonerl
Avatar
Topic Opener
Joined: 2018-07-29, 23:03
Posts: 327
Ranking
Tribe Member
Posted at: 2018-08-06, 22:49

@hessenfarmer: thank you for the clarification.

@WorldSavior: I beg you pardon for the misunderstanding.


Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 19:48
Posts: 2439
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2018-08-07, 07:58

stonerl, you may take a look at these pages:


Fight simulator for Widelands:
https://wide-fighter.netlify.app/

Top Quote
WorldSavior
Avatar
Joined: 2016-10-15, 03:10
Posts: 2094
OS: Linux
Version: Recent tournament version
Ranking
One Elder of Players
Location: Germany
Posted at: 2018-08-08, 12:39

stonerl wrote:

No, the distance between 2 flags is always at least 2 units...

Sorry, I meant the yellow flags. When nothing is build. Not the one on the roads.

No need to be sorry. The distance between two yellow flags on the north-south-axis is at least 2, it cannot be 1.

I'm still convinced that I understand most parts of the geometry of Widelands

I don't question this at all.

I didn't want to say that you question it, I just wanted to express that I'm rather sure about the issue.

But I stopped the time with a stopwatch, many times. The worker from the north shipyard took 5.4 seconds to walk from the flag to the construction side. In contrast the one on from the west shipyard took 9 seconds. Please have a look at this video:

shipyard.mp4

The the worker from the west has a lead of almost 14 seconds. After the second build-phase they are equal.

The first starts at 58 seconds and the second at 2:29minutes. (I had to crop the video, since a notification popped in...)

In the video, there are two different distances: 3 and 5.

stonerl wrote:

I'm sorry if I annoy anybody, but I had to make some drawings to understand the problem. Since I'm not a programmer myself I cannot look in the code and spot every detail but I think I understand how and why this works currently.

As far as I understand it, tiles consist of an hexagon with a seventh knot in the middle:

Tiles.jpg

The distance from evry knot to its neighbor is 1 vector. The problem is how roads work. Although the distance from A to B is 1, it can only be reached using the auxiliary knot G (or F).

No? A road can go from A directly to B. You mean E instead of B.

So that distance increases from one to two. On the horizontal axes every neighbor can be reached within 1 vector. But on the vertical axis two are needed.

Tiles2.jpg

Back to the problem with the shipyard. The shipyard's flag is knot B. Since the minimum distance under normal circumstances is 3 knots, the closest knot for the construction site would be O.

No, J.

Since roads cannot be constructed between neighbors in the vertical axes, and the workers can only walk on paths that can be converted into roads, the worker has to use the auxiliary knots C and J.

Knot O is indeed a 3-way-hop and the closest distance. But not the shortest to reach by roads. This would be J.

Is this correct?

Not completely. distance(B,O) is not 3, but 5.

Maybe this helps you: A sentry has a conquer radius of 6. It conquers every field within a radius of 6.

Edited: 2018-08-08, 12:40

Wanted to save the world, then I got widetracked

Top Quote
stonerl
Avatar
Topic Opener
Joined: 2018-07-29, 23:03
Posts: 327
Ranking
Tribe Member
Posted at: 2018-08-08, 16:11

@WorldSavior and @kaputtnik thanks allot for the link and the explanation. Now that I read the article about map geometry and your explanation I know where I made the wrong assumption. Thanks allot for your patience.

Concerning the shipyard. Is this the intended behavior or a bug. One can force the shipwright to be build the ship in an 1 unit distance. On its own he builds the ship 3 units away when on the horizontal, but 5 when on the vertical axes. Which results in the following build times:

1 Unit: 20 minutes 43 seconds

3 Units: 22 minutes 39 seconds

5 Units: 24 minutes 34 seconds

Which I think is not insignificant.

Edited: 2018-08-08, 16:24

Top Quote
einstein13
Avatar
Joined: 2013-07-28, 23:01
Posts: 1118
Ranking
One Elder of Players
Location: Poland
Posted at: 2018-08-08, 17:16

@stonerl we all had to get this hex-shaped map know first. It is much better when you calculate distances, because all of them are integer numbers. But this system is not trivial one and contains some tricks face-smile.png . Fortunately it can be transformed to square one with special conditions. And transformation contains pure math function, so you don't need to be IT specialist face-smile.png . But going to be human-friendly, what you posted above is enough to catch the point of hex/triangle map.


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, 03:10
Posts: 2094
OS: Linux
Version: Recent tournament version
Ranking
One Elder of Players
Location: Germany
Posted at: 2018-08-08, 21:06

stonerl wrote:

@WorldSavior and @kaputtnik thanks allot for the link and the explanation. Now that I read the article about map geometry and your explanation I know where I made the wrong assumption. Thanks allot for your patience.

You're welcome

Concerning the shipyard. Is this the intended behavior or a bug. One can force the shipwright to be build the ship in an 1 unit distance. On its own he builds the ship 3 units away when on the horizontal, but 5 when on the vertical axes. Which results in the following build times:

1 Unit: 20 minutes 43 seconds

3 Units: 22 minutes 39 seconds

5 Units: 24 minutes 34 seconds

Which I think is not insignificant.

I think it's a bug if a shipyard always chooses high distances. I would even say that the shipyard should always pick the spot which is the closest. The disadvantage would be that a single shipyard wouldn't produce several fleets at several different waters without micromanaging - but this is an unimportant corner case and one could still place the shipyard exactly between the waters, so there would be a random choice. (Or one just builds several shipyards)


Wanted to save the world, then I got widetracked

Top Quote