Circular collision masks for non-physics objects?

Discussion and feedback on Construct 2

Post » Sat Jan 28, 2012 12:45 pm

I recently changed the 'engine' of my game from Physics to platformer.
However I have been severely disadvantged due to the fact that there are no circular collision masks for non-physics objects, something I think is a must for a rotary competition.
Would circular collision masks for non-physics objects be possible?

Thanks, sqiddster
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,390

Post » Sun Jan 29, 2012 11:53 am

Hackish way : a Circle Sprite, pinned via the Behavior to the object you want to have a circular collision mask. You then check collisions on that Sprite.
B
33
S
9
G
6
Posts: 709
Reputation: 6,704

Post » Sun Jan 29, 2012 12:01 pm

But if I do that, I still need a computationally expensive collision polygon on the circular sprite!
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,390

Post » Sun Jan 29, 2012 9:19 pm

Circular collision is the easiest to implement and cheapest of all. Thought that C2 had it already ...
B
58
S
13
G
10
Posts: 632
Reputation: 12,505

Post » Sun Jan 29, 2012 10:05 pm

That's good to hear. Hopefully Scirra will implement it soon!
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,390

Post » Tue Feb 07, 2012 9:34 pm

Is this feature difficult or impossible to implement? It would be a thoroughly valuable addition to C2 and I hope that Scirra will consider it.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,390

Post » Tue Feb 07, 2012 9:53 pm

I support your petition and must say that I'm also in need of such feature.

A drop-down in object properties like the physics behavior has, with the options for Collision Polygon, Bounding Box and Circle would be enough. A None option to ignore collision detection would be welcome too.

In the future I think would be better to add collision primitives through the image editor, but for now I would be happy if I could use circular collision in any way.
Scirra Employee
B
129
S
45
G
15
Posts: 705
Reputation: 15,413

Post » Tue Feb 07, 2012 11:34 pm

Since we have such a large amount of feature requests our attitude is typically to implement the minimum necessary and move on to the many other crucial things we need to do, like better supporting mobile. Obviously we could implement circular collisions, but I think there's lots of other stuff that takes priority. I'll add it to the todo list though. When we first added collisions in September there was no physics, no Chrome Web Store, Facebook, PhoneGap or Scirra Arcade output, no Families, and so on... hopefully it's clear to see why we didn't spend ages on one feature when we had so much else to do, and that's still true today.

Using an eight-point octagon should be a good approximation though - or is there something about that which makes it unsatisfactory?
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Tue Feb 07, 2012 11:52 pm

@Ashley, thank you for putting this issue under consideration! It is just a large issue for me as I am making a rotary gravity shifting platform game for the contest, and circular planetoids are central to its gameplay. Since the collision objects are so large, an octagonal collision mask does not cut it.

Hmm, I just came up with an idea... Perhaps I could instead make 'segments' with 3 or 4 points of collision, and they could be rotated around a single point in the editor. I suppose this would be a viable alternative.

Keep working on the important features! I trust your list of priorities completely ;)
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,390

Post » Wed Feb 08, 2012 1:41 pm

For me is because of precision issues that varies depending on the rotation of the object and aggravates through scaling.

I started using the physics behavior and it's circular collision, but since it lacks the feature to disable collisions in runtime I decided to do my own movement through events. Now the problem is not the inability to disable collisions anymore, but the fact that I can't check for circular collisions.

In another project is a different situation. I used the physics behavior with circular collision and test for collisions with other objects to apply forces. The problem is that when you use Is Overlapping or On Collision it checks for collision using the sprite's collision polygon, but in the same time the physics behavior is using circular collision to interact with other objects. This difference between the collision models, where the space the object occupies is different than the check space, generate errors and unexpected movement.

Anyway, just wanted to make you aware of the problems I'm having.
Scirra Employee
B
129
S
45
G
15
Posts: 705
Reputation: 15,413

Next

Return to Construct 2 General

Who is online

Users browsing this forum: blackant and 9 guests