Construct 3 new collisions tags maybe?

Post » Sun Mar 26, 2017 2:24 pm

So I've been using C2 for a few years now, and I've noticed some features missing from the engine. A lot of them have usually a work-around but there is always this one that I stumble upon. There is no collision tags, or collision layers.
In case you don't understand, I am talking about having objects use a tag that makes them ignore collisions with objects using the same tag or objects using a different tag.
For example recently I was trying to make a genetic evolution algorithm in C2, similar to this one https://youtu.be/xcIBoPuNIiw?t=30 and I wanted to have hundreds of Physics object overlapping each other without interacting with each other.

So my question is:
Is there a chance we are going to have Collision Tags available with C3, or maybe Collision with certain layers only?

I think this is the only key feature missing from C2, that I would love to see in C3, and I believe that many would relate to this.
B
9
S
2
Posts: 17
Reputation: 636

Post » Sun Mar 26, 2017 2:58 pm

You can do that already using variables.

Or are you wanting solid behavior filtering?
Image ImageImage
B
169
S
50
G
174
Posts: 8,331
Reputation: 110,806

Post » Sun Mar 26, 2017 4:03 pm

newt wrote:You can do that already using variables.

Or are you wanting solid behavior filtering?


@newt what do you mean by "using variables" ?

Let me give you an example.
I have 100 physics objects and a Ground(immovable physics object).
I separate those objects in two categories, A and B.
I want objects from A to be able to collide with objects from B
I want objects from B to be able to collide with objects from A
I want objects from A and B to be able to collide with the Ground
I want objects from A to not interact with other objects from A
I want objects from B to not interact with other objects from B

How would I do something like that without having a way to filter what objects collide with ?

This is what the Unity engine uses for example
Image
You just have a "Default" tag for all objects and if you want something that does not collide with the default objects, you just make a new tag like "Enemies" and it will only collide with the tags that you want.
B
9
S
2
Posts: 17
Reputation: 636

Post » Sun Mar 26, 2017 4:10 pm

You would use a variable comparison in unison with the "on collision" conditions.

What you are describing is an alteration to the physics behavior, as that is what handles collisions automatically just like the solid behavior.
Image ImageImage
B
169
S
50
G
174
Posts: 8,331
Reputation: 110,806

Post » Sun Mar 26, 2017 4:27 pm

eddynardo wrote:So I've been using C2 for a few years now, and I've noticed some features missing from the engine. A lot of them have usually a work-around but there is always this one that I stumble upon. There is no collision tags, or collision layers.
In case you don't understand, I am talking about having objects use a tag that makes them ignore collisions with objects using the same tag or objects using a different tag.
For example recently I was trying to make a genetic evolution algorithm in C2, similar to this one https://youtu.be/xcIBoPuNIiw?t=30 and I wanted to have hundreds of Physics object overlapping each other without interacting with each other.

So my question is:
Is there a chance we are going to have Collision Tags available with C3, or maybe Collision with certain layers only?

I think this is the only key feature missing from C2, that I would love to see in C3, and I believe that many would relate to this.


Are you using chipmunk physics in C2? Because it has "collision groups" that determine if things collide or not. I use unity as well and this works the same way.

Image

And if you don't use Chipmunk then I strongly recommend it. It is a lot better than the default physics in C2:
behavior-chipmunk-physics_t110815?&hilit=chipmunk
B
55
S
24
G
13
Posts: 767
Reputation: 12,575

Post » Sun Mar 26, 2017 4:58 pm

OMG @Anonnymitet this is what I was talking about. It would be nice if this was already inside C3 without the need to use an addon, also if this could work with collisions from stuff other than Physics objects (like the platform behaviour) it would be so good.

Thanks so much Anonnymitet this saved me :)
B
9
S
2
Posts: 17
Reputation: 636

Post » Sun Mar 26, 2017 7:11 pm

@eddynardo No problem :) Sadly it only works for other chipmunk objects but it makes working with physics a lot easier.

Good luck with your project
B
55
S
24
G
13
Posts: 767
Reputation: 12,575

Post » Sun Mar 26, 2017 8:13 pm

Amazingly, collision filtering using category and mask bits could easily be made available in c2 physics (it's the default inside the Box2d web library that is used by c2 physics) but scirra decided to not incorporate it. I cannot think of one good reason why, because it's already supported in the code (see line 5331 of the physics runtime.js - if you're familiar with box2d you'll see what I mean).
A big fan of JavaScript.
B
74
S
20
G
71
Posts: 2,230
Reputation: 44,892

Post » Sun Mar 26, 2017 9:23 pm

this sort of feature is sorely needed by default.
B
45
S
21
G
65
Posts: 1,118
Reputation: 38,227

Post » Sun Mar 26, 2017 9:54 pm

It does sound very useful. What do you think @Ashley ?
B
135
S
33
G
17
Posts: 1,557
Reputation: 20,717

Next

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest