Category Archives: Game Theory

Perlin-Like Noise


A tricky video this one, as after I filmed the video, I realised it’s not exactly Perlin noise, but I didn’t have time to reshoot.

Sometimes, we want to randomly generate things, but pseudo random number generators are just too random! Perlin developed an algorithm which adds local coherence to noise at different spatial scales, creating clumping and patterned noise. This is considerably more natural in appearance than just white noise, and has many desirable properties such as tesselation, and level of detailing.


First Person Shooter at the Command Prompt – Update


One of my earliest videos was a simple raytracing engine that ran in the command prompt. In fact, here it is:

I felt it was time to give this project a bit more attention, and introduced textures and sprites into the engine. The end result has transformed the look of the engine, and you would be hard pressed to realise this was still done in a regular windows command prompt.


Wavy Lines and Bendy Things


I really like splines. They can add a very natural feel to otherwise rigid environment. Therefore, I think all programmers should have an appreciation of splines.

You never know where you might need them. Graphics is the obvious choice, but then you can also consider UI, trajectories, function approximations, general curves, and plotting.

This video is part 1 where I introduce Catmull-Rom splines. Part 2 will show how to navigate splines in a consistent manner.


Information Is Beautiful


Take a look at this. You don’t need to understand it, for my point to come across, but for now, please just look at it.

In preparation for an upcoming video I’m putting together, the code you see above is all that is required for a fully functional game of Tetris. I wrote it in a way that was readable by an average human (the intention of the video is to introduce some fundamentals), then reduced it until I had to go to bed. There is still scope to reduce it further, but something about it struck me. This handful of characters and digits contains enough information to play a fully functioning game of Tetris. This to me is no different from looking at a strand of DNA knowing that within is encoded all the necessary information to construct people. The characters above contain the definitions for the pieces (Tetronimos), the layout of the board, the rules of the game, animations for lines that disappear, rules for detecting collisions, increasing levels of difficulty, score keeping, user input and control and ultimately displaying it on a computer screen.

Some may argue “Sure, but it needs all the libraries and stuff and an OS to work, which means there’s millions more characters”. I can’t refute this but I propose it does not matter. This humble block of bytes above, is all the information needed within an existing ecosystem to present a fully functioning game of Tetris. DNA on its own doesn’t form life, it still needs an ecosystem to operate within. Likewise, that existing programming ecosystem will not on its own present a game of Tetris, it needs just this extra “blip” of information to make that happen.

At the risk of sounding like a pretentious git, there is a beauty to this. It’s not often that your eyes can perceive the whole of something in programming, but here we are, staring at an imposing rectangle of just about readable C++ code. There is nothing more, nothing hidden; and a programmer can see it is legitimate code, but this arrangement of symbols and characters is all that is required to form a complex, fun and interactive puzzle game, known to quite literally billions of people around the world.

I’ll be uploading the source soon enough, when the video gets finished, but for now, just staring at the image makes me really appreciate information in a new way.


Command Line First Person Shooter Engine


Ahh NesMania, you may remember this project from an earlier post. Well it’s over now, and one of the things I’ll miss is the execellent background noise it added to my programming sessions. I liked the beep-boops and swearing, and frequent no mames. The project came to become a bit of a muse, perhaps watching The Mexican Runner grind relentlessly through one terrible and difficult game after another yet never giving up, was inspiring enough (to me at least) to go on and do programming videos.

Anyway, my latest video recreates the a navigable 3D maze in the terminal. No polygons here, but it is inspired by the Wolfenstein 3D game engine. I think the result is quite pleasing, but it makes me ask the question why this was not the norm back in the day when computer graphics where considered a luxury. It is not a computationally challenging algorithm by any means, and surely those machines back then would have been more than capable at updating the screen fast enough. I’m unaware of any games that operated in this way, and thus it makes me think that simply, nobody had had the idea to do a game engine in this way. That demonstrates just how influential and radical early first person shooters were.

So here is a video demonstrating the engine and discussing how it works.

And here is a link to the code on Github:

And here is the code itself! Have fun!


Open World Games – Could be better…

