Why now?

I’ve wanted try my hand at game development for a long time. I’ve occasionally dipped my toes, trying Unreal, Unity or Godot at one time or another. Often something would pop up that really discouraged me early on:

  • Slow shader compilation and project loading (Unreal, Unity)
  • High effort required to make certain things happen (Godot)
  • Inability to find a learning path that suited me. (Unreal, Godot)

The Decider

In the end, the thing that mattered most was a sensible learning path. A reader may complain that the others were not good reasons to reject any of the engines, and they would likely be right.

  • Unreal’s consistently slow shader compilation was actually solved by going through the long initial wait, and making sure to save one of the new projects at least once, then all subsequent projects load substantially faster.
  • Unity’s slow project loading was actually due to Windows Defender, add an exception and it got significantly faster to load.
  • In Godot it was likely a skill issue.

We all learn differently and finding the right learning mechanism is essential to progress. Ultimately, Unity Learn, despite it’s flaws, offered several clear paths for me, so I’ve chosen that road.

The Big Push

So, using my spare time over the past month, I’ve been churning my way through unit after unit, doing the bonus challenges etc. and it’s been great! It’s remarkably easy to get different things up and running.

Eventually I came to a unit which was very open ended. It was effectively this:

  • Here is a box. It counts things that go inside it, expand on this and turn it into a game.

Well, I recalled a game from the amusements I used to enjoy as a child. I had no idea what it was called then, but turns it out it’s just “Coin Pusher”. The game is prefilled with coins on a tray. An element (or elements) pushes the coins towards the edge. You can drop a coin in and try to place it in such a way that coins are likely to be pushed off the edge.

It seemed plausible to make that in Unity so I just went for it. You can see the final result here: Coin Pusher

What was learned?

A few gotchas that caught me out:

  • Physics scale matters. I tried to make coins a realistic size, but it fell below the project’s physics thresholds. The coins would clip into each other, wouldn’t collide properly and generally looked crap. The simple fix to this was to just scale everything up. Size accuracy is not really important in this, we just want the physics to behave reasonably.
  • A RigidBody will not apply its friction from movement, if it is moved via its Transform only When a coin landed on the pusher element, it would just sit on top without following the pusher, and no amount of fiddling with the coin or the pusher’s friction values helped. The fix instead was to use the RigidBody’s MovePosition() method instead of changing the position via transform.
  • Cylinders require Mesh Colliders A coin is a squat cylinder, so it is not appropriate to use a capsule. It must roll so it a box is out. Could use a wheel collider, but that wouldn’t make much sense. If we just apply a mesh collider with a stock cylinder however, we find that they end up sitting on their edges much more easily that real coins, so I went into Blender and constructed a mesh that should topple over more easily.