As of writing this, all the gameplay in “One Drop Bot” is done. When I say gameplay, I mean that all the levels are laid out, and the elements in them work. There are still glitches though, and there’s no sound effects or music. There’s lots of polishing to do, all of which I hope to complete along with the game’s publishing before the end of the year.

My Twitter posts aren’t quite caught up with the progress I’ve made, so I’m only going to go over what I’ve accomplished up to that point. Which actually now that I look at it doesn’t seem like much, but this is an excellent opportunity to talk about the exciting yet frustrating process of creating a logic puzzle.

Before I get into the process of how I made the puzzle, I should explain how it works. As you can see here, it’s a bunch of square structures connected by cords. These square structures are gates and switches. Everyone knows how switches work. Flick one and you can turn the light on in a room. But unless you’re at least somewhat familiar with how circuitry works or maybe redstone in Minecraft, you probably don’t know what a logic gate is. Don’t worry though. Knowing what a logic gate is or isn’t won’t stop anyone from being able to solve the puzzle.

If you’re already familiar with what a logic gate is, then I’d say go ahead and skip this paragraph. If not, then I’ll do my best to keep it simple. Basically, a logic gate takes in one or more inputs and decides based on them what should go out or be the output. An And gate outputs if all inputs are on; an Or gate outputs if there is any one input on; a Xor gate outputs if and only if only one output is on; and finally, a Not gate outputs the opposite of the input.

Creating this puzzle was a puzzle in itself, as is everything in game development. But who would’ve thought it would be the most complex part of the game? (besides the player / camera movement of course)

The hardest part wasn’t necessarily the code though. Because of the modular system of cords running through different gates, the code was pretty simple. What really got me was trying to make this so it would run smoothly even on mobile without any drops in framerate. This is the most complex room in the game, so it was crucial to make sure there weren’t any extra parts slowing down rendering time.

In order to keep things simple, I made it so all the gates share the same two materials. One for the on state and one for the off state. When a gate turns on or off it switches materials. So instead of having 12 different materials for the logic gates, there are only two.

This also applies to the cords even though they are less complicated than the gates. They come in three varieties: T, L, and I shapes. So having them share a material helps as well.

Example of UV Mapping



In order to do this, the UV maps of these objects have to share the same space, meaning either they have to overlap each other or take up less space on the texture. For the cords, they overlap quite a bit due to their similarity.

I made a modular system for the logic gates. There’s an output side piece, an input side piece, a blank side piece, and a bunch of middle pieces, one for each kind of gate. The UVs were laid out in a way that would save space in order to keep the texture at as low a resolution as possible while still looking clean.

Lastly, I’ll talk about the switch. In order to turn it on or off you have to push it. However, the pushing mechanic that I made doesn’t work on rotating objects, so I was worried about having to go through that complicated process. But I found a workaround that works nicely! Instead of pushing a rotating object, the player pushes an invisible box that clamps to a minimum and maximum distance. The switch then rotates depending on the position of the box, and voila! It’s seamless!

That’s all for now, but in the next week or two, I’ll write about the last area of my game and all the ins and outs of it. I would like to write about it here, but I want to keep these posts focused on one topic at a time.

Thank you for reading! Any thoughts or constructive criticism is greatly appreciated.