I am very close to finishing a pet system for a commission (for @Mullets), after initially fearing it due to the possible horrible difficulties and barriers that might have arised… but it turned out pretty fine in the end!
(note: the fish model in the video was authored by Snowskateer and the animations were made by me, both being only testing assets)
The pets are simulated and handled entirely locally and are animated with AnimationControllers and Animations. After doing some preliminary testing, I found that it does not lag terribly unless under stressful conditions (of the sort of 70 pets crammed in the same space at the same time), with the major bottleneck being raycasts, both from the humanoid used in the walking pet (even though it has nearly all states disabled) and from other raycasts used to check if their movement targets were sane.
I initially thought on implementing their physics from scratch but that turned out to be unnecessarily complicated, so I instead opted to rely on Roblox APIs such as BodyMovers and Humanoids - overall performance did not suffer too badly from this. This came with associated risks such as their physics parts possibly falling below the death plane, so I had to add more checks to prevent that.
The system also has a scaling module bundled so pets with different “ages” have different sizes. I wish there were official APIs to transform models since there are a lot of classes that need to be handled, each in their own special way, but oh well…
Overall, it was a nice learning experience and the code turned out portable enough that I will be able to use it in my own projects in the future should I need to.