Skip to content

Allow bridgeable water type that is both swimmable and walkable#6900

Open
bunnybot wants to merge 28 commits into
masterfrom
mirror/tothxa/widelands/bridgeable
Open

Allow bridgeable water type that is both swimmable and walkable#6900
bunnybot wants to merge 28 commits into
masterfrom
mirror/tothxa/widelands/bridgeable

Conversation

@bunnybot
Copy link
Copy Markdown

@bunnybot bunnybot commented Oct 19, 2025

tothxaMirrored from Codeberg
Created on Sun Oct 19 12:29:52 CEST 2025 by Tóth András (tothxa)


Type of Change

New feature

Issue(s) Closed

https://www.widelands.org/forum/post/43680/
Re: #2020
Fixes: #5853

New Behavior

It is possible to create areas where both ships and workers can pass. This allows navigable rivers that don't separate the land, as well as straits between large water bodies where land crossing is possible without blocking ship traffic. (just 2 sides of the same coin actually :)

How it Works

The new is=bridgeable terrain type is both kWater and new type kBridgeable, which allows building roads and becomes walkable where there is a road.

Possible Regressions

Pathfinding, road building

Screenshots

oops, should've created some... coming soon

Additional context

Currently flags can be placed anywhere on bridgeable water, and thus bridges can join and cross each other, because that happens IRL too, and because I liked it this way.

If the consensus is that they shouldn't be allowed, then we also have to decide whether to:

  • use the waterway building logic for bridges too, which requires new field action buttons and options for all combinations of switchig between all 3 types, so I think it would clutter the interface a lot
  • or just simply disallow flags in the middle of bridges and leave it to the players whether they want to place the next flags on the banks or farther away, so it's somewhat inconsistent IMO that bridges on navigable water would be special in one way, but blend so much with plain roads in another way

Flags are not allowed on bridgeable water, but not required at the banks either.

@bunnybot bunnybot added this to the v1.4 milestone Oct 19, 2025
@bunnybot bunnybot self-assigned this Oct 19, 2025
@bunnybot
Copy link
Copy Markdown
Author

Assigned to tothxa Tóth András (tothxa) ( @cb/tothxa )

@bunnybot bunnybot added enhancement New feature or request maps Map design world Critters, trees, terrains, ... under discussion There is no consensus about a critical point yet labels Oct 19, 2025
@bunnybot
Copy link
Copy Markdown
Author

tothxaMirrored from Codeberg
On Sun Oct 19 12:38:38 CEST 2025, Tóth András (tothxa) wrote:


I reused the original water animation frames, but reordered them to give the back and forth look.
The reordering algorithm was first take frames 0 to 32 in steps of 2, then from 31 to 1 in steps of -2. This also smooths the direction changes a bit.

If accepted, I'd consider swapping the 2 for all climates to match the intended uses better: unwalkable water for large water bodies with standing waves, and bridgeable water with flowing look for rivers.

@bunnybot bunnybot added the ci:success CI checks succeeded label Oct 19, 2025
@bunnybot
Copy link
Copy Markdown
Author

tothxaMirrored from Codeberg
On Sun Oct 19 14:29:40 CEST 2025, Tóth András (tothxa) wrote:


I forgot the glitch that waterways should not be allowed to connect to flags in the middle of bridgeable water.

@bunnybot
Copy link
Copy Markdown
Author

NordfrieseMirrored from Codeberg
On Mon Oct 20 00:55:03 CEST 2025, Benedikt Straub (Nordfriese) wrote:


While the idea seems interesting in principle, I'm not sold on whether this is not too much a stretch on realism. Especially if walkers are allowed to walk on nodes not directly connected by an actual bridge.

Several tribes' ships are pretty large and appear to require a certain amount of water under their keel, so I question whether the depth of the water required for the ships to safely pass doesn't altogether exceed the depth of what workers can comfortably (or at least safely) walk in. A quick search claimed that 1.5 to 3 meters is a reasonable estimate for a medieval tradeship's flotation depth.

For context, in my homeland Northern Frisia it used to be very common for people to drown while trying to walk or ride from one island to another, which is possible under good conditions across tideways that are also sailable. (These days, they are usually rescued by helicopter, and this happens quite frequently actually, but unfortunately help does not always arrive in time.) So in my personal experience the idea of walking on foot across terrain where small ships can also sail is connoted as extremely unsafe unless you have an experienced local guide and fair weather and an accurate tide calendar and set out at just the right time of day; and even then, the definition of "walkable" includes fording hip-deep tideways (while watching out for any ships that might cross your path); and naturally walking through deep water is very slow, even when you avoid getting stuck entirely in the invisible mudholes.

So, while I accept that a small ferry can share a coastal area with workers, I am not convinced that workers can walk where full-size ships can sail. What depth would you say the water has, and what the ships would at least require?
And even though the weather in Widelands is 24/7 perfect sunshine, I worry a little about the safety of the workers, and I find it hard to believe they would be able to walk there without a major slowdown.

