Jump to content

Phaser bug- With floor aligned Tiles and collision direction (!?)


s4m_ur4i
 Share

Recommended Posts

After half a day of debugging, I am quite sure the issue is not in my code since it comes directly out of Phaser.
I attached a screenshot.

The characters collide at the green C marked position. But there is nothing to collide with.
The <obj>.body.blocked.left property is set to true >> so they are colliding left
This shouldn't be possible. Since there is no object (green mark C)

So I debugged the Phaser functions for collision.
The call comes out of: https://github.com/photonstorm/phaser/blob/v2.6.2/src/physics/arcade/TilemapCollision.js#L356
(thanks to @Claudiovc )

processTileSeparationX is called from: https://github.com/photonstorm/phaser/blob/v2.6.2/src/physics/arcade/TilemapCollision.js#L242
were I passed in the >tile< parameter to processTileSeparationX and logged it. You can see that in the console window in the screenshot.

The data on this tile shows that the ground-tiles are causing the <obj>.body.blocked.left = true. This Tile is marked red T.
This is a possible bug. I also tested all the tile data, which you can see is on debug mode. Every tile (debug mode) aligns on the same pixel on the Y axis.
So there is no "step" in it. The reason to assume it is a bug is that the collision on the left is called not <obj>.body.blocked.down

Any further thoughts or already investigations on that - or am I completely wrong :D

regards

collision-issue.png

collision-issue.png

**EDIT**

You can also test this with collision enabled only for top / bottom, then the floor tiles wont fire the collision.
So I assume this is indeed some issue with the collision detection within phaser.

Edited by SamTheMighty
further Tests made
Link to comment
Share on other sites

Now I am puzzled. When I speed up the "walk-speed" (velocity X) of the characters. They go through -
This makes no sense... anyone?

**EDIT**
Does not depend on the velocity... it doesn't fix it.

Edited by SamTheMighty
further Tests made
Link to comment
Share on other sites

hope you don't mind mentioning you in this post @rich

I am serious, this is a bug. I wrote a testcase so anyone can reproduce it.
To run the testcase, do:
1. npm install;
2. node server.js
then: http://localhost:8080/

I investigated now a few days to get sure it's not my code.
The "invisible" collision caused from the floor aligned tiles varies if the characters velocity is even or uneven.

I described above the way I debugged were the collision calls are coming from.
There is a phaser-arcade-testing.js in it, were I modified the physics to log the tile that causes the collision;
But this can also reproduced with any other phaserJS version. (I just added console.trace())

if it's even: there are other "invisible" collisions caused from the floor tiles, than by an uneven velocity.
I am quite sure this is a bug in the arcade collision physics by phaser. I tested phaser 2.4, 2.5 and 2.6

regards

 

testcase_without_node_modules.zip

Edited by SamTheMighty
Example files: deleted unecessary code to understand it more easy.
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...