beyond-all-reason / Beyond-All-Reason

Main game repository for Beyond All Reason.
https://www.beyondallreason.info/
Other
1.78k stars 299 forks source link

Walls decrease explosion damage #2666

Open rofdo opened 8 months ago

rofdo commented 8 months ago

Description

When a wall is between an explosion and a unit/building, it receives less damage than without a wall.

Why?

  1. Players can choose to trade resources and space for protection against chain reactions.
  2. It feels counterintuitive that having walls between buildings doesn't decrease their chance to chain react. https://github.com/beyond-all-reason/Beyond-All-Reason/assets/72305059/5cb21098-7900-4ebf-a61b-370dcd24e60a
  3. Walls would become more useful. I feel like they are currently not used enough.

What area of the game does this feature request pertain?

Gameplay

Other (optional)

I don't know how this could be implemented, but i can imagine that it may affect performance, because for every unit affected by an explosion it would need to be checked if there is a wall between them. Of course this could be optimized by for example only checking for explosions above a certain size. However the main idea behind this feature was to give the players a way to prevent their buildings from chain reacting. Implementing this feature only for exploding buildings affecting other buildings would be enough.

MeSaber commented 7 months ago

Having a wall inbetween a projectile and a defensive tower does decrease damage because how the aoe splash works. If a projectile explodes further out and edge effectiveness is not 100% it will change the outcome.

For not chain reacting you already have spreading.

Walls are already being used quite a lot and im sure they will be used more as the game evolves. Making walls too good might become a problem.

WatchTheFort commented 7 months ago

Provisionally approved by the Game Design Team, however if there is no technically feasible solution, this will not be implemented.

rofdo commented 7 months ago

Very nice. Since this changes how explosions interact with units I would assume that this would need to be handled on an engine level. @Dennshirennshij and I forked the engine and will try to implement this feature here https://github.com/Dennshirennshij/beyond-all-reason-spring.

We both don't have much experience with stuff like this so advice is welcome.

rofdo commented 6 months ago

We have implemented a prove of concept of this feature. Right now every unit (not only walls) that is between another unit and an explosion reduces the amount of damage taken by 50%. This every unit affected by an explosion checks, if another unit is between itself and the explosion.

Here a before and after video: https://github.com/beyond-all-reason/Beyond-All-Reason/assets/72305059/a6c73eb3-46d0-4b07-8b91-c8657e940d44 (notice: the walls take the same amount of damage in both situations, the wind turbines only take half the amount of damage in the second situation with our feature enabled)

No optimization of any kind has been done.

Without feature: Screenshot_20240421_210731

With feature: Screenshot_20240421_214412

At least for the "benchmark bar" scenario there seems to be no measurable influence on performance. There are some questions that need to be answered:

sprunk commented 6 months ago

Should each unit type have a value assigned to itself determining the amount of damping? Should only walls damp the amount of damage taken by an explosion? How much explosion damage should be prevented?

Each game generally answers this kind of question via Lua.