REQUEST: Curves in collission polygons

Discussion and feedback on Construct 2

Post » Mon Feb 13, 2012 3:25 pm

Hello again


I was wondering if it would be posible to include in future an option of creating curves with the collision polygons?
I believe this could at some points help to avoid using too many polygons in a sprite and would be especialy good for round objects.
B
43
S
9
G
5
Posts: 231
Reputation: 7,291

Post » Mon Feb 13, 2012 3:43 pm

Because of processing performances it can make your game nonviable for the most part of users.
ImageImageImageImageImageImage
B
93
S
19
G
12
Posts: 1,209
Reputation: 18,357

Post » Thu Feb 16, 2012 8:19 am

It would be extremely slow!!

Even when we were making two AAA-titles, an FPS and a TPS for X360 and PC we used geometry primitives (box and capsule mostly) and polygon collision!
Because custom collision(splines or curves and accurate 3D-shape collision) would have required too much CPU resources.mercy2012-02-16 08:20:43
B
25
S
5
G
5
Posts: 138
Reputation: 5,638

Post » Thu Feb 16, 2012 2:02 pm

Wow, a pkunk. Didn't think I'd see one here!

Anyway, yeah, it is much easier for CPU to calculate whether a point is within rectangle/triangle rather than polygonal shape. Imagine the CPU has to do thousands of collision checks every tick.

Best keep it simple.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Thu Feb 16, 2012 9:07 pm

i see...well sorry for the idea then, i guess ill have to avoid round objects ^^;
B
43
S
9
G
5
Posts: 231
Reputation: 7,291

Post » Thu Feb 16, 2012 9:38 pm

Well, you can still check collisions with round objects. First do the classical and efficient rectangular check - if there is a collision, test again with more advanced criteria, e.g. exclude corners and so on. Not as CPU intensive, because it only checks when there is a collision with the bounding rectangle.

For example, you'd first do bounding box collisions, THEN (if there is any collision) do per-pixel checks (which is the MOST intensive).
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Thu Feb 16, 2012 11:28 pm

It would be great if it was possible to create a collision mask combining multiple primitives, this way more complex forms (like circle) would be possible to some extent.

Maybe something like this, where you could place, resize and rotate them at will:

Screen 01
Screen 02
Scirra Employee
B
129
S
45
G
15
Posts: 705
Reputation: 15,413

Post » Thu Feb 16, 2012 11:39 pm

[QUOTE=Animmaniac] It would be great if it was possible to create a collision mask combining multiple primitives, this way more complex forms (like circle) would be possible to some extent.

Maybe something like this, where you could place, resize and rotate them at will:

Screen 01
Screen 02[/QUOTE]

This way you can, simple do a invisible sprite with the same size of the first, pin it on the point position of your main sprite part and check the Family collision ^^TELLES08082012-02-16 23:40:29
ImageImageImageImageImageImage
B
93
S
19
G
12
Posts: 1,209
Reputation: 18,357

Post » Thu Feb 16, 2012 11:39 pm

This. Multiple shape collision would be a great addition. The problem would be not only handling the multiple collision cases between rectangle, polygon and circle, but too many shapes on a sprite would would drop performance. Still a very welcome feature :D
B
58
S
13
G
10
Posts: 632
Reputation: 12,505

Post » Thu Feb 16, 2012 11:41 pm

[QUOTE=Kiyoshi] This. Multiple shape collision would be a great addition. The problem would be not only handling the multiple collision cases between rectangle, polygon and circle, but too many shapes on a sprite would would drop performance. Still a very welcome feature :D[/QUOTE]

As I said, you can, simple do invisible sprites, then pin them on the point where you want that area checked.
ImageImageImageImageImageImage
B
93
S
19
G
12
Posts: 1,209
Reputation: 18,357

Next

Return to Construct 2 General

Who is online

Users browsing this forum: R0J0hound, Zonacas and 2 guests