Any plans to upgrade the collision detection?

Discussion and feedback on Construct 2

Post » Mon Nov 26, 2012 2:30 am

Any chance of getting something like this in C2?

As others have posted in the past, the collision detection for C2 is pretty unreliable. Small objects, fast moving objects, changing window size during game, all cause objects to miss their collision. Other engines such as Box2D and Unity have systems that take into account, so it's disappointing to see C2 relying on the old 'teleport the sprite each frame and hope it hits' method, especially when it's being used on platforms as unreliable as mobile.

Are there any plans on upgrading collisions to C2, or is the collision system seen as finished? I have a few features in my game that would benefit wildly from this. boolean2012-11-26 02:31:49
B
24
S
4
G
1
Posts: 244
Reputation: 3,462

Post » Mon Nov 26, 2012 4:37 am

That would be nice.
B
134
S
65
G
16
Posts: 1,766
Reputation: 19,190

Post » Mon Nov 26, 2012 6:38 am

Ahh raycasting
B
45
S
19
G
10
Posts: 562
Reputation: 9,543

Post » Mon Nov 26, 2012 3:35 pm

You can implement something like this yourself with events, but I guess we need to add Classic's old 'instant hit' or exact-collision bullet behavior feature back to C2.Ashley2012-11-26 15:35:56
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Mon Nov 26, 2012 8:14 pm

[QUOTE=Ashley] You can implement something like this yourself with events[/QUOTE]

R0j0hound suggested something similar a while back using the player position and lerps. It works pretty well, but given a large gap or small enough sprite, unless you increase the loop to a really high level it's still possible the lerp doesn't hit the intended object. Ray casting would fix this issue, but while I was able to get some basic versions of this working in C2 I just can't get the logic working 100%.

[QUOTE=Ashley]but I guess we need to add Classic's old 'instant hit' or exact-collision bullet behavior feature back to C2.[/QUOTE]
That would be fantastic if you could!
B
24
S
4
G
1
Posts: 244
Reputation: 3,462

Post » Mon Nov 26, 2012 11:13 pm

And for more than 4 points collision polygon ?
Is it planned for future ?
B
35
S
16
G
16
Posts: 2,222
Reputation: 16,589

Post » Mon Nov 26, 2012 11:44 pm

[quote]And for more than 4 points collision polygon ?
Is it planned for future ? [/quote]
You can already do this. Right click on one of the points and click "add point".
B
79
S
24
G
54
Posts: 4,747
Reputation: 40,757

Post » Tue Nov 27, 2012 12:50 am

[QUOTE=boolean]R0j0hound suggested something similar a while back using the player position and lerps. It works pretty well, but given a large gap or small enough sprite, unless you increase the loop to a really high level it's still possible the lerp doesn't hit the intended object.[/QUOTE]
I think the right logic is to step the object by its size, rather than by a percentage distance. That will always hit any obstacles in the way, and I think is how Classic did it.

If it's a rectangle, an alternative is just to stretch it in to a line between its start and end points (by settings its width to the distance and its angle to the angle between the points). If that big box touches anything, the object would also collide along the way (although it doesn't tell you where it collided, only if it did, but it's a lot faster than loads of intermediate collision tests).Ashley2012-11-27 00:50:38
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600


Return to Construct 2 General

Who is online

Users browsing this forum: neverk and 16 guests