Games

Lawyer Guy : Tetrahedron Alley

Note: this article is the postmortem for a Lawyer Guy level. To download the level itself, head on over to the Lawyer Guy website!


In the previous two Lawyer Guy levels, I hadn’t paid much attention to the pacing/length of the level, or the difficulty. For level 3, these factors would become my main priority. In the two years between this level and level 2, I’d been continually writing ideas in my Lawyer Guy notebook, and the overabundance of ideas I had arguably led to the level becoming too long. Still, its length necessitated the inclusion of a (planned) checkpoint mechanic and several much-needed quality-of-life features, which I’ll be discussing in this post.

Finding a level theme

In my doodles, I’d envisaged this level having three sections – one with moving platforms, one with spawning platforms, and one with the conveyor belts and creates returning from level 1. In testing, I found that the platforms, the spawning ones in particular, were a lot more fun to mess around with than I expected. I scrapped the conveyor belts entirely and decided I would shift them to the next level.

Some of the enemies I’d planned ended up not having the synergies I’d thought they would. I designed these electric barrier enemies that fly towards Lawyer Guy, toggling their electric beams on and off. You can shoot them to push them back, which alters the timing of the beam. Unfortunately, these things are a little to hard to tutorialise, and simultaneously, the gameplay involving them ended up being too simplistic. I dropped them from the level and haven’t yet found a good use for them.

I ended up adding two enemies – the Spiky Boy (left) and the Rock-It Ship! (right). I’m very happy with the former. It relentlessly closes in on Lawyer Guy, and you often can’t ignore it or skip it – but the spikes that it releases mean that you have to plan carefully when to shoot it. Combining these with moving platforms means that you have to be able to visualise where the spikes it shoots will end up relative to the platforms, which is really the core of the level. The Rock-It Ship! is a lot less interesting, but it does offer some variety. There are also a few sine-wave bombs in the level, which I probably could have used more of. Because they move in a sine wave pattern, you have to worry about where they’re going to be when you jump from platform to platform – or try and shoot them before they get too close.

Early versions of the level had more content in what is now the first half, but stopped shortly before the introduction of the toggle block. This version of the level contained a few areas that didn’t make it into the final game, because they weren’t fun, didn’t add anything new, and/or didn’t work with the camera system. Check them out!

(The lack of fine-grained control over the camera was eventually enough for me to rework the camera system to include barriers – but that’s a story for another time).

The level had two problems. Not enough content (it was a bit longer then previous levels, but it only really had one mechanic, and two new enemies), and there wasn’t enough shooting. All the enemies died in one hit, and one of them was invincible to bullets. Shooting is fun, and it’s also cathartic. The relentless onslaught of Spiky Boys makes some form of catharsis necessary. So I hurriedly designed this new object, a platform spawner that you have to shoot, and some new sections of the level to go with it. I don’t think it entirely solved the catharsis problem, but it did create a fun change of pace, a small twist on an existing mechanic that recontextualised everything that came before it, so I was pretty happy. This long vertical section is the best part of the level, and probably one of the best things I’ve designed for Lawyer Guy so far.

The other new sections – the toggle block section and the autoscroller section – are both a little bit long. If I were making the level now, I’d trim a bit out from both of them. I’d probably also trim some of the earlier sections of the level, as they’re mostly just the same material being stated in different ways.

The other noteworthy section from this level is this long vertical section. It has some very difficult timing (probably too difficult) but jumping up through the horizontally scrolling platforms presents a fun challenge. I would probably expand this, including some sine wave enemies, and maybe making the timing on the Spiky Boys a little bit easier.

The only other object of note in this level is the toggle block (called the ‘eye block’ at this point in development, due to the inexplicable eye on the front of it). While playing around with these, I realized they had huge synergies with the laser cannons and laser beams found elsewhere in the level. You can toggle them on and off with lasers to create very meaty platform challenges. Another idea in the bank. I decided, deliberately, not to toggle them with lasers in this level, as I’m saving that for later.

Visuals

If you’ve read other articles on this website, you’ll know why this level is made of tetrahedrons. I’d started work on my PhD at this point, and I’d spent a good amount of time making tetrahedral meshes. I guess i couldn’t get them out of my head. However, it ended up tetrahedrons by accident. The design went through several designs, including an underwater theme, and some sort of… evil yellow eye tower palace thing? I settled on an idea eventually. A ‘holographic city’ level, all neon lights on black background.

