August 2021 Goals
01 August 2021

# First a review of July:

Break down of time:

• 2.5 hrs of writing (for blog)
• 6.5 hrs of study
• 25.5 hrs of game dev.

I failed to do any just for fun programming :(

I did however get 3500 impressions on my tweeting on Twitter! A massive growth and also a realisation I am doing twitter wrong.

Study was mostly revising linear algebra. Good fun.

So I hit the twitter goal and the game dev goal but not my other ones.

# What went right?

I think the hightlight is the little platform game I am working on. This was originally programmed in Rust but I found myself focussing on Rust too much when I really wanted to focus on Game Development. I rewrote the code in C++ using the RayLib library.

Again to not focus on code I restricted myself to not using the std library of C++. It meant I had to write some replacements but the advantage is I avoid the rabbit holes that dives into the std library can be. Fairly unexpectedly the first object I created that is already in the std library was an optional type, followed by a Memory Arena.

I don't currently think this is costing me much, well actually anything, in productivity. The added bonus of no allocations in the game loop (well at least in my code) is much easier to achieve.

No allocation means most data structures do not managed their own memory. I do not make use of any destructors. Well I guess I use atexit to ensure things are free-ed when the game exits.

This pretty much makes the data structures fairly dump. There are methods attached to them, so I am not using a C style of coding.

Exceptions are not being used. In a game as simple as this they just are not really needed, at least I have not found a reason to use them. Even though I don't like them I am not going out of my way to avoid them, just like basic runtime polymorphism. I will use them if it simplifies the code in an objective, global, way.

I am using Raylib fairly minimally, really just as a hardware abstraction layer. That is I am writing my own little 2D physics system and pretty much everything else. It is good fun focussing on these problems and the simplicity feels refreshing.

A year or two ago I would have attempted this in C. C++ does have some object advantages. Function overloading the is open to extension, Sure _Generic in C allows function overloading but you are constrained defining overloads in one location

Operator overloading is also nice for math things. Again an extension in C gets you a long way but not quite as smoothly.

I won't continue as that should be a subject for a different blog post.

There is an actual work plan so this project is actually more organised than my usual attempts. Perhaps it will raise the chance of actually finishing it in a reasonable time frame.

# What went wrong?

Well nothing really or everything. The feeling of burn out that I mentioned last month probably reared it's head and lowered my productivity as measure in time. I am also training to do a fairly long run. This is eating into my free time like there is not tomorrow. It is fair to say I am/was quite out of shape and there is a 50% chance I won't make it round the course.

Training for a run saps my energy and doesn't leaving me wanting to study stuff in the evening. Hence the lower number of hours spent to that.

2.5 hrs of writing was spent trying to see if I could cover the RefTerm event. It was actually quite hard to do in a way that covered everything I wanted to say. On one hand it feels like a mini Mike Acton at CPPCon on the other hand people talked past each other so much I am not sure it really helped understanding. As the event is receding into the past I am not that motivated to finish the article. Just attempting to write it did encourage me to think fairly deeply (particularly while out running) so time was not wasted, just no tangible thing at the end of it.