wesnoth / wesnoth

An open source, turn-based strategy game with a high fantasy theme.
https://www.wesnoth.org/
GNU General Public License v2.0
5.54k stars 1.02k forks source link

WoF: Rail over chasm - either drop it or allow decent defense #6713

Open eyalroz opened 2 years ago

eyalroz commented 2 years ago

Game and System Information

Description of the bug

In WoD scenario 8, Overlook, there's a stretch of railway over a chasm (behind the Death Knight's keep) - and non-flyer units standing there have 0% defense.

This does not make sense. Either the railway can't go over a chasm, or it can and land units get some kind of non-0% defense on it.

A similar issue is with a railway on water hexes. I'd make the same argument there - 20% is insufficient. If units can stand on the railway, they should get better defense.

knyghtmare commented 2 years ago

pinging @Jonathan-Kelly for clarification/remarks

Should the rails be replaced with hanging bridges (same behaviour as flat terrain)?

Jonathan-Kelly commented 2 years ago

So is this a lore issue or game play? Is it overly challenging getting the saurians across the railway?

Lore wise, the railway floating across the ethereal abyss is part of the magical "dreamscape" realm hidden inside the cave. This place is a little pocket reality governed more by imagination than physical laws. The defense for walking units is terrible there because they are essentially having to walk a tight rope across the abyss. One misplaced step could be their last. Simultaneously dodging eagle sized vampire bats or fighting off wraiths would be challenging in such a spot, even for the otherwise nimble saurians.

knyghtmare commented 2 years ago

So is this a lore issue or game play?

I believe the arguments for gameplay related. Normally, 0% defense is something that should not exist in maps. (It's for impassable terrain which no unit can move on - unless some special case).

20% is insufficient

That's the standard defense of drakes on water terrain. Nothing strange about that one.

Thus, I think the railway on chasm should might be subbed for a bridge.

eyalroz commented 2 years ago

So is this a lore issue or game play?

I believe the arguments for gameplay related. Normally, 0% defense is something that should not exist in maps. (It's for impassable terrain which no unit can move on - unless some special case).

Not sure if this counts as "lore", but - the presence of rail means that there's a surface for the rails to run on. Standing on that gives you better defense.

20% is insufficient

That's the standard defense of drakes on water terrain. Nothing strange about that one.

But rails running over water means that the terrain is effectively different, by the same argument as for impassable. Basically I'm saying that whoever put the rails there needs to decide what they want to really have on that hex.

Jonathan-Kelly commented 2 years ago

So looking at the situation in the terrain editor and the terrain code, it looks like this is a bug in the wider terrain system. According to the map editor, the Mine Rail overlay should add Flat defense to the tile, but instead it only adds Flat movement.

I recommend adding the "Terrain" label and maybe removing the "Campaign" one from this issue (since this bug equally affects multiplayer scenario design).

But rails running over water means that the terrain is effectively different, by the same argument as for impassable. Basically I'm saying that whoever put the rails there needs to decide what they want to really have on that hex.

Once the underlying bug is fixed, it should be Flat, so saurians (for example) will get 40% defense on railways.

Normally, 0% defense is something that should not exist in maps. (It's for impassable terrain which no unit can move on - unless some special case).

Well then... hopefully no one notices that I explicitly gave boat units 0% when docked at shore villages. ;)

knyghtmare commented 2 years ago

I recommend adding the "Terrain" label and maybe removing the "Campaign" one from this issue (since this bug equally affects multiplayer scenario design).

It's affecting all modes, actually. I will be adding Terrain label then.

Rails are counting best movement and worst defense right now (as it seems from the case).

Well then... hopefully no one notices that I explicitly gave boat units 0% when docked at shore villages. ;)

I noticed, but that's a key mechanic of scenario 2 so I think it should be an exception.

Maybe the title should be changed to "Rails overlay giving wrong Defense value"

eyalroz commented 2 years ago

Well then... hopefully no one notices that I explicitly gave boat units 0% when docked at shore villages. ;)

