4ian / GDevelop

🎮 Open-source, cross-platform 2D/3D/multiplayer game engine designed for everyone.
https://gdevelop.io
Other
11.23k stars 869 forks source link

Wrong object update on TILED collisions #6050

Open RMDB-GD opened 11 months ago

RMDB-GD commented 11 months ago

Is there an existing issue for this?

Describe the bug

I've reported here https://forum.gdevelop.io/t/bug-tiled-map-collision-project-linked/52649/9 the issue, basically the origin of the object when updated is wrongly placed on Tiled map image position, this lead to many problems in many games, not just platformers, Here the example. https://mega.nz/file/4BsXUJYb#CRSBv0i1WpvocHKeJcmweahy5sZg84JTcGRoNgYwYLg

Steps to reproduce

press q or e to change animation on Tiled platforms press space to jump https://mega.nz/file/4BsXUJYb#CRSBv0i1WpvocHKeJcmweahy5sZg84JTcGRoNgYwYLg

GDevelop platform

Desktop

GDevelop version

5.3.183

Platform info

*OS (e.g. Windows, Linux, macOS, Android, iOS)* > *OS Version (e.g. Windows 10, macOS 10.15)* > *Browser(For Web) (e.g. Chrome, Firefox, Safari)* > *Device(For Mobile) (e.g. iPhone 12, Samsung Galaxy S21)* >

Additional context

THE “POSITION” POINT IS THE PROBLEM, IN FACT TILED MAP POSITION POINT IS IMAGE GENERATED, THAZ WHY THE PLAYER IS FLYING TO TILED POSITION POINT… THIS MUST BE CHANGED…IN SOME WAY…“IF EACH FRAME THE OBJECT/(COLLISON) KNOWS WHERE THE PLATFORM IS…IT SHOULD EVER KNOW WHERE THE PLATFORM IS WHEN THE OBJECT IS UPDATED…” AS IT IS NOW, GD IS NOT COMPATIBLE WITH TILED ALSO THE PROBLEM HAPPENS EVEN WITH UNTOUCHED COLLISION BOXES SIZE

RMDB-GD commented 9 months ago

UPDATE: since i really need this to be fixed, i went more in depth. And i noticed that disabling the platformer behavior (ofc) doesn’t cause the issue. So it should be an incompatibility between the GD Platformer Behaviour and The Tiled Map. I’ve upgraded the project debug so there are 2 proijects. 1 with the bug(conflict) visible and the other with the disabled conflict. I need this to be compatible because i need the air2floor dive (with sprite size expand/transform) and ofc i need air-collisions to be available

D8H commented 8 months ago

Thank you for reporting this issue and providing an example.

The issue should be fixed in the next release:

If you do squash and stretch on the character, I think it's better to use 2 objects:

In the example, the tiles of the tile map are very small. Do you use this in your game? if so, for which purpose? Do you know that platforms can be rotated to do a slope?

RMDB-GD commented 8 months ago

nope. i'm on a high res game.1080p I'm doing a air2floor/power kick dive (dunno if u played sotn), But when the player dive i'm creating the hair air (and mantle) drag effect that ofc doesn't fit in the first sprite.Arms too are extended above the head to emphasize the kick) (let's say that it kinda double the sprite in air before and when falling down by a power dive). But i guess any sprite transform could face this problem (transformation, fighting grab, special move ecc, like eg e sword extension power hit..) If possible i prefer to not create a second object since collision boxes are already declared in editor and everyhting works on built in GD platform behaviour and it probably is the only situation in the whole game when i need it. If it can't be fixed guess i'm gonna create the hitbox in air just for that situation...but i don't find it economic. Still thx for any improvement u made

Ofc i know that platforms can be rotated to do a slope...but not in TILED