0 Favourites

Inaccurate Collision Detection with Screen Jitter

  • Using: Tileset Map, 16x16 Objects, Sprite: Scroll to and 8 Direction behavior

    When Sprite collides against a Solid Object:

    -Screen starts to jitter by one pixel like crazy

    -Collision Polygon does not apply accurately. Sprite collides randomly at up to 3-4 pixels away from the actual collision point set. It also bounces back most of the time by one pixel.

    -Sprite colliding left or right will not jitter, but make it move 3 times faster than normally along the solid objects edges towards the "Is in Touch|Set Angle Towards, Move Toward 1 Pixel. Move betwen angles"

    checked alot of guides and videos, but no luck with fixing this

  • Mind sharing your capx, so we could take a look?

    Sounds like collision-polygon-problems (Is the sprite animated?)

    What does this mean?

    "Is in Touch|Set Angle Towards, Move Toward 1 Pixel. Move betwen angles"

  • Ah sorry, ofcourse.

    Ill make a simplified copy of the map screen because there is alot of stuff going on with the game already.

    (remove space around www)

    https:// w w w .dropbox.com/s/yz0u4jn2pco1tuj/The%20Game%20How%20to%20Solve.capx?dl=0

    As you can see, there is nothing smooth about the collision

  • Your main issue is having the 8-direction behaviour and not using it..

    You tell mapchar to move 1 pixel in the direction of touch, which it does, only to be pushed back by the 8-direction-behaviour..

    so the jittering is the moving 1 pixel and being pushed back outside the solid..

    The problem with the collision being "too high" is that it's not..

    MapChar is setting it's angle, while characteranimations isn't, so mapchar is colliding (rotated), while characteranimations is still pinned to the center (not rotated), so it looks like CharacterAnimations is way off from the collission..

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • I see. Awesome, thanx alot. Though with that solution the sprite gets stuck when colliding and not moving towards the touch anymore. Trying to figure it out now. I guess it has to be move towards touchxy and not at angle.

  • idk, i even tried with pathfinding, but couldnt make it work. and pathfinding is not pixel perfect so its useless here.

    any idea how to make LittleStains example work so the character wont get stuck when hitting solids?

    this works very easy with using the keyboard. but with "Is in Touch" seems so tricky..

  • idk, i even tried with pathfinding, but couldnt make it work. and pathfinding is not pixel perfect so its useless here.

    any idea how to make LittleStains example work so the character wont get stuck when hitting solids?

    this works very easy with using the keyboard. but with "Is in Touch" seems so tricky..

    It doesn't really get stuck..

    You want to move in the direction of touch.x,touch.y, but if in that direction it is overlapping I make the player move back in the same tick..

    Splitting up the x and y movement might end up more being what you would like..

    Not perfect yet, but improved again:

    https://dl.dropboxusercontent.com/u/485 ... ved-1.capx

  • thanx man, so awesome! very greatful. ill try work with that for a couple of days again.

    maybe c3 will make "basic" stuff like that easier to implement for noobs

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
64 4,529
nimos100's avatar
nimos100
Unread hot topic
56 6,107
broknecho's avatar
broknecho
Unread hot topic
54 7,194
SamRock's avatar
SamRock