Platform behaviour issue with next to wall condition

Get help using Construct 3!

Post » Mon Jul 10, 2017 4:07 pm

Hi all,

I've been playing around with the platform behaviour and noticed that the "next to wall" condition doesn't trigger if there is tilemap collision directly above the avatar:

https://www.dropbox.com/s/90krbak275kg0 ... 0.c3p?dl=0

If you push into the wall either side of the central block then the correct animation is shown, but if you push into wall on the far left or right of the level (where the avatar is below a tile) then for some reason the animation doesn't run. Any ideas what the problem is? I can get around it by making my avatar smaller so that there is a gap between it and the ceiling, but that isn't ideal.

Bonus related issue: If the avatar is exactly the same size as a tile then it won't fit through a single tile width/height gap. Why is this and is there any way to get around it? In the linked demo I've reduced the avatar's collision by a pixel on the top and sides, but it's a bit messy (you can see the overlap between the avatar and the tilemap) and would prefer a more aesthetically agreeable solution.

Thanks in advance for any help :)
B
16
S
7
G
3
Posts: 396
Reputation: 3,700

Post » Thu Jul 13, 2017 7:17 pm

Giving this a bump before I resort to logging it as a bug.
B
16
S
7
G
3
Posts: 396
Reputation: 3,700

Post » Sat Jul 15, 2017 4:14 pm

Read that comment here ?
r123-2-is-by-wall-miss-detection_t81392
B
33
S
18
G
28
Posts: 2,470
Reputation: 20,904

Post » Sun Jul 16, 2017 2:12 pm

Thanks for posting - I missed that thread.
I've already filed it as a bug but if what @Ashley says is correct and it's not going to be fixed then I'd suggest removing that condition from the behaviour because it is totally unreliable; in a platform game where the avatar is jumping around there will be plenty of opportunities where the avatar ends up in this situation. Either that or you have to build your levels so such a possibility can't arise, which is a pretty heavy restriction.

TBH I don't understand why the check has to stop after moving it up and registering a ceiling. Why can't the test continue to move the sprite horizontally to test for a wall? If the sprite is on the ground and has a ceiling directly above it doesn't that preclude it from being on a slope? Or do a check on the sprite's angle to confirm whether it is horizontal.
B
16
S
7
G
3
Posts: 396
Reputation: 3,700

Post » Sun Jul 16, 2017 4:40 pm

I cant answer does questions.

But let me suggest another way to tackle this.
https://www.dropbox.com/s/y7cbazqk1ouvfwc/1012.c3p?dl=0

Is this what you want to do ?
B
33
S
18
G
28
Posts: 2,470
Reputation: 20,904

Post » Tue Jul 18, 2017 9:37 am

@99instances2Go

Thanks for sharing this, and apologies for the delay in responding. It does partially solve my issue and I may well end up going with this so much appreciated, although I'm not entirely sure how this voodoo is working correctly: shouldn't the move left/right animations be resetting to frame 0 every tick? Or conversely, shouldn't the animation continue to loop when against the wall?

I think the initial problem might arise again with this solution if I wanted to play a different animation when the avatar is next to the wall, a "collide" or "interact" animation for example.
B
16
S
7
G
3
Posts: 396
Reputation: 3,700

Post » Tue Jul 18, 2017 2:14 pm

Oh it does not loop (step) when against the wall ? I did't notice that. Got to re look at it.

About: 'shouldn't the move left/right animations be resetting to frame 0 every tick?'

When you use the action 'Set Animation' .... then the animation will change ONLY when ...
The new animation is different then the current playing animation, OR, when the current playing animation is in the state of 'stopped'.

An animation is in the state 'stopped' when you used the action 'Stop' or/and when a non looping animation reached the end of frames.

Usually i do not set the walking animations to 'looping'. Because they are set on 'Key is down', a continuous 'every tick' condition.

Key is down (or vectorX =not zero)
__________Set Animation "walk" (from beginning)

When "walk" is not looping, that action will do nothing as long as "walk" is playing, when "walk" is stopped (animation is at the end), that action will restart the animation, effectively looping the animation.

I did not check this on the capx, btw.
B
33
S
18
G
28
Posts: 2,470
Reputation: 20,904

Post » Tue Jul 18, 2017 3:14 pm

99Instances2Go wrote:Oh it does not loop (step) when against the wall ? I did't notice that. Got to re look at it.


It's better in this case for it not to be looping when against the wall.

99Instances2Go wrote: About: 'shouldn't the move left/right animations be resetting to frame 0 every tick?'

When you use the action 'Set Animation' .... then the animation will change ONLY when ...
The new animation is different then the current playing animation, OR, when the current playing animation is in the state of 'stopped'.

An animation is in the state 'stopped' when you used the action 'Stop' or/and when a non looping animation reached the end of frames.

Usually i do not set the walking animations to 'looping'. Because they are set on 'Key is down', a continuous 'every tick' condition.

Key is down (or vectorX =not zero)
__________Set Animation "walk" (from beginning)

When "walk" is not looping, that action will do nothing as long as "walk" is playing, when "walk" is stopped (animation is at the end), that action will restart the animation, effectively looping the animation.

I did not check this on the capx, btw.


I was not aware that the animations worked like that - interesting. I figured that the anim would restart every time it hit the "play animation from beginning" action, regardless of whether it was currently running or stopped. Thanks for enlightening me! :)
B
16
S
7
G
3
Posts: 396
Reputation: 3,700

Post » Tue Jul 18, 2017 8:15 pm

B
33
S
18
G
28
Posts: 2,470
Reputation: 20,904

Post » Wed Jul 19, 2017 8:11 am

I think that's the same file as last time?
B
16
S
7
G
3
Posts: 396
Reputation: 3,700

Next

Return to How do I...?

Who is online

Users browsing this forum: hol87 and 0 guests