A few days ago, discussing WoFF with some work colleagues, it became apparent that I had very little faith in modern, so-called “western” RPGs. I’d just written a review about World of Final Fantasy which attacked the nature of open-world gaming in a light-hearted manner but it dawned on me that I meant every word.

It is difficult to argue with the success of some open world franchises, the GTA series is considered legendary. Whilst it may not be to my taste to play, I do believe that GTA4 and GTA5 are perhaps the most complicated and thoroughly well constructed pieces of software to date. The attention to detail is staggering. Someone has to carefully create and correlate hundreds of hours “background noise” such as the entertaining radio channels, the artwork in the posters to the vocal reactions of the NPCs in the street. Not a single line of code here, but this detail is what makes the game immersive. Additionally, its funny, challenging and does “sandbox” the right way – bored of the campaign? Do what you want! It’s OK, go for it! We won’t punish you for your deviance, we may even reward you!

Conversely, open world implemented poorly is downright dull. Perhaps controversially, consider Assassins Creed: Syndicate. I’ve played the first 30 hours or so of this. It started off great, I was being instructed on how to play the game. A contrived scenario was delivered to me to ensure I understood the nuances of what is quite a complex playing mechanic. I was impressed when the end of this scenario opened up the entirety of London as the setting for the rest of the game. At this point the game just went – “There’s our big thing, impressive huh? Right go to that dot on the map” And sadly, it’s all a bit downhill from there. The constrained stealthy missions are fun – I particularly enjoyed infiltrating the hospital to meet Florence Nightingale, but the bulk of the rest of the game is go to the dot. Kill the red dots. Go to the next dot. Cut Scene you wont understand. Go to the next dot. Kill the red dots. Chase the red dot… and so forth. ACs downfall is that its open world is very pretty and expansive, but really lacking any depth. It all looks a bit similar, the characters are “historical celebrities” and so feel unoriginal, the combat is sluggish/too hard/too simple, and sadly you’re left simply filling progress bars whilst being bewildered by a fragmented narrative. And shamefully (tut tut tut) you can pay to fill those progress bars quicker. Naughty given it’s a full price AAA title.

Batman: Arkham City, Arkham Knight, and Arkham Origins are equally large games, but they are bursting with detail. Sure these games too are about filling progress bars, but you don’t realize you’re doing it, and you are generally rewarded for doing so with abilities that allow you to progress, encouraging back tracking and littered with great plot and characters. These games too are about going to the dot on the map and doing something, but they generally engage you. The “predator modes” are polarizing, but present the player with the opportunity to do things their way, set their own goals. Can I kill them all silently? Can I kill them all quickly? Can I kill them using those new moves I unlocked? What will unlock next? Unlocking I suppose is a form of progress bar filling too, but it has much more substance. The “unlock” event is described by some significant change in your status.  A change which has to be planned and crafted, therefore it must be deeper than merely “you now do more damage”, or your “wibble” count is now 100. A design team has envisaged a reward that forms part of the continuing gameplay experience.

Going back to Assassin’s Creed, growing the characters really makes no difference. Even if my number is lower than the target enemy’s, sneaking and silent killing is all it takes. Granted, this is more challenging is crowded areas, but once you find the rhythm, the mission is easy. I don’t like the way they rub numbers in your face either. Everything is percentage this, and level that. I don’t need the game to tell me how far through I am with it. That reminds me its a game, a fleeting experience that will end. You rarely see this is non-open world games. Did Uncharted (any of them) tell you a percentage completed? No it didn’t. In fact Uncharted brilliantly marries together area transitions and modality switches, in such a way as to be invisible to the player. This is because a talented design team has poured much effort into crafting an enjoyable experience.

I think the lesson here is don’t let the player design the game for you. Sadly, this is a sign of things to come. Open world games are great for the production of DLC and the promotion of casual play, which consists of nothing more than a few unrelated mission scripts and a handful of assets. It’s a way the developers can print money. This goes hand-in-hand with creating a game that’s so large and shallow, that you can’t possibly complete it 100% without paying additional fees or dying of boredom. Along with a “we can patch it later, it’s just a script” attitude, open world games are really risking becoming the genre everybody loves to hate. Stop buying this crap. It’s your fault.