The problem with this is that the objects in Lawyer Guy are designed to be highly readable on bright, saturated backgrounds. On a black background, you can’t see half the enemies, or bullets, and some in-game objects, because those things are black. Having this background would have required re-drawing a lot of the sprites, and then using this special sprite variant for only this level. Ultimately, I decided it wasn’t worth it.

When I started making Lawyer Guy, I had wanted all the levels to be somewhat grounded in reality. You’re supposedly traversing a big complex owned by an evil corporation. Initially there was an ‘office complex’ level, for example. And yet, the farther I got into it, the more crazy and abstract all the level designs got. There’s something kind of funny about the scales both of space and time implied by all of this, I think. Besides, the weird levels are easier to draw, and I’m better at drawing them.

My one qualm is again with the enemies. My primary concern was that the enemies should be readable and that their designs should convey something about what they do. Therefore, the Spiky Boy is a spiky, uh, thing, with protrusions in 8 directions, signalling that it’ll shoot spikes in 8 directions. The Rock it Ship! is pointy and it tracks you from afar, so it’s easy to tell what directions it’s going to go in, though ideally it should have some kind of animation or state change when you’re close by so that you know it’s about to launch. So, I succeeded in my own goals, but I ended up making dreadfully boring enemies that were just geometric shapes, lacking in personality and charm. I should think of some cute enemy designs. Or, failing that, stick googly eyes on the ones I already have.

The only other thing to have changed, visuals-wise, is the overlay. It now has a more pronounced vignette, less glare, and a more opaque scanline effect. This is partially inspired by the overlay used in the game Maldita Castilla by Locomalito, which is supposed to look like an arcade cabinet. I’ve looked into using shaders to create the same effect, but it never looks very good, in my opinion. If you’re using a shader like that, It’s better to design all the graphics with the shader in mind.

Under the Hood

The most significant under-the-hood change is the fixing of a horrible, horrible bug, in which Lawyer Guy would shoot a toggle block, and the block would play the animation, play the sound, and then… not toggle. It was very infrequent and seemed to be random, but every time it did crop up, it would result in a player death. I spent ages checking the logic for the toggle blocks, but it was all fine. I looked at the bullets, they were also fine. A playtester suggesterd that it might be to do with Lawyer Guy shooting two bullets at once, and sure enough – it was!. Their sprites are directly on top of one another, so it’s easy to miss. The two bullets then hit the toggle block and toggle it twice in quick succession. I never worked out why in god’s name he was shooting two bullets. But I did fix it.

There were some performance-related enhancements as well. Lawyer Guy has a ‘long-range detector’ object, a very large object positioned at Lawyer Guy that determines the radius for distant objects to start doing things (for example, a laser spawner that needs to shoot objects from far offscreen). In previous versions of Lawyer Guy, this was a regular sprite, which meant it had a bitmap graphic. I needed to greatly extend the size of this object in this level, as you often see lasers and ride platforms created tens of thousands of pixels away, and after resizing it, I realized that it now ate up an ungodly amount of memory. So it’s now a one-by-one pixel sprite that’s resized to be thousands of pixels large.

A runtime upgrade in the game engine I’m using (which will not be named) improved the performance and fixed a memory leak that was causing the game to use 30mb more memory every time you die. Unfortunately, that’s it for Windows 98 compatibility. I know, I tried. Still, it’s not too big a loss – I tested the game on my Windows 98 machine (featuring an 800MHz AMD Duron processor) and found that it ran extremely slowly. Lawyer Guy needs at least an early Core 2 processor or AMD equivalent to hit 60fps. It seems pointless, but this game can have 1000-2000 objects spawned at any one time, and although most of them don’t do anything (inert spike blocks, triggers to spawn enemies and such), a single CPU-hungry object will absolutely trash that. That’s foreshadowing.

This level comes with a script to set up Joysticker Pro, a program that binds gamepad inputs to the keyboard. The game engine I’m using, which I’m not naming for a very good reason, has very poor support for modern gamepads, so this is a better solution. But I’ll have to find something better on a permanent basis, as Joysticker Pro is a proprietary program and I can’t bundle it with the game.

Checkpoints, and an impassioned defense of lives

