This is very cool! I like that you can explore and upgrade your bots. Do you generate each cave and rewards in runtime?
Yup, all the geometry and gems are generated at runtime. (The shop inventory is not though). The number of gems is based on the size of the room, and the value is decided by a perlin noise lookup, meaning that if you start to find higher value gems, it's good to keep digging in that direction, because it is a gradient, and the value may continue to get higher if you keep going.
The room shapes are made by rotating a random amount around a center point and then offsetting by a random distance from the center to create the corners. When the robot digs, it picks a random slope and distance to dig. It then checks if there is an existing room in that direction. If so, it tries to connect to it. Otherwise, it builds a new room. As a failsafe, if it cannot connect to the room or if anything gets in the way, it will just try to go forward with the tunnel until it hits something, and then stops as a dead end.