lethal-guitar / RigelEngine

A modern re-implementation of the classic DOS game Duke Nukem II
GNU General Public License v2.0
914 stars 60 forks source link

Make the smooth scrolling option affect non-flying enemy movement #835

Closed Calinou closed 8 months ago

Calinou commented 2 years ago

Related to https://github.com/lethal-guitar/RigelEngine/issues/834.

The smooth movement option currently doesn't affect non-flying enemy movement such as these ones:

image

Smooth movement appears to work for flying enemies though.

lethal-guitar commented 2 years ago

@Calinou thanks for the report! It's actually not so easy with these enemies, since they don't move 1 tile each frame, but rather 1 tile every other frame. So you could say that they move by 0.5 tiles every frame, but the game logic isn't implemented like that (there is no concept of fractional tile positions).

We could enable smoothing for these, but it's not going to look as good as it does for objects that move faster. Since you get a kind of "stop & go" effect. So I decided to not enable smoothing for any "walking" enemies for now, and maybe revisit it later.

If you'd like to see for yourself how the blue guard enemy looks with smoothing, you can add a call to engine::enableInterpolation(entity); to the configuration here.

Some non-flying enemies do have smoothing btw, for example the cylindrical robot that teleports in. For that one it works because it also moves at 1 tile/frame.