"It's over Anakin. I have the high ground!"

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Post Reply
User avatar
Helmet
Posts: 641
Joined: December 19th, 2006, 5:28 pm
Location: Florida, USA

"It's over Anakin. I have the high ground!"

Post by Helmet »

Version 1.17 has introduced new tiles with elevation: bluffs, gulches and ravines. This map fragment is from the map "3p_Elevation_Example.map" which comes with version 1.17. (Click map to enlarge.)
elevation_test_map.jpg
What tactical advantage would you give a unit holding the higher ground? Better terrain defense? Increased damage?

Should changes in elevation cost traveling units more movement points?

If a coder wants to share their nifty "higher ground" code with the coding community, this would be a good thread to post it. I've climbed several rungs up the WML ladder, but such code appears two or three rungs above my head. I imagine every hex adjacent to a change in elevation would need to be identified as above or below. And then there would be tricky situations, like you see on the map above. Almost in the exact center of the map is a hex that is above and below adjacent hexes.

Anyhow, the elevated tiles certainly look cool on a map, even if they don't do anything. 8)

Note: when creating maps in the map editor using elevation tiles, the "arrows" act like a paint bucket. Finish your map, then click once in each zone of elevation to designate areas as above or below. (That's all I know how to do so far. If you learn anything else, please share.)
Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
User avatar
Ravana
Forum Moderator
Posts: 2995
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: "It's over Anakin. I have the high ground!"

Post by Ravana »

Its the opposite of nifty, but https://github.com/ProditorMagnus/Agele ... ground.cfg is designed for damage adjustment based on relative height.
User avatar
Helmet
Posts: 641
Joined: December 19th, 2006, 5:28 pm
Location: Florida, USA

Re: "It's over Anakin. I have the high ground!"

Post by Helmet »

Ageless Era is goldmine. Thanks for linking to that macro.

The numerous filters in that macro could provide a framework for anyone creating a new macro for the elevation tiles.
Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
User avatar
Ravana
Forum Moderator
Posts: 2995
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: "It's over Anakin. I have the high ground!"

Post by Ravana »

Either wiki has not been updated, or these editor features are not possible to detect in WML. Standard location filter page has not been updated recently.
LienRag
Posts: 127
Joined: September 24th, 2018, 4:03 pm

Re: "It's over Anakin. I have the high ground!"

Post by LienRag »

Oh, that is indeed very interesting !
First thing that it should give is a a better vision range (for maps with shroud/fog).
Then it should give a better attack range for missiles, but it's difficult to translate to how Wesnoth treats ranged attacks. One more damage point maybe ? Which would favor weapons with high number of attacks and low damage, but why not ?
Or better (but not exclusive), specific traits/abilities, like "high angle attack" that gives a +3 damage points when attacking from above ? Or 'marksman' ability when firing from above ?
Also "no groin armor" that gives a damage bonus to the one being below (so the higher ground is not always an advantage) ? To be precise (and to keep the game tactically interesting) this trait should be applied to the victim, not the attacker (so you don't have units that are always better on lower grounds, but you have some units that are more vulnerable when on higher ground).
Melee is also a factor where higher ground is better; I'd say add a defense bonus to higher ground/malus to lower ground but I believe modifying defense is against Wesnoth philosophy. So maybe add a resistance bonus/malus ? Maybe specific to some attacks (like "arcane" could have no bonus nor malus, "pierce" should have a little, "blade" a better one, and "impact" the highest one as striking from above gives more blunt force) ?
LienRag
Posts: 127
Joined: September 24th, 2018, 4:03 pm

Re: "It's over Anakin. I have the high ground!"

Post by LienRag »

Also yes non-flying unit should consume at least one movement point when going up an elevation.
User avatar
Spannerbag
Posts: 534
Joined: December 18th, 2016, 6:14 pm
Location: Yes

Re: "It's over Anakin. I have the high ground!"

Post by Spannerbag »

Helmet wrote: November 28th, 2022, 3:38 pm Version 1.17 has introduced new tiles with elevation: bluffs, gulches and ravines. This map fragment is from the map "3p_Elevation_Example.map" which comes with version 1.17. (Click map to enlarge.)
elevation_test_map.jpg

What tactical advantage would you give a unit holding the higher ground? Better terrain defense? Increased damage?

Should changes in elevation cost traveling units more movement points?
I've had a brief play with the terrain but haven't had chance yet to try anything serious.

Whilst probably overly "realistic" my thoughts are:
  • For units to be able to engage in melee on different elevations the height difference cannot be significant.
  • Preferably treat ranged and melee the same (i.e. same modifications - or at least modification logic - apply to both attacks).
    That said, I'd guess that elevation would primarily influence damage inflicted in melee (striking upwards/downwards) whereas range would be more likely most affected for missiles (which is of course meaningless in Wesnoth).
  • Ideally inherent to unit so implemented within a unit rather than using campaign/scenario events/macros etc.
    Possibly via a hidden [unit_type][event] or [special]?
    (Also allows for different elevation modifications by race/terrain? E.g. flying units can probably ignore elevation.)
Though it's possible to present valid arguments for all sorts of modifications; vision, movement, defense etc. remember that some poor sod has to code it all so my inclination is to keep it simple. It really depends on how much of an advantage players want elevation to confer.
Personally I quite like the Ageless era damage mod mentioned by Ravana. My only thought here is that, based on my very quick skim of the code, if both units have these specials then it might be a bit overpowered? Just a thought.

FWIW I think elevation should confer a useful but not overwhelming advantage (i.e. roughly similar to the benefit/penalty from a trait).
Off the top of my head I would propose the following possibilities (or a combination of some of them):
  • [damage] +/- 1/difference in elevation similar to ageless era.
  • Units separated by 2 elevation steps cannot engage in melee unless at least one combatant can fly (might make for some interesting map challenges but could be awkward to implement?).
  • Unit on higher ground always gets initative ([firststrike]) if elevation difference=1 and +/- 1 damage per additional elevation difference.
    (Basically reduces the damage differential between elevations.)
  • Unit on higher/lower elevation has increased/decreased [chance_to_hit].
I suppose if I had to choose I'd go for the following:
  • Elevation difference=
    • 0: normal combat (well duh).
    • 1: higher unit gains [firststrike].
    • 2+: [damage] +/- 1 per step over 1 (so very high vs low would incur damage modifier of 3-1=2?)
    --- or ---
  • Elevation difference=1+: chance_to_hit] +/- 10% per step? (so very high vs low would incur damage modifier of +/- 30%, too much? Maybe 5%?)
That said, I still quite like the idea that if elevation difference is 2 or more then units cannot melee unless at least one can fly.
I also think magic ranged attacks should always ignore elevation (not sure about melee).

Re. vision: I'm inclined to not change this based on elevation because elevation wouldn't (IMHO) affect how far a unit can see under fog or shroud nor would it affect vision at the current elevation. Vision of higher terrain would, presumably, be reduced and increased for lower terrain. Personally I'm not sure that benefit is worth the effort of coding such a feature, but others may be more keen than me :)

Re. movement: I'm undecided. Many terrains are not inherently level (e.g mountains, hills) and movement over such terrain is "averaged out". A similar argument can apply to an elevation boundary, especially if it is thought of as not an abrupt step but a more extended transition? I'd also suggest that if elevation boundaries were subject to movement penalties then a single, universal penalty would hamper less mobile units more.

As a starting point I agree with Helmet; we should get some sort of consensus about elevation difference effect(s).
Hope my first thoughts help, though I'm almost certain we'll never get close to universal agreement on this :)

