· 14 min read

How Garry's Mod Shaped Me


Many video games today resulted from modding great ones, and Garry’s Mod is no exception, having started as a mod for Half-Life 2. It paved the way for future sandbox games, even if Garry Newman expected it to make about $30,000 at best and it never drew a large number of concurrent players (at least relatively speaking).

Regardless, it grew: by 2021 it had sold more than 20 million copies, showing how a niche title turned into a behemoth. More importantly, it became one of the most influential video games to me.

Flatgrass

Looking back to 2010/2011, it’s remarkable that the simplest gamemode captivated my friends and I when we were really young, especially when measured against today’s games. There’s a map called flatgrass which is stupidly simple, yet it’s the one tied to some of my fondest memories of being in front of a computer.

Creating “race cars” and racing against friends, making funny scenes with ragdolls (something the game was very popular for), spawning in weapons and props to fight friends… all of this made for a great way to pull a kid in, especially considering it also came with countless gamemodes created by the community like Trouble in Terrorist Town (TTT), Prop Hunt, DarkRP and BaseWars. Some of these became or inspired whole games of their own, continuing the cycle.

  • A buggy with thrusters welded to the back, parked on a runway

    A "race car".

  • Driving it.

1 / 2

If you never came across any of the old Garry’s Mod videos, here are a few to remember the internet as it was: The Gmod Idiot Box was a playlist many people still go back to, and kitty0706 made things like Heavy Takes his Driving Test and Team Fabulous 2.

On that overly flat and green map, someone showed up with a cool contraption. Honestly, I couldn’t even tell you what it was. I don’t remember. A cooler car, a self-aiming turret, some machine that moved on its own… I just remember it did something my pile of welded props didn’t. Naturally, as an 11-year-old I asked around about the massive red ERROR models and got vague references to “Wiremod” and “E2”.

Figuring out how to install it turned into a quest, and my first contact with SVN and version control though I had no idea what it was at the time. To me it was a more convoluted way of installing something. Once it was finally installed, digging through the menus presented endless possibilities: things like logic gates, a whole code editor, a suite of sensors and actuators. It exposed a deeper way of playing the game, which I can only describe as leaning much more towards being a creator instead of a user.

  • Expression 2's in-game code editor with a short Hello World script open

    The Expression 2 editor.

1 / 1

Wiremod, and Expression 2 (E2), the scripting language bundled with it, is what introduced me to logic and code. Suddenly, the world grass was my oyster.

Power

For a game to be captivating there has to be motive. Whatever it is, it needs to drive you to keep playing. Some games it is to become a better player, others to find out what happens next. Garry’s Mod is no exception and to young me, I believe it was a mixture, the right mixture.

With Wiremod something presented itself which I can sum up in one word: power. Let me explain.

Suddenly, I felt unchained from the common tools I was accustomed to. I had logic gates and a whole code editor to build a program from scratch to achieve whatever it is I wanted to do, even if I did not fully understand what that entailed. I could tinker with the shrouded complexity of gates and all of the sensors and devices: too many to list, though some of the names alone were enough to see potential. Screens, GPUs, gyroscopes, GPS, target finders, etc.

All of it, programming included, was a skill. And like any other skill, it opened doors and revealed other stubbornly locked doors. But with my blissful and youthful ignorance, I could kick down any door, right?

Much of what I made was purely for fun, but there were certain moments where having this skill resulted in a feeling of safety and control. On PvP servers, where everyone was just fighting each other, I had tools. The motivation naturally grew to build an auto-aiming turret, or have an invisible prop protect me from other players when they were aiming at me. Once I succeeded in building these, absolute euphoria ensued.

Sometimes on sandbox servers, you’d have people who could be quite annoying when you’re just trying to focus on what you’re making. There were these things that we built which we used to call bubbles. Basically you’d place down an E2 chip which would create a massive bubble around it, protecting you, and your things, from anyone who would try to enter through various methods. Then.. the iteration. What about your friends? You might want them with you and sharing the bubble: a whitelist. You’d want your bubble to look cool, since you might be staring at it for a while. So the customization got out of hand.

  • A bubble, from outside.

  • And from inside.

1 / 2

And there were a ton of other gamemodes. As a last example, one was called BaseWars where, as the name implies, you create a base and then fill it with money printers to slowly generate money. This required setting up proper defenses to your base and/or raiding others for that sweet loot. This resulted in fancy security doors, turrets, camera systems, a printer sniffer to find where people were stashing money printers, among many other things.

