Minie DAC/BCC/softbody collision groups

I got a question related DAC.

CS - collision shape

What want achieve:

  • need to make BetterCharacterControl CS collide with terrain/objects in worlds, but not with DAC bone link CS
  • need to make DAC bone link CS collide with terrain/objects in worlds but not with BetterCharacterControl CS
  • make softbody also dont collide with BetterCharacterControl

never needed to use collision groups(leaving it for later optimize), but seems like now need it, but i dont seen it in dac configuration itself, the only code was managed to write is:

    for (PhysicsRigidBody listRigidBody : dac.listRigidBodies()) {
        listRigidBody.setCollisionGroup(PhysicsCollisionObject.COLLISION_GROUP_02);
        listRigidBody.setCollideWithGroups(PhysicsCollisionObject.COLLISION_GROUP_02); 
    }

but it change nothing.

so i also tried add Group 1 for BetterCharacterControl rigid body, but it also change nothing.

When i search wiki for collision group i only found:
https://wiki.jmonkeyengine.org/jme3/advanced/physics_listeners.html#collision-groups

So my question is in general, do DAC support group collisions, if yes, then how can i achieve what i need(using this collision groups)?

Also im not sure if this is related, since i need investigate more, but i were receiving some throttle enqueue Lock related(each second FPS go down by 2x)(in character Test itself it dont - there are no terrain/objects):

1 Like

The code you managed to write looks OK, but of course I can’t see the context in which you used it.

When you say “it change nothing” you leave me wondering what tests you ran and what changes you looked for. Were the physics links 100% dynamic? Did you try dumping the physics space with a PhysicsDumper?

All collision objects support collision groups, and DAC is layered on top of collision objects. So yes, DAC supports collision groups.

That said, I’ve never yet encountered a problem for which collision groups were the best solution. I’m curious why you want many bodies in the same PhysicsSpace, yet not all able to collide with one another.

If you want to toggle between DAC and BCC for the same avatar, you should remove one from the PhysicsSpace before adding the other. That way they can never collide.

just wanted to draw a bigger picture, thats why i explained more than just asking “do DAC collision groups works”.

Since you say it works, i will need investigate why my code did not work.

I’m curious why you want many bodies in the same PhysicsSpace, yet not all able to collide with one another.

For example, player shoot bullet in enemy direction.
The bullet should collide DAC not BCC, but this bullet also should be able to collide with Terrain, same as BCC collide with terrain and DAC too.

so, if player miss, the bullet will collide with terrain or other objects.

also another example:

  • when using IK on hand, hand will go “out of BCC CS” so this hand should collide with Terrain/objects too. (same as BCC, but ofc hand CS cant collide with BCC CS)

Thats why cant do this things just using different PhysicsSpace. Or maybe i dont know something and can i put same CS into 2 collision spaces? i dont think so? thats why i want solve above examples using collision groups.

Why shouldn’t a bullet collide with a BCC?

Collision shapes and collision objects are distinct things. A single collision shape can be shared between many collision objects (and many collision spaces), but a collision object can’t be in more than one collision space at a time.

Why shouldn’t a bullet collide with a BCC?

imagine some game, even popular Counter Strike.

and imagine there are physics based bullets, not “line instant hits”.

You want to hit “head” or “legs” or “torso” or “hands” not BCC.
And when bullet miss, you want it to hit “ground” and cause “some dust particles”.

When bullet will collide with BCC, above will be impossible, because bullet will be unable pass through it. Also cloth physics .
When bullet will not collide BCC, it will also not collide with terrain/etc since this things need to be in same physics space. so above will not work too.
But, when will use physics groups, i thought it will work, because would just mark “what collide with what”

You said collision shape can be shared, but its only shape, i need collision object to be shared, but its impossible, thats why i thought about using collision groups.

Also its not the only one reason. I dont want have this super-giraffe broken thing:

image

Lets assume, will move BCC and Terrain/Objects into another physics space, ok, but then bullet will not hit terrain, cloth/head in this case will also not collide with Terrain/Objects.

If you have different approach, just tell me, but i just explain why want use collision groups.

If you want to precisely distinguish hits from near misses, then BCC is the wrong design choice.

then you say BCC is bad choice when i want to have 999 characters walking on screen and add DAC only to near ones?

so what will be more optimized if not BCC? (for walking character collisions)

all i want is just use BCC in same time as DAC/cloth :smiley: but now we discuss why i need BCC, so i answered, and now you say its wrong design, but imo its good design to have many characters walking on screen and have only near ones use DAC, some kind of physics LOD.

If you still say its wrong design, please tell me optimized way to have 999(many i mean) characters walking on screen (physics based walking) and near ones also use DAC/cloth features.

What i really want is more like below video:

where as you can see, he use BCC kind of walking physics(adjusted with custom code too), while also animation blendings(3.3 anims here) and special ragdolls/IK/features(Minie DAC in this case) and cloth (Minie also).

Also to be able to have many characters, while distant ones, would use only BCC, and only close ones use DAC. While also use some physics groups to optimize listeners.

This topic go far far more than just question “do dac support physics groups”, it changed into general Idea discussion, so let it be :slight_smile:

But back to main topic:

i found reason why physics groups were not working for me(just for DAC):

need to set them BEFORE line

dac.setPhysicsSpace(physicsSpace);

if groups are set AFTER this line, it just dont work.

Good luck with your game, Radek.

did i told something bad?

I said you made a bad choice. You disagreed and told me to let it be.

You solved your own issue, by changing your secret source code. Congratulations!

As far as I’m concerned, this topic is closed.

1 Like

ok, im sorry.

tried explain why this design was needed(since you told its bad without know why do i need it) and share what was my problem(that i needed to ask topic question).

no more tldr(textwalls) then. sorry again :slightly_smiling_face:

Here I was coming to ask the same question or more like how to use BCC for the character movement but use DAC for collisions only to find this, I am building around a game sample that use the old CC for the “hero” and rigid bodies for the enemies because CCs did not collide with each other “at that time” and the size of CC does not adjust the match character orientation…so if u want to use DAC for collision would it make more sense to write a character controller based on it and add the BCC features because as it stands my “bright” idea was to make a very small BCC or have it maintain docking state and try to leave out of collisions except from floors and walls as much as possible, but I can see issues with that if not done correctly.

1 Like

Stephen:

  1. It was kind of you to answer my questions and share your insights.
  2. I appreciate the time and attention you gave me. Thank you!
  3. I’m sorry I ignored your questions.
  4. I see now that I’ve behaved rudely.
  5. I shall strive to treat you (and everyone else in this forum) more politely in the future.
1 Like

Radek:

You’re welcome!

That seems like a sensible approach. If the added features prove generally useful, I may want to add them to Minie!

But note: no matter which PhysicsControl you use, CPU will limit how many physical characters can be simulated in real time.

ok will TRY side note though the DAC example and others at least in the 3.2 git crashes due to missing model assets I have been able to play with the editor through the gradle run script though and get my project connected to the minie otherwise

Which model assets were missing?

As far as I can tell all except puppet even linked jmetestdata and it still crashed

If you build according to the instructions in the README, Gradle should automatically run the apps in the MinieAssets sub-project that create the assets used in MinieExamples.

Build instructions are provided for JMonkeyEngine SDK, Bash, and Window Command Prompt. Which instructions did you follow?

I use eclipse I am in and out so much I never adopted another IDE the git retrieval and gradle build seems to complete with no issue so I am stumped, windows search don’t find them in any minie defined path or at all in some cases, so I don’t know, but followed those instructions are they stored locally or downloaded at run