The Better ‘Ole Game, and first impressions on Godot having switched from Unity


I am going to start with a caveat. I used to be a programmer – writing very complex systems mainly dealing with the business end of pensions and large-scale data migrations. While I am long retired from that field, I do like to program occasionally – for fun, and mainly because it is a skill that I don’t want to (entirely) loose – however, having spent part of my corporate life being super anal about naming conventions, documentation, and code comments, this is something I no longer have to concern myself (much) with on my amateur game efforts… so I don’t. Secondly, I have learnt enough over the years that in picking up a new package, I can make a pretty good start without having to look at the manual, but I will be the first to admit that I should really read it, and it would be beneficial if I did – but I won’t. I also tend to get bored when my curiosity has piqued – hence why most of my projects up here are in various degrees of unfinished.

Until now, I have been using Unity, which I initially thought was fantastic, but over the years, seeing it first grind to a halt on my ancient Mac (and realising when I upgraded to an M2 Mac that it wasn’t my machine that was the problem) and the recent ill-spirited decisions taken by the company, it is now trash – and bloated trash at that. I have been meaning to give Godot a try for some time now, but didn’t really have a simple project idea to throw into it until now.

 The game is a clone of Simon but based on the First World War cartoon character ‘Old Bill, created by Captain Bairnsfather. Instead of remembering which plastic square has lit up, you have to remember which crater hasn’t been bombed.

As for my first impressions on Godot, on the positive side, I liked that it booted up straight away and I was able to get into the project quickly. It didn’t take too much to figure out the node tree and adding new nodes; I found it pretty intuitive. The same goes for adding in assets. The inspector was okay, but it feels a little cluttered – a minor criticism would be the collapsing menus and having to dig down to the transform settings, which seems a bit counterintuitive – surely they should be at the top?

As for someone who cut their teeth with VB6 Form Designer and Borland Builder, in terms of laying out and managing UI elements, I will say the exact same thing I said about Unity: ‘Come on, is this the best you can do?’

Moving on to the coding editor, I quite like the fact that it is anal about tab spaces, and it has a nice clean layout. I especially liked the visual scroll. As for the syntax, in terms of delimiting (or whatever you kids with your hair gel and tight jeans call it these days) I am not a fan of omitting a closing bracket (or an end), but that is just preference. One thing I did find baffling is the ‘await’ keyword. I understand in earlier versions it was called the more sensible and more universal ‘yield’. To me await and yield are two different functions.

 As for coding the game, the barebones of a Simon game involves creating an empty array:

Generate a random number and plop it into the array

Check user input, see if their choice matches the number in the array.

Move to next stop on the array

Repeat.

Not a lot of coding needed (hence why I thought this would be a good project) and I was able to get the basics working pretty fast and had a – by a long stretch of the word – playable game in the time it takes to drink a cup of coffee.

But there was a problem. It was picking up multiple mouse clicks for each click. No problem, either something daft I had done with the InputEvent, and/or something that can be sorted with a yield – alas, that didn’t sort it, and it wasn’t entirely clear what was happening.

 For the sake of familiarisation, I decided to change the approach. Instead of the random number being generated each turn, at the start of the game, I would generate the entire range. This way I could track the sequence and what had been clicked – or so I thought.

 I then decided to introduce a state engine (which is really overkill) and this, along with a ‘bounce timer’, seemed to finally solve the problem. Bear in mind my caveat at the start, but handling a single mouse click shouldn’t be this much work.

 Overall, I am generally impressed with Godot. I noticed while typing this that there is a recent update, and from reading the release notes, it looks like a lot of work is going on in the background on improvements. But I think I will wait a few more releases before starting a new project. I will, however, in the meantime give this project a bit of a tweak, such as introducing some different game modes – I am particularly keen to introduce a ‘whack-a-poet’ one.

Files

web6.zip Play in browser
24 days ago

Leave a comment

Log in with itch.io to leave a comment.