Partial cogs & player goal


After adding compound cogs the next thing I wanted to do was create partial cogs. This allows a lot of interesting setups where a cog can be driven in turn by multiple different parent cogs, with the speed and/or direction of the child cog alternating.

I found a lot of cool YouTube videos for inspiration:

I spent a while thinking about how to do this before realising it was possible with minimal changes to the existing code - I just needed to move the hit calculation into the update loop (instead of when cogs are repositioned), and then edit the colliders into semi-circles, or whatever partial shape I want to use.

This was surprisingly effective, and allowed me to start creating some cool systems:


So now the question is, what will the player’s goal be?

Since ditching the falling balls, I’d had a vague idea that the goal would be to create a system that outputs a specific timing and/or rhythm. Ultimately, this could be visualised as a piece of machinery, for example:

  • There are bottles moving along a conveyor belt. You have to setup gears that activate the “capper” at the right moment to cap each bottle. Cap 10 bottles to complete the level.

There could be a lot of variation and complexity layered on top - for example, maybe the bottles don’t come on a uniform beat, but three in quick succession followed by a pause. Or perhaps they need filling rather than capping, so the machine has to activate for a time, then deactivate for a time. Or perhaps there’s a need for the direction to reverse.

All of this should in theory be possible with the system I had. For a quick implementation, I created switches and then activator arms attached to the cogs, and rather than building any machinery for now, I decided to just make a cog and switches that the player could try to match.

Here is an example, with the “target” on the right and the player’s system on the left:


However, it soon became apparent that my system was not precise enough for partial cogs.

If I have a driving cog that’s a half-cog, I expect the cog that it turns to rotate 180 degrees exactly. If it turns a few degrees too few or too many, the difference will build up over time and it will be impossible to make a nice looking machine that can keep running to fill 10 bottles.

Secondly, as I mentioned earlier, I wanted to support the idea of a cog having two or more alternating parents. If these parents get out of sync the system will jam.

I couldn’t say for sure whether this is crucial to the game. At the moment, I still haven’t created specific puzzles - but I have had fun just playing around with the scene, and I still have a strong hunch that these elements can be used to make fun puzzles.

I needed to do some maths.

Leave a comment

Log in with itch.io to leave a comment.