I seem to be having some issues with collisions not playing nice with each other and ‘randomly’ causing stuttering/pushback when there are two objects next to each and a top down object is pushing against them with collisions enable. (this can even be seen in the bomb the crate example in the “Handling collisions in your game” wiki page.
The image below shows the top down object pushing right against 2 objects (same size, hitbox and zlayer) and against a single object.
I have tried the following whilst still having the effect;
- Moving the movement logic BEFORE the collision logic.
- Moving the movement logic AFTER the collision logic.
- Disabling Camera logic.
- Changing each objects z layer so they are not the same (example [O1 – ZL1][O2 – ZL2][O3 – ZL3])
- Enabling and disabling pixel perfect rendering.
- Changing FPS from 60 to 30.
- Stopped using object groups.
- Enabled “Ignore objects that are touching each on their edges but not overlapping”.
- Used a 0.10 timer for collisions (just made things worse)
- Stopped using external events and had all logic in a single scene.
- Moving the game from what you see above to a simple scene that only has 2-3 objects, 1 playable character and logic for movement and collisions to rule out any random events that I may have overlooks.
- Changed my characters from looking like things to 3 different boxes (32 x 32, 32 x 16 and 16 x 32) making sure everything stayed default (origin, hitbox (square) and Centre)
- Using Sprite Tiles Vs Sprites.
- Exported to .exe instead of HTML5.
I have linked two test games below, one with pixel perfect (smoothing disabled) and another using linear(smoothing enable) test game below to show the examples as well as the game’s raw files. If anyone has any answers, solutions, etc that would be great.
- Test Game – Pixel Perfect: GDevelop-Collision-Test-PixelPerfect by Eiklahc
- Test Game – Linear: GDevelop-Collision-Test-LinearSmooth by Eiklahc
- Raw files for both: GDevelop-Collision-Test-RawFiles by Eiklahc
(Before you comment arthuro555, I know you prefer game jolt over itch but it was easier to upload there :D)