Week 5 – System Rehabilitation

This week was mostly about turning abstract one line ideas into concrete systems that do something, and play together nicely. The systems aren’t talking to each other, but that’s kind of the point.

Where I’m at

I’ve got the core systems loaded in to the conveyor game, and more or less working, and I’ve started looking into Unity’s UI Toolkit to start adding some extra interactivity to the game.

What I Planned

My plan for the week was simply to continue the third prototype. This primarily consisted of developing the systems to get the gameplay loop in place, so I could revise whether the new direction would make for a viable game. I didn’t expect to have the prototype complete by the end of the week, but I was expecting to see good progress in that direction.

What Actually Happened

As with the previous prototype, my approach with this one was to develop small systems that each do their own little thing, keeping behaviours (semi-)modular and decoupled.

As an example, there’s a system that packs crates on a packing station. Another one will take completed crates and place them on the conveyor system. A third will determine the route to the delivery bay, while the fourth actually plans the next step. None of these systems explicitly know about each other. The routing wouldn’t work without the crate on the conveyor, but it doesn’t know about that process itself.

I’m a bit out of practise with this way of thinking, so it took me most of the week to get these parts put into place. I deliberately tried to avoid going over the same system multiple times, instead moving onto the next once one was done ‘good enough’ for now. (I even wrote down “make it bad, then make it good” to try and remind myself)

“pack crates” sounds simple until you have to put that into code that doesn’t know what “pack” or “crates” means

By Thursday, the systems were done! Sure, they’re a little fragile and break sometimes, but for now, it’s time to focus on the next part. Having the player select and schedule contracts is a core part of the new gameplay loop and I need to get this in there early, so that I can test the prototype’s hypothesis.

Unity has developed a new UI system since the last time I was around, and, from my searching, other people don’t seem to like it that much. But many of the features that older videos said were missing have now been implemented. As far as I can tell, this new UI system looks like a winner (plus, I have more recent experience with web development, which no doubt helps a lot)

With the help of a few video tutorials and Unity’s own e-book on the subject, I think I have a reasonable grasp on the general concept at the moment. The rest, I think, I’ll need to figure out by doing.

What Went Wrong

As ever, the biggest issues were trying to wrap my head around the logic for each system to work effectively independently from each other, and trying not to overcomplicate things by refactoring again and again. I don’t think I did too bad with rewriting, but there is of course room for improvement.

I had to keep reminding myself that there’s no point making the code work perfect, if the game never sees the light of day, it won’t make a difference anyway.

What Went Right

Well, I got a working gameplay loop! Or, at least most of one. Sure, it’s a bit buggy but it (mostly) works – certainly well enough to decide if the game itself can work. But having redefined the core concept of the game (again), a little over a week and a half ago, I’m thrilled with the progress towards the new goal.

Keeping relatively strict with having small systems definitely helped narrow my focus when working on each one. Without that, I think I might still be tangled up in a mess of code and definitely wouldn’t be where I’m at now.

What Next?

You may have guessed it already – continue developing the UI! I’m hoping to get a somewhat primitive contract selection screen, and a way to schedule contracts into delivery slots done next week. Once those two parts are complete, that could well be the core loop defined (or I’ll discover that it still needs further tweaking – we’ll see!)