Additional data in contact_point_response (DEF-1144) (SOLVED)

I believe I’m in my forth-fifth project where I miss the same data in the contact_point_response message.

Many times I build up my gameobject with different collision objects. I would like to be able to identify which of these components that actually are being triggered in a cpr message. I get plenty of info about the other object but nothing about my own.
Let me give some examples:

Case 1:
Fighting game where you have two collisionobjects functioning as hitboxes. One for head and one for body. They are both members of same group but if one of them trigger (head) you might want to double the damage taken.
You might also have another collisionobject with another group but on the hand. Knowing that this one was triggered you will not take damage but give damage to the other player.

Case 2:
Platformer where collision is triggered on static collisionobjects (level).
If upperbody collisionobjects are not triggered but lowerbody is maybe you want to do a cliffhanger (on a corner of a platform) depending on the normal.
If head is triggered you might want to take damage etc.

Feels like the info should be quite close at hand to add it to the message.

7 Likes

Want to lift this question/request again and hear if you have any input on this.

As we are creating a multiplayer game I want to easily put in some AI-behaviour on some bots. So some units will be other players and some will be bots.
As most of the functionality will be the same on both I just wanted to add another script in the gameobject that is the bot behaviour (giving inputs similar to a player). To be able to “scan” the area, I create a new collisionobject that uses a big sphere shape to get info on what other units are near. Use that info to make a valid decision.
Now I want to have this on the same gameobject as the players and just disable it whenever its not a bot.

Once again I cannot determine wether a collision response is triggered by the scanner component or by a collision component or a hitbox component.
The only solution I see now is to create several gameobjects and somehow make them aware of each other. A much more complex way I would say.
Without knowing the architecture of the physicsengine, I cannot imagine it being hard to retrieve the other group as well?

3 Likes

This is a question for @Ragnar_Svensson or maybe @Mathias_Westerdahl. Do you guys have any input on this feature request?

2 Likes

I think this is a perfectly reasonable request. I’ve added a ticket for it.

4 Likes

DEF-1144 was released in Defold 1.2.117. Now you have own_group on contact_point_response, collision_response and trigger_response.

3 Likes

Much appriciated!

1 Like