A lot of online game commentators and reviewers don’t like lives systems, saying they’re ‘archaic’ or that they’re ‘a throwback to arcades’ and they aren’t necessary anymore. I don’t agree with this assessment. Continues, lives, and health are all parts, at different resolutions, of a progress system that punishes the player for making too many mistakes. They ask that the player be able to play your game consistently for a certain amount of time. Enough time to reach the next checkpoint, then enough time to finish the level. In games with continue systems, players have to be able to beat the entire game without making too many mistakes, which is definitely a throwback, though.

That’s not to say that games without lives systems don’t work – it depends how the game is designed. It depends how long the levels are, or how difficult the obstacles are, or the level of consistency that the developer requires. A session on one of Lawyer Guy’s levels typically lasts 5-10 minutes, so in losing all of your lives, the most you’ll lose is 10 minutes of progress. Even though a perfect run of a level might be as little as 2 minutes, you’re supposed to play the levels many times. I’m aiming for each level to last 30-60 minutes before you beat it. Games which have much more difficult moment-to-moment gameplay, such as Celeste, might use infinite lives, because in those games, playing without mistakes for as long as 1-2 minutes is quite difficult. Because Lawyer Guy’s levels are not as difficult, and having infinite lives would allow players to beat difficult parts of the game by brute force, which isn’t fun, and which will lead to problems with the difficulty curve later on.

Beyond that, it’s fun to be able to execute an entire level in one clean go. That’s the kind of fun I wanted Lawyer Guy to have. A 10-minute flow state. So lives it is.

That said, there are some aspects of lives-based progression systems which are bad. Losing more than 10 minutes of progress is too much, in my opinion. Lawyer Guy is modeled on Mega Man, but it doesn’t incorporate Mega Man’s lives system. In those games, you start each continue with two lives (counting from zero) and can gain additional lives in levels, up to a maximum of nine. But if you finish a level with less than two lives, you’re not restored a life, so most players will throw themselves in a hole to get back up to two. Alternatively, letting the player end up with nine lives means that players can ‘farm’ lives, which can help to iron out difficulty spikes, but it isn’t fun.

The best games have difficulty curves that are smooth. No sudden upticks, and no sudden downticks. Each challenge should be more difficult than the last one, but not difficult enough to be demotivating. And you can give players options to smooth that curve without making them resort to grinding or farming stuff!

With this in mind, I redesigned the lives system and added checkpoints. You always start with the same number of lives. You can’t bank lives acquired in previous levels. You always start with the same number of checkpoints. You can place down checkpoints wherever you want. Being able to place checkpoints lets players put checkpoints directly before obstacles that they’re struggling with. It also creates an interesting risk/reward system – players can put down a checkpoint now for the safety it offers, or save it for later in the hopes of getting farther into the level. As the player gets better at the game, they stop having trouble with early sections of the level, which frees up more checkpoints for later on. Losing progress is an important part of difficulty design, but placeable checkpoints allow players to spend more time on the parts of the level they’re struggling with, and less time getting back to those parts. So, in addition to being a fun risk/reward mechanic, they smooth the difficulty curve a lot. I’ve only ever seen them in a handful of games. Is this something they teach you not to do in game design university? They are lying to you. Also, don’t go to game design university, it’s a waste of money.

Linux

I love Linux. It runs on every computer I own, bar one – the computer I use for writing music and developing Lawyer Guy (curse you, FL studio!). But Linux didn’t even have a desktop presence when I started making the game (hell, it didn’t even have reliable wifi drivers…). The game engine that must not be named has no support for Linux, only Windows and Mac. However, a few years ago, an open-source runtime alternative called Chowdren appeared, was briefly listed on Github, and then disappeared. It’s now no longer an open-source project, rather it’s a proprietary runtime that you can only get as part of a professional porting service which is strictly out of the hands of hobbyists. I understand that developers gotta eat, but this breaks my heart. Why not leave the community version for people who can compile their own games? I did snag the final version of Chowdren (renamed to Anaconda) they made before it went closed-source, although it’s clearly not quite ready for production.

Already in 2017, there were problems. The github page was gone, documentation was basically nonexistent, and the project had out-of-date dependencies. I had to make a few modifications to get it to run with the latest version of Cython. On the game engine that will not be named side, I had to remove a few features – graphical overlays, bindable controls, pixel fonts, and some of the objects with more complex physics (which are luckily not used in this level). Also, certain kinds of object spawning behaviours, for some reason. So Lawyer Guy does, in fact, run natively on Linux! Being that this is a GPLv3 project, you also get the code in the download, although it’s not in a particularly useful form right now. At some point, I will do a release of Lawyer Guy’s source code with proper documentation and all the art/music removed, but I want to try and finish the game first.

