Portal 2 was one of my greatest childhood memories. A game that had everything I could have wanted. It even got me into coding.
Sometimes, when I'm in a conversation with my non-coder friends, I hear them talk about what they would make if they could code. If only they were able to, if they had time to learn it etc. etc.
And sometimes, just sometimes, they ask me this:
"Yo Cubuzz, how did you get into coding?"
Usually, I then tell them the entire story. But today I'll share it on this blog because it's meaningful to me. It all started with my childhood favourite game, Portal 2.
Portal 2 is one of the masterpieces made by VALVe. It had everything a player could ask for: Interesting riddles, a great story, an awesome gameplay flow, convincing characters, and even community-made levels. It lived up to the high standards I had for games back then. And I spent a lot of time on it. The built-in level editor kept me around to create a few levels, but never something truly innovative and interesting. This all changed when I stumbled across a few demo "test chambers", as the levels are called in-game, which demonstrated to me how there is so much more you're able to do if you think outside the box.
The game itself did not come with any form of logic gates apart from ANDs for triggers. If you wanted to, for example, create a button that once the player would step on it remained active until the test chamber was reset, you'd have to get creative since triggers like this were not built into the game. To have something relatively snappy you'd have to use a disabled cube dispenser (so you'd only have one cube), a light bridge that would be toggled off with the button, and another button below it that would trigger the mechanism you wanted to control. A simple example would look like this:
This was something fascinating to young me. I knew about programming before since we used tools like Scratch in school, but this was something that blew my mind. Figuring out new, creative ways to influence what was around me was something I spent a lot of time with. Over the next few weeks, I spent dozens of hours trying to recreate similar things in other games, for example tinkering with Redstone in Minecraft. And sooner or later I found myself teaching myself to program since I knew I could use this approach to control actual things.
The first project I coded was a really simple bot for my Discord server. It was a basic project written in Ruby using meew0's discordrb library and all it did was respond to basic commands, nothing special. But I had a lot of fun with it and it kept me going and interested in programming. I spent the next months trying to dream bigger and coded apps that I previously thought I could not achieve. Every free minute I spent writing code for my hobby projects. And that's how it went on for months. Eventually, I grew a bit tired of it and shifted my focus towards gaming, but soon enough I realized that code is something that you can't compare to a game. It's something greater, something I am proud of. If you have an idea, you can execute it.
If I had to advise someone that is considering learning to code, it is: Do it. Coding is one of the few skills you could consider essential nowadays. It allows you to make your dreams come true. It's an engine for everything. Code might not be magical, but it's the closest we can get to it.