If the walkability is restricted to bridges only, this does not really simplify things, since the point remains that each bridge segment is just one edge long with the nodes as connector points, where the workers still have to ford a channel of deep water. And how can the broad ships fit through these extremely narrow straights between two directly adjacent bridge segments?

Widelands is not always highly realistic, but to me this sounds like a too-major suspension of disbelief. However, I think this feature would be a superb addition for map design, and I am quite open to being convinced that this is not as unrealistic as it at first impression appears to me :)

P.S. Screenshot from a quick test:
shot0023

@bunnybot
Copy link
Copy Markdown
Author

tothxaMirrored from Codeberg
On Mon Oct 20 01:53:43 CEST 2025, Tóth András (tothxa) wrote:


Well, I take it as you want me to do it the other way:

The last one though requires a completely new terrain type, and probably deeper changes to the road creation and pathfinding code. My idea would be what I wrote in the forum: bridgeable terrain would allow building roads, but would only get MOVECAPS_WALK where roads are already built.

That's fine. Although I have to throw out most of what I've written so far, but that's not a problem as writing it helped me understand a lot about these parts, that will help implementing the new terrain type.

The only thing I'm afraid of is that it very likely needs extra code in the AI...

@bunnybot bunnybot added bug Something isn't working cleanup & refactoring Improving our code quality ci:success CI checks succeeded and removed ci:success CI checks succeeded labels Oct 20, 2025
@bunnybot bunnybot added ci:success CI checks succeeded and removed ci:success CI checks succeeded labels Oct 21, 2025
@Fr-Dae
Copy link
Copy Markdown

Fr-Dae commented Feb 10, 2026

max is 12 like a naval road ?

@bunnybot bunnybot added ci:fail CI checks failed and removed ci:fail CI checks failed labels Feb 11, 2026
@bunnybot
Copy link
Copy Markdown
Author

tothxaMirrored from Codeberg
On Wed Feb 11 20:00:07 CET 2026, Tóth András (tothxa) wrote:


I added the pads as separate items with extra code to draw them.
pillar_emp
pillar_fri

@bunnybot
Copy link
Copy Markdown
Author

tothxaMirrored from Codeberg
On Wed Feb 11 20:02:15 CET 2026, Tóth András (tothxa) wrote:


Re length: If it is to be limited, then the limit shouldn't be more than 4 fields.

Actually I've thought a bit about this, and came to the conclusion that a limit of 2 would be very easy to implement: only one end of a segment is allowed to be bridgeable, the other must be walkable. This would prevent lengthwise bridges on a river too. Plus it wouldn't be too hard to also add a check that there's at least one water node on both sides between the connected walkable nodes, so that would also make sure you can't build bridges to the same bank of the river.

After all, this is enough to solve the map design conflict.

Anything more (even 3) would need much more code to enforce the same constraints.

@bunnybot bunnybot added the ci:fail CI checks failed label Feb 11, 2026
@bunnybot bunnybot added ci:fail CI checks failed ci:success CI checks succeeded and removed ci:fail CI checks failed labels Feb 11, 2026
@bunnybot
Copy link
Copy Markdown
Author

tothxaMirrored from Codeberg
On Thu Feb 12 16:56:24 CET 2026, Tóth András (tothxa) wrote:


After all, this is enough to solve the map design conflict.

but e.g. Forest Valley needs 3 steps long bridges.

So I'd rather keep it as it is, and make it the map designer's responsibility to only use it where it makes sense. (and the player's decision if they want to make lengthwise bridges without the possibility of flags)

@bunnybot bunnybot changed the title WIP: Allow bridgeable water type that is both swimmable and walkable Allow bridgeable water type that is both swimmable and walkable Feb 12, 2026
@bunnybot bunnybot marked this pull request as ready for review February 12, 2026 20:36
@bunnybot
Copy link
Copy Markdown
Author

tothxaMirrored from Codeberg
On Thu Feb 12 21:49:58 CET 2026, Tóth András (tothxa) wrote:


I may still do the pillars of the 2 remaining tribes (though I'd appreciate some feedback first whether this is acceptable), but I don't think it's essential to do it in this PR now that we have the proof of concept.

The terrain animation can be finalised and other climates added in a separate PR too.

I can make the pillars relatively easily, but I don't think I could create new terrain textures or even just tweak the existing ones in a good looking way, so I'd rather stick with some kind of reordering the normal water animation.

@bunnybot bunnybot added ci:success CI checks succeeded and removed ci:success CI checks succeeded labels Feb 22, 2026
@bunnybot bunnybot added ci:success CI checks succeeded ci:fail CI checks failed and removed ci:success CI checks succeeded labels Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ci:fail CI checks failed cleanup & refactoring Improving our code quality enhancement New feature or request maps Map design under discussion There is no consensus about a critical point yet world Critters, trees, terrains, ...

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Waterway marker indicating impossible directions

3 participants