Cheers!
-- Spannerbag
SP Campaigns: After EI (v1.14) Leafsea Burning (v1.17, v1.16)
I suspect the universe is simpler than we think and stranger than we can know.
Also, I fear that beyond a certain point more intelligence does not necessarily benefit a species...
User avatar
lhybrideur
Posts: 369
Joined: July 9th, 2019, 1:46 pm

Re: "It's over Anakin. I have the high ground!"

Post by lhybrideur »

My two cents :
OK for +-1 damage or +-10% chance to hit for elevation difference (rather the latter) whatever the total difference. Same for ranged and melee. MAGICAL and MARKSMAN cancel that.
OK for no melee for >1 elevation difference. I would had no ranged for -2 elevation.
firststrike for elevation would be overpowered and I see no reason for that.
Vision, I would had +1 for elevation but only for shroud, not fog.
Movements, as you say, it depends if we consider a abrupt step or not, but you could say the same for mountains, so I would still add one mp to go up one lvl.
LienRag
Posts: 127
Joined: September 24th, 2018, 4:03 pm

Re: "It's over Anakin. I have the high ground!"

Post by LienRag »

lhybrideur wrote: April 20th, 2023, 9:04 am Same for ranged and melee. MAGICAL and MARKSMAN cancel that.
I would disagree with that. Ranged and Melee should work differently, as they are not impacted similarly by elevation. Also, there should be not limit for ranged combat across elevations, though "no combat if 2 levels of more of elevation difference" is a good idea concerning melee.
Post Reply