Shouldn't this be a game-wise rather than a campaign-wise decision?

Note that a docked ship could, on being approached by an assailant, conceivably detach from the dock and maneuver at least somewhat.

Alarantalara commented 2 years ago

So looking at the situation in the terrain editor and the terrain code, it looks like this is a bug in the wider terrain system. According to the map editor, the Mine Rail overlay should add Flat defense to the tile, but instead it only adds Flat movement.

This isn't a bug, it's a feature (or at least it was when the terrain was created). The terrain system allows specifying that the overlay uses either the best or worst value for movement and defense separately. Most terrain uses best defence, worst movement, but there are exceptions. Notably, villages use best for both.

Mine rails are extra special: they use the best of the base and a hidden "rail" type for defence and flat and the hidden rail type for movement. This is deliberate: https://forums.wesnoth.org/viewtopic.php?p=427893#p427893 describes the original commit, in which it was set to defence of base and movement of flat. It was later amended to also support the hidden terrain type to support items like mine carts that might only be able to move on rails, but since most units don't have a value defined, it defaults to impassable/0% for the hidden type which means most units just use base for defence and flat for movement.

There's also a capping system for individual units, but that doesn't apply here.

Jonathan-Kelly commented 2 years ago

@Alarantalara

Most terrain uses best defence, worst movement, but there are exceptions.

What is the use case for this particular exception though? When would you ever want to be stuck with a defense rating worse than flat, for a road-like surface?

@eyalroz

Shouldn't this be a game-wise rather than a campaign-wise decision?

I imagine it eventually will be, but at the moment, boats are generally only used in mainline campaigns as a prop or backdrop, with maybe a small exception in SotBE. Which makes WoF the first campaign to really feature naval battles or decently formidable fighting ships. Hopefully we will see a bit more of this from other mainline content in the future though.

knyghtmare commented 2 years ago

@Jonathan-Kelly Maybe define a custom defence of "rails" using https://wiki.wesnoth.org/UnitsWML#.5Bterrain_defaults.5D ? That way drakes and saurians can get the get the desired defence values?

Jonathan-Kelly commented 2 years ago

Honestly, I would prefer to PR a fix that works game-wide rather than just this one scenario or campaign. Searching the thread @Alarantalara mentioned, I was not able to find a stated reason for avoiding "best of" for the defense rating, So I think the next step is to investigate SoF's use of the mine cart mechanic to see if it is using the low defense rating for one purpose or another.

CelticMinstrel commented 2 years ago

since most units don't have a value defined, it defaults to impassable/0% for the hidden type which means most units just use base for defence and flat for movement.

This sounds like something that could be addressed by either defining a rails defence for all core movetypes or using the movetype patching feature in core to set a default defence value on rails for units that don't specify it. (The second method means that units with custom movetypes would also inherit that defence value unless they explicitly override it.)

eyalroz commented 2 years ago

defining a rails defence for all core movetype

That sounds like a reasonable thing to do IMHO.

And I would guess that, for most units, rails defense would be like either hills or flat: Railway tracks are typically placed on a low mound whose top is more-or-less flat.

Jonathan-Kelly commented 2 years ago

the next step is to investigate SoF's use of the mine cart mechanic to see if it is using the low defense rating

Looks like SoF does in fact use the defense rating of the underlying terrain for balance purposes, especially the scenario Reaching the Runecrafter where railways through a flooded mine provide faster movement over water for the protagonists but poor defense for the enemies blocking their way. So I kind of agree with @Alarantalara now; we should leave the handling of this rare terrain as it currently is.

Railway tracks are typically placed on a low mound whose top is more-or-less flat.

That is adhesion railway, which has to be nearly flat for locomotives due to the terrible traction of their metal drive wheels. The mining pushcarts dwarves use are more like wheelbarrows that can be shoved up steeper slopes when need be.