Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various character movement bugs caused by performance drops #20

Open
AndyTechGuy opened this issue Jul 24, 2019 · 2 comments

Comments

@AndyTechGuy
Copy link
Contributor

commented Jul 24, 2019

When using the MinionMoveComponent to move characters, erratic movement/movement bugs appear when the game delays or has a low frame per second count (caused in-game, by having the window unfocused, etc). Here are some issues that have been observed in the current master branch of Terasology/MetalRenegades:

Major Bugs

Jump Looping

When a character is moving to a target that is blocked by an obstacle, a character will simply jump until they reach their target. If they cannot jump over what they are facing, they will endlessly jump as intended. But, when the game lags the character can get itself stuck inside the wall/corner. Now when the character jumps, they instead teleport high in the air and then fall down to the ground in a repeating loop:

fallingBug

Here, the character is attempting to travel outside the building, but has gotten stuck inside the wall and has gotten into a 'jump loop'.

In addition, when the character is manually taken out of this loop, any normal jump they make will instead be an instant upwards teleport and fall.

Character Levitation

A variation of the bug above, sometimes characters will start floating upwards into the sky; either when stuck. or sometimes when standing still:

levitationBug

In characters with behaviors that change when players are around (friendly, angry, etc.), the levitation stops as soon as the player steps in the immediate area of the ground where the character floated from.

Model Offset

Normally, a character's 'center' is at the exact centre of the character's model. But when the game lags a bit, this model becomes offset from the character's center position. Now when the character moves, the model rotates around this centre position, with a very unnatural motion.

Minor Bugs

Slight Stopping Movement

Normally when a character has their speed set to zero, they stop in place. However, with lag these characters will sometimes have a slight forward movement while stopped.

Sudden Erratic Motion

Normally a character will face the direction that they are travelling. However in some cases with lag, characters will sporadically rotate quickly either in place or during motion.

Stuck in one blocks spaces & fences

Observed specifically in Terasology/MetalRenegades#11

Sometimes, when a character with the gooey model (less then one block high) walks though a fence or one block high space, they suddenly stop and don't move until the fence or block high space is broken.

@Cervator

This comment has been minimized.

Copy link
Member

commented Jul 24, 2019

So that's why I was seeing Gooeys way up in the air! Nice research :-)

@dkambersky

This comment has been minimized.

Copy link
Contributor

commented Jul 24, 2019

I know I had similar issues with that when I was working on Behaviors - it might be related to the prediction systems.

A symptom that was common was 'sliding deer' - if an entity send a movement event in a certain direction, then stopped, and switched to doing something completely unrelated to movement, the prediction system would have the entity 'slide' in that direction as far as it could because it didn't get an explicit 'stop' command from the entity.

I don't recall how I solved it, I know one solution that was used in AdvancedBehaviors was that it basically checked on every tick if an entity was moving, and if it wasn't, it sent a 'stop' movement event (which was probably not great for performance but worked).

Some links which might or might not help:

https://forum.terasology.org/threads/ai-kinematic-movement.949/

https://github.com/MovingBlocks/Terasology/blob/develop/engine/src/main/java/org/terasology/logic/characters/ClientCharacterPredictionSystem.java

https://github.com/MovingBlocks/Terasology/blob/develop/engine/src/main/java/org/terasology/logic/characters/ServerCharacterPredictionSystem.java

I have very little knowledge on how the lag compensation / prediction stuff works, but it might be worth looking into. Maybe it's something completely different. 🤷‍♂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.