unity

Happy 2023!

Took a short break from writing to do something different.

Aside from ingesting large amounts of festive treats, I started to learn a little about developing games, especially about game engines.

I started my journey with Godot open sourced game engine. Simple, easy to learn and lots of fun. I abandoned it when I realised it doesn’t support Metal for iOS. Whatever I make will have to run on the iPad. Otherwise, what’s the point?

This is where I got to with Godot: player moving around the screen with keyboard input to eat food. Each bite gives a movement boost.

If not Godot then what? Unity. I watched a great beginners tutorial and I was off! There’s a lot of resources out there for Unity.

Having learned Godot, things made sense. It seems that all game engines have some form of a scene holding a tree of objects to represent what is happening on screen. Object Oriented Programming (OOP) makes way more sense inside a game project. Oh yes, I got used to the really weird C# standard of `CapitalisedCamelCase()` method names.

This is where I got to with Unity in a couple of weeks: a scene with a player moved with keyboard input, some NPCs moving randomly within bounds, some food that can be consumed by the player. Neat.

Replicated player eating food in Unity (basic “collision detection”). Also learned to dynamically spawn new objects on a timer.

NPCs moving around the screen at random. Super exciting!

Unity editor

Wired up my NPCs so they move in a random direction within the green bounding box. They slowdown outside these bounds, to turn back towards the green box, never crossing the red box.

As you can see, I got into it. It was a lot of fun to learn. I’m burning a lot of hours thinking about my little game. Programming for games also felt like “real coding”. Sometimes you forget these fun aspects of coding after writing enough JSX, GraphQL schema or simple adapter code over and over.

I will resume regular writing from next week. Best of luck in 2023!