MyRobot Development Part 73 - Crowds of Robots!
Added 2025-10-02 01:58:51 +0000 UTCVideo shows the summary, text shows the technical!
This week:
Robot Optimizations
New Controls
Robot Optimizations

Okay so the goal is to have as many robots on screen as possible (minimum of 10) with the best most acceptable framerate (minimum of 60). In came the initial benchmarks: they were TRASH. Since the game was designed around 1 robot, many technical aspects were developed without scaling in mind.
I started with a paltry 3~5 frames per second with 20 robots on screen. So I opened the profiler and started digging into ways to optimize the game.
The biggest bottleneck was the animator which played animations on the skeleton. So I created a distance and directional based LOD system so that the update rate of the animator was slowed down if it was sufficiently far away from the camera or if it wasn't visible. This proved to be big!
Another big refactor was the way the robot detected items. Previously it was a simple sphere collider that represented the robot's eyesight. Everything the sphere touched the robot saw. But because this was relying on Unity's physics, it was extremely expensive for the engine to keep track of all of those trigger collisions because the vision sphere was huge and it was passing through dozens sometimes hundreds of colliders!
So I totally scrapped this system in favor of a cell based random search method. How it works is it searches near-random 1x1x1m cells in its vision every so often to see if there's anything within. This meant that objects themselves now had to "place" themselves into the correct cell if they were moving. This was easily one of the biggest bottlenecks, now solved!
From here on out there were lots of moderate optimizations such as batching objects to render together, culling logic if not within the camera's view, or optimizing away old methods.
Altogether this made the game run at 30fps with 20 robots and 60fps with 10 robots. Great success.
New Controls

So this Multiple Robots update is going to be the last "big" feature for MyRobot and since it's a near-complete paradigm change, the controls for the game had to be reworked.
The biggest pain point for the game thus far was switching between grab, poke, and tool with scroll. This is now gone. In its place is now the MUCH more convenient R key (to select robots), and E key (to interact/poke). That way your cursor is left alone with either itself for grabbing or with a tool to use, much simpler.
Also I added a robot outline so that you can always see your companion.
Next up is adding juicy NPC to NPC animations!
Stay tuned!
Comments
Impressive! Good job!
Pralii~~
2025-10-03 20:07:53 +0000 UTCLove it!!
東尼 南瓜
2025-10-02 03:53:31 +0000 UTC