If you’re a Linux user, let me know how the Lawyer Guy On Linux experience goes for you. This version segfaults a lot for me and I can’t work out why. However, because I’m writing this with the benefit of hindsight, I know that future builds of the game for Linux will be a lot more stable. At some point, maybe in the ‘misc’ section on this website, I will publish a guide on how to build games made with the Engine that Must Not Be Named on Linux, and an archive of the Anaconda source. I actually have a virtual machine set up with all the right packages installed so I’ll never have to touch it again, hopefully.

Playtester feedback

I have no idea where I found such wonderful playtesters. Playtesters for this level provided lots of detailed feedback on the level in two separate rounds of playtesting, and helped me fix a lot of bugs, balance a lot of stuff and add quality-of-life features. According to my notes, the bugs were involving the checkpoint hitbox, enemies not despawning properly, and inputs not being eaten during hitstun were fixed. Playtesters reported that they never died to enemies, only to spike pits, so enemies were buffed and some spike pits were removed or toned down. I also implemented some more opinionated changes were made to the level and balance of the game. For example, the time to respawn after dying was halved.

The biggest opinionated change I made was the way losing lives works. In most 2D platformer games, if you lose a life before you hit the first checkpoint, you respawn at the start of the level with N-1 lives. The ideal strategy, then, is to throw yourself in the nearest hole and restart the level with max lives. I had internalised this as the way 2D platformers worked, but I’d never really thought critically about it until a playtester argued thus: why not just refund the life and give players a clean slate? You can get that anyway if you reset the game. Start taking lives away after the first checkpoint is placed, because then you actually have some progress to lose. Don’t take away lives when the player hasn’t made any progress. So that’s the way Lawyer Guy works now. It seems like a small change, but I think small quality-of-life changes are amplified in extremely difficult games.

Menu

Previous Lawyer Guy games had title screens, but not menus. This was also a move motivated by playtester feedback – playtesters wanted options for sound levels, graphics and controls. I decided I would bite the bullet and make a title screen. I think title screens are kind of cursed in amateur game dev. I’ve been making games since I was a kid, and a lot of my old games are just title screens and menus and little else. I held off on making one for Lawyer Guy, perhaps subconsciously.

Perhaps the most-requested option was the option to change how the dash works. Lawyer Guy’s dash is modeled on Mega Man X (I hope you’re beginning to see where I get all my inspiration). When you push the dash button, a timer is set and ticks down every frame. While it’s above zero, you move faster horizontally. If you’re touching the ground when it’s at or below zero, the dash ends. You can also set it to zero by turning around. Playtesters wanted the option to hold the button to perform the dash, and immediately cancel it if the button isn’t being held. I’ve never played a game that controls like this, but apparently plenty of them do. Again, I consider this a quality-of-life\accessibility feature worth implementing, even if I don’t understand it at all. Similarly, you can now turn off the screenshake and CRT filter, which some players will definitely prefer. Screenshake is very satisfying but it can hurt the visual legibility of the game.

I spent a long time on this title screen, making sure the animations looked nice, setting up transitions between screens, drawing the background and so forth. I learned that I can’t draw motorcycles from memory. Lawyer Guy is standing on the motorcycle because I drew it too large, and it’s too small for him to fit his legs around. I left it like this because I thought it was funny, and also because I’m lazy.

It’s important to make a nice-looking title screen and intro for your game. It’ll be the first thing most players see. In my head, I’d always intended for the title screen to contain a Lawyer Guy song and a montage of gameplay, neither of which I have right now. But I’m confident that a Lawyer Guy song will happen.

Closing thoughts

There was a long time between level 2 and 3. But in that time, I was able to form a much better idea of how the level design should work, fix innumerable bugs, and add lots of features. The resulting level is longer, more interesting, and more polished (both gameplay-wise and visually) than either of the previous two levels. And with the title screen and checkpoints, it feels feature-complete, at least in a one-level-at-a-time kinda way. When it comes time to release the complete Lawyer Guy, I’ll be redrafting levels, and the final draft of this one will probably be a bit shorter, have a bit more shooting, and most importantly, the enemies will have googly eyes.

For the next level, I’ll try and get the content out quicker, and focus solely on the level, not bugs or ports or anything. I want to make a combat-focused level featuring a smart(ish) enemy that’s challenging to fight. Should be easy, right?


Last updated August 11, 2020.

Filed under: