I wanted the pipe game to always be possible. What I did here was pretty simple: I made a system that finds a random path. It starts in the top-left corner. From its position, it looks at all the nearby neighbors (up, down, left, right) and randomly picks one that hasn't been visited yet, then sets its new position to that. If it reaches a dead end, it just backtracks (goes back one step) and tries a different direction. It keeps doing that until it reaches the bottom-right corner. While it does this, it keeps track of all the steps it took in an array.
I wanted the option to play daily challenges + seeds. I made the seeds use hex code so the user doesn't have to type a lot. The seed contains the grid size, difficulty, and randomizer value by splitting the bits/bytes of the integer. Rec Room uses a 32-bit signed integer. I didn't feel like messing with the negative bit, so I made the first bit indicate the difficulty: 0 = Hard and 1 = Easy. The next 5 bits I used for the grid size because I wasn't sure how big I wanted the grid to be, so I gave myself a max of 32 (excluding 0). The last bits I used for the randomizer value.
The filling process was the hardest part. To make it fast and avoid using massive amounts of CPU%, I approached it by first creating a data table for the pipes. The data table specifies which adjacent pipes will be filled when a pipe is being filled from the top. Using that data, I rotate it if the pipe is being filled from the sides. To prevent loops, I check whether a pipe is already being filled.
For fast lookup, I use a static-size boolean array of gridSize * gridSize * 2. The *2 is because each pipe can be filled twice due to the cross-pipe mechanic — once from each direction.