It wasn’t always a noble kind of power. Sometimes, it was a turret. More importantly, however, the rewards for learning were staggering. That was the drive to keep playing. There were never enough evenings for the ideas in my notebook (how many of those came to fruition is another topic).

Back in the Sandbox

Much of what I made is lost to time and setup changes throughout the years. Regardless, the memories remain which is half of why I’m writing this. I wanted to go back and build a few things to show you what I mean.

Conway’s Game of Life

Odds are you have heard of Conway’s Game of Life, so I will save you the explanation and myself writing every bit of it. Summed up, four rules about how many neighbors a cell has, and out of them come shapes that walk across the screen.

I decided to implement a very rudimentary version of this, running on a 31x31 grid. This is built using E2 drawing to an EGP screen. An EGP screen is based on objects, so you place a box, a line, text, and so forth. It is not based on pixels which is an important distinction. It’s the reason why 961 cells can hit the ceiling and why each generation only has to color the cells that changed.

  • A glider moving across the grid.

  • A pulsar oscillating in place.

  • A random starting grid, at 5x speed.

1 / 3

When I say rudimentary, I mean extremely inefficient. I optimized for how fast I could write it, not how well it ran (you should be used to this by now). There’s a detail I have only hinted towards, and it matters more than it sounds: the chip tells you how expensive it is. When you place it down, the overlay shows a few metrics (source):

  • N ops, M% (H%):
    • N ops: the running average of operations per execution.
    • M%: the ops as a share of the soft quota, aka the per-tick allowance.
    • H%: shows when accumulated ops that are past the soft quota exceed a third of the hard quota.
  • cpu time: Xμs:
    • CPU time: average of how long one execution actually takes in wall-clock terms

Basically, the server sets limits. If your chip does not respect those limits, your chip comes to a halt. More importantly, you have metrics to optimize towards that tell you how inefficient your code is without leaving the game and reading about time and space complexity. The code I wrote here is far from being optimized and I hit those limits plenty of times.

  • The Game of Life grid part-way through being drawn, with the chip overlay reading 690 ops at 7%, 133us of CPU time, and tick quota exceeded

    The chip overlay: 690 ops, 133μs, tick quota exceeded.

1 / 1

These limits shaped the code and were part of the iteration I did on it: building the grid in batches across ticks. In the past, hitting these limits was how I first realized that not all code runs the same, and that efficiency is a variable to keep an eye on. This sort of concept translates really well into real-world programming, and it’s a wonderful thing to start considering early on.

Finally, I had to force myself to stop. Beyond optimization, I wanted menus: pick a seed or draw your own, set the speed, dive into the screen’s resolution to change the grid size, and so on. That’s another evening I did not have. This is scope, and as a kid I had no respect for it. It’s why a lot of projects died half-built: each one was probably nearly finished at some point, but as ambitions grew, the backlog did too.

The Hover Platform

Unlike the Game of Life, this one had no code and I had built it years ago but I also lost it. It was a plate with four thrusters underneath, a rangefinder, a gyroscope and a nest of gates wired together to decide how hard each thruster should push. The goal was for it to keep itself at a certain height above ground and remain level.

  • The platform seen from above, covered in wired-together gates

    The finished system using gates on the platform.

1 / 1

The idea was simple enough: the rangefinder pointed at the floor and measured the distance. Subtracting that from the height I wanted gave me an error value. The rest was just deciding what to do with that error.

The obvious answer was to push harder the bigger the error.

  • The platform overshooting its target height.

  • A subtract gate wired between the rangefinder and the target height

    The subtract gate producing the error value.

1 / 2

It was extremely bouncy. You can see that it rushes to the target height, sails past it and tries to correct itself over and over. So, I iterated.

I needed to know how fast the error was shrinking to push back against it, which would basically brake as the platform reached the desired height. The bouncing stopped. But then it settled slightly too low and stayed there.

  • The platform settling below its target height of 50.

1 / 1

Gravity was winning, and the system was not worried about a small constant error value. So, it was time for a third term, which accumulated the error over time until that gap was closed.

  • The platform holding its target height of 50.

1 / 1

It looked like it was doing its job.

These three things formed a PID controller. How did I find out about it in the past? A friend of mine was making it and I found it interesting, so I added it to the endless list of things I wanted to try. Some communities (in or outside of games) can challenge your own creativity, knowledge and skills, even when all you process at the time is “oh, that looks cool”.

