Units should get an attack bonus if they attack something that is below them, and get an attack reduction if they attack something that is above them. For details, see:
https://ageofempires.fandom.com/wiki/Attack
Attacking is implemented in Game::SimulateMeleeAttack() in src/FreeAge/server/game.cpp.
It might be useful to add a function to ServerMap to interpolate the elevation at an exact location where a unit stands on, using bilinear interpolation. It might also be useful to define a threshold for a minimum elevation difference for the attack bonus/malus to kick in, otherwise the results for units at a similar height might appear somewhat random.
Units should get an attack bonus if they attack something that is below them, and get an attack reduction if they attack something that is above them. For details, see: https://ageofempires.fandom.com/wiki/Attack
Attacking is implemented in
Game::SimulateMeleeAttack()
in src/FreeAge/server/game.cpp.It might be useful to add a function to
ServerMap
to interpolate the elevation at an exact location where a unit stands on, using bilinear interpolation. It might also be useful to define a threshold for a minimum elevation difference for the attack bonus/malus to kick in, otherwise the results for units at a similar height might appear somewhat random.