Comments (11)
I've had this issue and this is simply unavoidable with sprites too small that move too fast, especially with tiles that small. I frequently encounter this using the down control in the demo for the plugin (with and without the plugin enabled).
Phaser disables collision checking for internal faces (tiles surrounded by other tiles). It's optimal and ensures that there isn't any weird separation in the case that a player does get wedged in. Instead they just fall through, like the video demonstrates. Arcade Slopes follows suit, only checking the surface (outer-most) tiles for collisions. The rest have collision disabled.
If you're absolutely certain this a problem with the plugin, and not Phaser, feel free to share a demo and I'll look into it. I've tried to replicate the Arcade Physics collision behaviour as closely as possible so that adding the plugin to a project feels natural and unobtrusive; an addition rather than a full on change.
from phaser-arcade-slopes.
Do you think if I lowered the gravity to slow the player down it would fix this?
Maybe if the player overlaps push them back up a couple pixels?
from phaser-arcade-slopes.
Slowing the gravity would definitely help the situation yeah, because that's what causes the problem.
The player moves so far through the tile in one frame that the collision solvers push it out the wrong side (if they find it overlapping with a tile at all, they could be completely on the other side). If you increased the speed of the bullets they'd have the same problem; it's called tunnelling.
Look up continuous collision detection. It's an attempt to counteract this problem by checking multiple steps per frame/tick between the current and projected location.
http://gamedev.stackexchange.com/questions/34198/when-to-use-collision-detection-methods
from phaser-arcade-slopes.
@hexus I have been doing a ton of testing trying to figure this out and I found that this also happens when framerate drops regardless of how fast you are moving.
from phaser-arcade-slopes.
@hexus You wouldn't happen to have an example of Swept volumes are a way of using discrete detection
that you mentioned in the attached stackoverflow answer?
from phaser-arcade-slopes.
Interesting. Does the same happen with regular arcade physics if framerate drops? If so, the plugin isn't missing anything.
I'm not fully aware of how to implement swept volumes, but it sounds interesting.
What I would attempt in this situation, personally, is multiple collision tests with the object position interpolated between it's previous and current position, between each frame. As soon as you collide with something you can bail out.
from phaser-arcade-slopes.
Would you happen to have an example of this? I sort of understand what you're getting at but have no clue how to implement that.
from phaser-arcade-slopes.
Would I be able to write this in the processCallback
?
http://phaser.io/examples/v2/arcade-physics/process-callback
from phaser-arcade-slopes.
This wouldn't be what's need to fix this would it?
http://phaser.io/examples/v2/arcade-physics/quadtree-collision-infos
from phaser-arcade-slopes.
I don't have an example to hand yet.
processCallback
would run for each collision. Quadtrees are just a spatial partitioning technique used to narrow down candidates for collision detection.
Google is giving me smarter answers than I could ever give you. I was going to suggest a naive approach using a loop but there are better ways.
https://www.google.co.uk/search?q=swept+collision+detection
I might even build something into the plugin that solves this, eventually, perhaps using raycasts from each vertex of a body between each frame.
from phaser-arcade-slopes.
Is there a reason you re-opened this? It isn't an issue with the plugin. It should happen regardless of using this plugin or not.
from phaser-arcade-slopes.
Related Issues (20)
- Automatically update sprite body polygons
- Remove the snap feature HOT 1
- Fix the wasTouching flags HOT 1
- Improve tunnelling HOT 12
- Ninja physics mapping for 64px+ HOT 1
- Fix skipped collisions between tiles HOT 3
- Prevent internal edge collisions without heuristics HOT 4
- AMD/UMD HOT 2
- Object pooling for calculations HOT 1
- Bodies not colliding HOT 2
- Automatically set colliding tiles for Tilemaps
- Drop Bower HOT 1
- Update npm package HOT 10
- Full-block tile in arcadeslopes not registering for collision HOT 4
- Using Slopes in Typescript HOT 20
- Question: How to prevent slipping or sliding on slopes HOT 1
- Curved slopes HOT 4
- Phaser 3 HOT 14
- Errors: "Unresolved slope type 'r' / Slope type r not defined", "tilemapLayer.getTileOffsetX is not a function" HOT 4
- Sprite jitters/bounces at some tile junctions HOT 14
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phaser-arcade-slopes.