Latest Posts

Topic: Ferries

Nordfriese
Avatar
Topic Opener
Joined: 2017-01-17, 17:07
Posts: 1950
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2018-08-01, 20:04

There is no situation in the game currently equal to two road networks with waterway-only connection. The trouble is, economies are currently handling target settings and routing for wares and workers. So permitting this state would necessarily cause massive problems in-game, either with workers being assigned to buildings but never arriving or ware target settings getting messed up. That´s why it is necessary in my opinion to prohibit waterways between otherwise separate economies (two-unit roads on tiny islands are also a separate economy, and a single flag with only waterways and no roads also is!), and this must apply both to new and existing waterways. As I said already – there´s so much code that assumes economies to be well-defined, I can´t rewrite it all…

Development status report: The good news is, ferries now assign themselves to waterways. The bad news is, they cause an assert fail when doing so. I currently can´t compile debug builds, so I´m now waiting for the appveyor builds to see if the latest change fixes this.


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

Currently there can be many situations where you want to have separate economies connected only by waterways. I can imagine about 4 of them:

  1. Your empire was conquered and you want to join by waterways part of the economy that has no warehouse and exit all precious wares from buildings.
  2. You want to create a bypass (because of traffic jam) on the shore with small islands. You use a single flag on a small island to split too long waterway or make a waterway longer.
  3. You want to create a shortcut between two shores that are already settled, but the normal (land) or sea (ships) way are inefficient. Then you create a waterway that makes the job.
  4. You have on the shore several foresters (see The Nile maps) and you want to have some woodcutters nearby. Creating a land route will decrease place for trees, but using waterways will make it much more efficient. So you remove all land roads to the woodcutters and join them by waterways.

In all cases you have working economy on both sides or the "other economy" is a single flag without any building.

About 4.: it is possible to connect all woodcutters by land roads and wait till the building will be working. Then you connect the woodcutters by waterways (and necessary roads) and remove land roads. Finally you have several economies connected by waterways. Will you prevent that somehow?

Please let me show all the cases on example from Settlers II game (there were working waterways). But I need some time. Maybe today evening I will have some.

@Tibor: the point 1. is exactly what I meant. And as I remember, new economy is still running with no problem, except the fact that final wares are going nowhere. With existing waterways they can be transported to the warehouses and/or other buildings from the first economy.

Edited: 2018-08-02, 08:59

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

Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 14:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2018-08-02, 10:27

The way economies are currently implemented, no ware or worker is transported from economy a to economy b, ever. Ship expeditions are their own economy, and as soon as the port is built, the new islands forms a single economy with the original economy and the ship.


Busy indexing nil values

Top Quote
Tibor

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

if ferries were able to transport workers, the problem would not exists...


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

GunChleoc wrote:

The way economies are currently implemented, no ware or worker is transported from economy a to economy b, ever. Ship expeditions are their own economy, and as soon as the port is built, the new islands forms a single economy with the original economy and the ship.

Oh... I see the problem now. You don't want to touch the economy, because it is rather stable situation and major part of the code. So my question is: what is happening when the territory is split by the enemy or you destroy too much flags & roads?

Edited: 2018-08-02, 12:07

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, 22:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2018-08-02, 12:22

einstein13 wrote:

GunChleoc wrote:

The way economies are currently implemented, no ware or worker is transported from economy a to economy b, ever. Ship expeditions are their own economy, and as soon as the port is built, the new islands forms a single economy with the original economy and the ship.

Oh... I see the problem now. You don't want to touch the economy, because it is rather stable situation and major part of the code. So my question is: what is happening when the territory is split by the enemy or you destroy too much flags & roads?

They become two distinct economies.

I ferry was able to transport workers, both separate road networks could still form one functional economy - as long as connection with ferries exists.


Top Quote
Ex-Member
Avatar
Joined: 2014-09-12, 09:53
Posts: 184
Ranking
Widelands-Forum-Junkie
Posted at: 2018-08-02, 16:53

Ferries transporting workers and wares is a basic necessity. So is being able to expand from one shore to a nearby one without the time and expense of ports and expeditions, if expeditions had a few extra wares and a soldier to protect the port while proper dence was built then that would be perfect.


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

My examples of points above:

1. Enemy conquered your territory, but you can access that by water.

https://image.ibb.co/cCZnae/01.png
Red line is hypothetical border line. The situation may be much more complicated, but it is my point shown here.

2. Bypass

https://image.ibb.co/inf4MK/03.png
Here is no traffic jam, but I guess that you got the point.

3. Shortcut between two islands

https://image.ibb.co/fRE9oz/02.png
Ships (here) aren't efficient enough. On The Nile map you can imagine that shortcut can exist because of long land way.

4. Woodcutter/forester efficiency

https://image.ibb.co/bV7Uoz/04.png
Making road through the foresters will decrease efficiency.


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

Top Quote
Nordfriese
Avatar
Topic Opener
Joined: 2017-01-17, 17:07
Posts: 1950
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2018-08-02, 21:07

It is working!

More or less.

Correct routing for wares and workers already works. So does ware transporting (if the ferry manages to find its waterway).

If anyone wants to testplay already – it is now possible but still a bit buggy…
[The game sometimes crashes when the ferry is almost arrived at its waterway, or when a waterway is destroyed. The ferry is sometimes temporarily invisible when carrying wares. There is an ugly bug with overlays not being removed when a road or waterway is deleted, and z-layering of roads is broken. The ferry yard can build ferries only in places with fish. Saving the game causes segfaults. Just to mention the most obvious issues.]

@einstein13: Point 2 and 3 is what ferries are mainly intended to work like, provided the water distance is not too high (and you have ports on both islands in 3). This is what they do work like (though with no flag stops on the way) in my current design.
For all other situations, it is again a choice between

  • 1) permitting worker transport via ferries (will be hard to implement, because workers will have to wait at the flag and then be shipped on the ferry), or

  • 2) prohibiting it (easy), or

  • 3) reworking flags, roads and buildings so they have one economy only for wares and one economy only for workers, and both function independent from each other. I guess this is doable – but I´d like to have ferries ready in build 21…

(2) is the easiest solution to implement by far; I´d prefer it. (1) is very tricky, and in my opinion it would make ships completely obsolete on maps where the next island is just within the range limit. This will break many map designs, so I´m against it.
I could work with (3) if it is really really really necessary…

Edited: 2018-08-03, 08:34

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

@Nordfriese
Does your screenshot contain a join between two separate economies?

And about your routing/economies: from my point of view it is necessary to rebuild economies, but I am not the only voice here. Settlers II game was very simple and didn't have "economy" as it is in Widelands. "Economies" were introduced in Settlers III and they worked a bit different since there were no flags and roads.

Going back to the topic, I haven't thought that economies in Widelands will cause so many problems. I thought that working ports and ships are enough to introduce ware transportation via ferries. You can just make two separate (but very similar) functions to path finding: one for ware and second for worker. Ware path finding will include ferries and waterways, but worker path finding will not. That would be simple, but will include going through the whole code.


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

Top Quote