Learning with C++ and Unreal

C++ — First steps

My first attempts with C++ were kept pretty basic. Having used C# before, I felt confident with core coding logic, but I deliberately kept scope small to learn the differences between C# and C++ and to refresh fundamentals before tackling a larger task.

19/10/2023 — Hello World

The classic starting point. I wrote a simple “Hello World!” using examples from the C++ docs. The immediate differences from C# were using cout instead of Console.WriteLine, and the inclusion of #include <iostream> and using namespace std;. Research clarified that <iostream> provides I/O facilities and std exposes standard types/functions. A straightforward start, but a good warm-up.

24/10/2023 — Messing with functions

I built a small text scene using functions, random numbers, and a for loop. RNG differed from C# and required #include <time.h>, but once understood it felt familiar. I used RNG to give the player a chance to “die” on initiating a duel, just to branch dialogue. The main gotcha was function order—I didn’t realise a function needed to be defined (or prototyped) before its use, which stalled me for a while. I also temporarily called main() in an if branch to restart dialogue—fine for a toy demo, but in a real game I’d add proper input retry trees.

Overall: the logic carried over easily from C#, and most issues were syntax/ordering. Ready to attempt something more complex next.

C++ Game — Simple board game

24/11/2023 — Using vectors to set up a board

I translated my C# array approach into C++ std::vector containers for storing board coordinates. A printBoard function builds the grid with nested loops (rows/columns), so the board is generated automatically at any size—cleaner to render and easier to index for moves and checks.

29/11/2023 — Functions for playing

I added functions to let the player choose X or O and to place moves into the board. Basic input validation avoids bad entries. The computer picks random squares (simple but functional); a smarter AI could react to player moves later. I ran into an invalid-input loop edge case and solved it by restructuring rather than recursively recalling the same function.

03/12/2023 — Win and tie conditions

I implemented win and tie checks. Tie checks scan for any empty squares rather than counting turns, which avoids early termination when input is invalid. The win check loops lines and returns true on three-in-a-row. Using a current player parameter allowed one function to check either player, and the ?: operator kept the call compact.

Starting on Unreal (Blueprints)

26/11/2023 — Creating a multi-shot gun

I began with Unreal Engine, focusing on Blueprints. Modifying the first-person template via tutorial let me map engine concepts to programming logic I already knew. Nodes like ForEach felt analogous to code loops; I used this to fire multiple shots at once. Tutorials helped me understand the ecosystem; next, I aimed to build unaided to deepen learning.

28/11/2023 — Triggering multi-shot (solo)

Working alone, I added a trigger for multi-shot. My knowledge of if statements mapped to Blueprint’s Branch node, driven by a variable tracking the right mouse button. The biggest friction was finding the right nodes among many options, so I mixed research (e.g., “is there an if-statement in Unreal?”) with exploration. I’ll keep expanding with commonly used nodes and push the first-person BP further.

Unreal project — Top-down prototype

After a gap (spent on multiple game jams and practice), I returned using the top-down template and focused only on new concepts I learned rather than recapping everything.

05/05/2024 — Enemies and spawner

I built enemy chase behaviour (detect → pursue). Initially enemies chased forever, so I added a timing/delay so chase ends when the player leaves sight. I also created a spawner that supports multiple enemy types by introducing an enemy class container and random selection for variety.

13/05/2024 — Teleport function

I added a function that teleports the player back to a stored location. Casting to the character Blueprint gave access to a “Location Before” variable. Centralising this in a function kept calls short and reusable across battle transitions.

Reflection — 17/05/2024

Over this year I’ve learned a lot and grown across both C++ and Unreal’s Blueprint scripting. Many principles from prior coding experience carried over, so most friction was syntactic or engine-specific. I missed documenting some stretches (busy with projects), but I focused on logging the most instructive moments. If I could redo the year, I’d manage time better and flesh out more projects to completion. Next year I’ll deepen C++ further—strong fundamentals there pay off in Unreal and in general game programming.