I'm creating this project in unity.Karl Sims, the creator of the project, published the paper describing the project. In order to create the 3d creature like in the video, I'm using 3d boxes and BoxColliders. The boxes are connected to each other with a ConfigurableJoint that limits their rotation limit on some axes. The creatures are then trained to learn different behaviors.

In order to create a new creature a tree is defined. A node in the tree includes data about itself like size or rotation limits, and connections to its children. Each connection includes the rotational limit of its children.

Collision is enabled between the nodes.

This system results in many different looking creatures. Some of them can't actually exist. For example, a creature with two nodes that are long boxes connected side to side really closely, but their connection also says one of them needs to be rotated by 90 degrees. This creature will cause colliders to be in one another, which results in a fight between the Colliders pushing the boxes away, and the ConfigurableJoints pulling the boxes to each other. This results in the boxes moving around in an unnatural way. These creatures need to be eliminated.

I'm looking for a way to have as many valid creatures as fast as possible. Currently, I'm still using the same random creature generation method. After that, I add a Validator which that instantiates the creature's body and performs some checks. The validation checks I tried are: 1. See if the creature is not moving 2. See if the colliders overlap with Physics.OverlapBox (I think this didn't work because regular creatures are also colliding and so it eliminated valid creatures) 3. See if there is an unreasonable force acting on the joint, which would indicate an overlap. This seems like the most promising, and I'm still testing it. The thing is that the creature learned to cheat this, during validation they didn't overlap, and when I added their control system (The brain of the creature) they push themselves to overlap. 4. Check for extreme accelerations out of nowhere. Had some success but the creatures adapted to the limit I set.

Currently, I'm leaning towards making the creature will a very small mass, so they don't need to apply a lot of force to move. I think this can help make detecting unreasonable forces easier.

Hopefully, I explained the problem in a manner that enables you to think about solutions. This is less of a code problem, but more of a unity collider and joints problem. I chose to not add code because it's just too much.

Edit: Since I'm using an evolutionary algorithm, at each point in time, there is more than one creature. A regular evolution process is slow, but when a creature breaks the physics, it gains a big lead. Deleting creatures like that helped slow down the takeover of cheating creatures, but did not prevent it.

Many thanks.

  • \$\begingroup\$ In the video, it looks like boxes that are connected by a joint are allowed to interpenetrate without exerting collision resolution impulses on one another. Is that something you can use in your solution, using eg. Physics.IgnoreCollision? \$\endgroup\$ – DMGregory Apr 12 '20 at 17:48
  • \$\begingroup\$ They are connected by a joint at the surface of the boxes, but inside the boxes there are colliders. I have the paper that Karl Sims, the creator of the project, published: drive.google.com/open?id=18KqCJBrkfrN7hVgRITp3M0YTNH5clo4O If there were no colliders the system would likely develop behaviors where the creatures overlap themselves. \$\endgroup\$ – Koby 27 Apr 12 '20 at 18:09
  • \$\begingroup\$ "Connected parts are permitted to interpenetrate but not rotate completely through each other. This is achieved by using adjusted shapes when testing for collisions between connected parts. The shape of the smaller part is clipped halfway back from its point of attachment so it can swing freely until its remote end makes contact." — It sounds like you could replicate this by splitting each limb box into two colliders, and using IgnoreCollision on the pair of halves adjacent to the joint. \$\endgroup\$ – DMGregory Apr 12 '20 at 18:16
  • \$\begingroup\$ Just to make sure we understand each other: Each box has 2 colliders, a collider ignores collision with a connected node if its closer to the joint than the other collider in the box? Two things that bothered me with this method: Firstly, since joints can be connected on each side of a limb box more than 2 colliders are needed. For example, if the joint is in the middle of a side, which collider do you ignore? Secondly, I feel that this system can still be exploited by the algorithm. \$\endgroup\$ – Koby 27 Apr 12 '20 at 19:04
  • \$\begingroup\$ This is literally the solution documented in the paper you're trying to copy, so I don't know what else to offer you if the paper's own solution doesn't meet your needs. \$\endgroup\$ – DMGregory Apr 16 '20 at 20:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.