This is all in a physics engine, and I needed to debug altitude correction without external factors ruining it. Knowing how to properly debug an issue is a skill in itself. Isolating the variables and preparing the environment are all things you need to do while making something. Notice how it was magically level and I haven’t mentioned anything that should have tackled that: there’s an option to keep a prop (object) upright. Without it, this happened.

  • The platform tipping over without keep upright.

  • Turning on keep upright on the prop.

1 / 2

It saved me from building the whole thing before I could test the part I actually cared about.

You might also notice something peculiar regarding the orientation: it tips over. Almost like one side is heavier. The plate had weight, and so did every gate, thruster and sensor. The prop itself (gray plate) weighed 15kg. Each gate was 1kg. A straightforward solution is to make the gates and sensors weigh less relative to the prop. I just made the prop weigh 150kg and called it a day.

With altitude correction looking good, I wanted to handle angular forces so it remains level without relying on that option. I placed the gyroscope to get the readings for pitch and roll. That gave me two more error values, and from there it was the same three terms again, twice.

  • Correcting pitch and roll after being tilted.

  • Carrying a player.

  • Carrying a barrel.

  • Following the ground over a drop.

1 / 4

This final iteration was not perfect, but it’s definitely enough to get the point across. Take it over a big enough drop, and the error spikes: it responded by diving too hard, sometimes clipping the edge on the way down, before it settles again. I could’ve kept going: filter the sensor, treat a sudden jump in distance as an outlier, take the ground’s angle into account so it sits parallel to slopes, handle yaw for fun, or turn the whole thing into a hoverboard. That’s scope again.

You can reach a surprising number of concepts using gates alone. A few math ones presented themselves above: derivatives and integrals. Granted, as a kid I did not understand them, but a few years later when learning them in math class, I made the connection. Being able to treat something as a black-box is a skill in itself (abstraction), even if it feels like ignorance. It’s what lets you keep moving.

Where It Led

I was solving problems with things I would later use professionally, even if the problems themselves were invented. I did all of it multiple times a day: researching, debugging, iterating and discussing those solutions. Seeing what other people built pushed me to build more, which meant learning more.

Back when I was starting to learn Expression 2, I was not doing it alone, but with someone from the Netherlands who I’ve been friends with ever since. He’s the one who was building that PID controller, and one of the people on my bubble’s whitelist. I remember struggling with inputs versus outputs while building a Russian roulette game with him. Four players stood at assigned positions around a revolver that spun in the middle. Wherever it stopped, that player got shot.

The owner of the server I was frequently on took me under his wing, or at least that’s what I felt at the time. He explained simple things to me. I remember nothing, but I remember that he did it. It showed me the value of mentorship and having a good (very patient) mentor. He was not the only one who did this; others did it occasionally. I don’t think I ever did the same for anyone, only odd questions here and there, nothing I’d remember. He’s still on my friends list, though we barely talk.

Others would build things that shoved their way to the top of my notebook. That hasn’t changed. While I was building the showcase projects for this post, someone showed up fixing things on their mech.

  • Someone else's mech running and jumping.

  • The same mech, with its weapon.

1 / 2

You’ve probably guessed where this is going. When I was 14, instead of going through regular school, I went to a vocational course focused on coding and computer systems. That path continued through college.

New Beginnings

There are few games I could write a post like this about. Maybe reading this has reminded you of a different game entirely which evoked the same feelings and impacted you in a similar way. Don’t underestimate games. Garry’s Mod, for example, has the reputation of a silly, low-budget physics toy stitched together from other games’ leftovers, with no goal and a lot of ragdolls. None of this is false (maybe the budget). It also had a crap ton of gamemodes, which is why two people can spend a thousand hours in it and describe entirely different games.

Come to think of it, it digitized the playground for me. As a toddler your imagination can act as the sole entertainer, however as you grow older you have to entertain your imagination. Going back to rebuild things reminded me of that feeling.

Even though there is a successor, s&box, which I’ve followed for years, but it’s closer to a game engine than to the game I loved. So even if life got in the way and I stopped having the time and patience for Garry’s Mod, I will keep it installed, and see where that leads me.

It’s been a while since I spent my days and summers in Garry’s Mod, and I wrote this with a heavy feeling of saudade. However many hours I’ve got in it, and however many I’ve got left in it, it’s been a pleasure.