Chains + gears + physics

We were finishing the next game mechanic that pop in our minds right after we played around with the main mechanic – gears+physics.

We started working on chains that could transfer movement from one gear to another at distance. Simple colliders connected with hinges fell from cogs after time. We tried to block them with breakable joints connecting with gears but that just did not feel right and looked clunky. So we tried to block their falling with additional colliders in front and back:

The result was acceptable so we asked our 3d artist to make us 3d models of the chain parts to test it as soon as possible:

Maybe you can’t see above but first, we decided to connect two neighbor chain parts into one so they are not bending everywhere. We initially thought this would be needed because of performance reasons.

One piece of advice at this point: make optimizations at the end! After subdividing all chain parts into separate parts it started to look much better without any significant impact on performance.

The next issue we tried to fix was that the chain did not fit perfectly into the cogs visually but rather move around them. it was because the colliders were just big clunky tapelike mess driven by torque. We tried to move colliders of chain parts more to the outside – it looked better but still visually cogs were going through chain parts.

Then came the eureka moment One of the guys suggested we test what will happen when we don’t use those big clunky box colliders but smaller capsules that fit perfectly with chain parts. The result was great:

Chains fit perfectly with cogs visually and physically. As you can see above – the process of the attaching chain is just very straight forward and satisfactory for the player. Besides that physics simply work:

And what is most important the initial goal of transferring rotation from one gear to another was met:

Conclusion: first make working, perfect model then optimize.