Development Blog

Where we pretend to know how to code.

Debugging Map Quirks

Published: 2020-05-01

Author: Teddi

These days when we process maps for gamemodes our workflow is fairly efficient. It could always be better in terms of work-flow but it’s far better than the early days of when we processed maps by literally writing code for them. Doing things on a per-map basis over the years has gotten much easier for us given our multitude of systems can just accept input on a per-map basis and in essence we’re rarely duplicating or writing new code and instead are just dropping in some placeholders.

There are certain priorities that we take when sorting out maps and those priorities tend to change depending on whether the map is intended for Deathrun, Surf, Trouble in Terrorist Town and so on. In TTT for example it might be focusing on removing any overpowered bonus areas mappers may have put in for themselves, or purposely and delicately breaking any traitor testers. In Deathrun that might be adding kill-triggers to areas that require some sort of funky requirement for when runners win but are unable to kill death. In Surf this might mean removing weird jail conditions if the map was designed for an older iteration of Surf.

The hardest part about all of this is trying to understand the logic and why a mapper may have done something they’ve done; sometimes we can even end up re-implementing their idea in a slightly saner way so everyone benefits from it! More often than not however it turns out that it was an idea that was scrapped, tested upon and hidden or just completely unfinished and the bonus of surf_ace, a popular surf map is a prime example of this.

Ace is a map that’s pretty quick to finish if you have remotely any Surf experience and many people upon finishing, like to do the bonus as it’s a decent route to play. After an update I did that changed how spawns worked on surf_ace it was reported that suddenly the bonus area could no longer be accessed. A bit unusual but I did some debugging, found what seemed to be a reasonable solution aaaaand -

Something else broke.

In this case “failing” the route wouldn’t send you back to the start which made no sense. It stayed like this for a while until I had time to properly debug what happened - and I knew this all somehow came back to the spawn changes I had made earlier.

To cut down on technical detail the underlying issue was this: under the old spawn system for ace you would spawn in at the default positions the map had for you and then you would be teleported to the first stage accordingly. During this process the mapper had a “trigger” so that when you spawned, a flag was set on you that enabled you to access the bonus (but only one side of it!) and with me changing how spawns worked so you actually “spawned” at the first stage, this trigger was never being hit and so the flag never being set.

Fix: manually set the flags when a player spawns so they can access the bonus areas! Even better fix: Apply both flags so both sides can be accessed!

Yeah for some reason the map by default only lets you in one side even though both are the same route, just mirrored. There’s also no way to gain access to the other side either normally so I’m really not sure what the mapper was going for here other than maybe trying to tie in some sort of points system? There’s a massive set of logic gates and other entities that try to work things out but ultimately never actually seem to work properly.

So to cap it all off - mappers please clean up after yourself once you’re ready to publish. If an idea has failed - that’s okay! It’s better to make sure it can’t be accessed at all than it is to leave it in half-baked.

Historical Posts