The full story of the one-letter bug that broke the AI in Aliens: Colonial Marines

The discovery that the woefully inept AI in Aliens: Colonial Marines was mostly down to a one-letter bug was big news to in July, being covered on Kotaku, Rock Paper Shotgun and numerous other mainstream gaming sites. I reported about the glitch for PCGamesN back in April, but James Dickinson (aka TemplarGFX), the chap who has spent the last three years fixing Aliens: Colonial Marines, originally posted about the bug last year. Here’s what he said:

Inside your games config file (My DocumentMy GamesAliens Colonial MarinesPecanGameConfigPecanEngine.ini) is the following line of code :

ClassRemapping=PecanGame.PecanSeqAct_AttachXenoToTether -> PecanGame.PecanSeqAct_AttachPawnToTeather

Im sure you’ll notice the spelling mistake

ClassRemapping=PecanGame.PecanSeqAct_AttachXenoToTether -> PecanGame.PecanSeqAct_AttachPawnToTether

If you fix it to look like the above and then play the game, the difference is pretty crazy!

Why is this line important? There are two reasons :

1) AttachXenoToTether doesn’t do anything. Its basically empty or stripped

2) AttachPawnToTether does ALOT. It controls tactical position adjustment, patrolling and target zoning

When a Xeno is spawned, it is attached to a zone tether. This zone tells the Xeno what area is its fighting space and where different exits are. In Combat, a Xeno will be forced to switch to a new tether (such as one behind you) so as to flank, or disperse so they aren’t so grouped up etc. (*disclaimer* this is inferred opinion, I cant see the actual code only bits)

Whenever the game tried to do this, nothing happened. Now it does!

I caught up with James over email to find out more about this tiny mistake with huge implications, and he was kind enough to answer a few questions.

How exactly did you discover the AI bug?

Aliens: Colonial Marines is a game built using Unreal Engine, and like all Unreal games it has several configuration files that come with the game that tell the engine how the game the developer built works. They are similar across all games with both standard and custom sections within each file. Countless players including myself went through these files over and over and never once realized the typo was there and its significance for years.

I was actually re-doing my mod’s customization to the INI files from the originals to try and fix a crash my mod has, and it was while I was comparing the files line by the line that I really noticed the typo. Because of all the changes I had already made to the game and the AI with my mod, I knew exactly what the line did, and the consequences of the typo.

How much of a difference does the one-letter change make?

I think it would be easier to try and explain how the AI works and where the typo comes into play. Please keep in mind this is somewhat inferred opinion from years of modding Aliens: Colonial Marines, I have never seen the actual code itself.

The xeno AI works on states and rules. The AI will be in a particular state, and it will have to act according to an active set of rules. From the state and the rules, along with the individual information about any one particular AI, flags are added to the AI actor defining its personal state (things like is it crouched, on a wall, in combat, retreating, hurt, etc).

Inside each state is a set of rules or actions that can be met or triggered by things in the game world that cause the AI to change its state or modify its flags.

Most of these states have nothing to do with the tether system, and therefore most of the time the bug has no effect on the behavior of the AI, they will be executing ‘actions’ from their state that all occur in the immediate area (hiding behind a box, jumping onto a wall, attacking a soldier, hissing, standing up, crouching etc etc).

Where the tether system does come into play is mainly in these scenarios:

  • Repathing – Either they cannot find a path to their target, or their target is no longer inside their zone.
  • Crowding – If too many xenos are in one zone, they will call the repath function to help spread them out and move about.
  • Retreating – When they take a certain amount of damage, they will retreat or go into stalker mode, both called repathing.
  • Stalking – When a xeno is not attacking but actively engaging you, they stalk. This means moving outside of your zone and requires tethering to work.
  • Gang Bang Scenarios – Xenos choose a target and that target info goes to a hive mind. This mind keeps track of how many xenos are attacking a target and adds the flag ‘gang bang’ to the target if too many xenos are already after it. This calls repathing or stalking or retreating if possible, and simply waits if not.

The Gang Bang scenario is the most common and most obvious change that the fix makes, and is why some people feel the game is so different while others don’t see it.

Pretend three xenos are attacking you. Alongside you is O’Neil and three are also attacking him. There are, however, 12 xenos in play right now. Six of them are not allowed to attack you or O’Neil as both are ‘Gang Banged’ right now. First they try and stalk, which fails due to tethering not changing (there is nowhere to stalk from in their point of view), so they try and retreat. Again there is nowhere to retreat, so they displace (this is a non-path-based movement to spread them out and hopefully fix the pathing issue by moving them). Let’s say the six are grouped together so the xeno in the middle cannot displace. He has only one option left. Wait. Stand still and try again. With the fix, stalking is now possible, as is retreating. Now the AI can do more than just displace or stand still.

Other situations in which it becomes obvious include any large open area that you traverse (any outside scene, internal scenes where you move through lots of corridors), as the xenos need to update their tether point to follow you without you seeing. They can always follow you with direct line of sight without needing a tether change, but once you lose them they are screwed. When they lose you, they will return to the area they are tethered to, rather than popping up again in your new area.

This also means that it is not a one-stop fix for Aliens: Colonial Marines. Fans of the game, and people who play the entire campaign, will definitely see a great improvement to gameplay, especially in some of the later levels where things are less scripted and more open.

The multiplayer mode Bug Hunt is definitely the biggest winner when it comes to fixing the typo. Whereas a lot of the single-player game is based on scripted events and controlled scenarios, Bug Hunt is entirely dynamic AI over huge maps with many tether points and zones.

Have you told the developers about the bug, and what did they say?

I submitted a support request to Gearbox but never heard back. I never really expected a response anyway as the game had been abandoned for a few years by 2017.

Have you come across any similar bugs in Aliens?

Nothing quite as newsworthy as the typo; however, I do believe that a lot of the odd design choices in the AI were actually a result of trying to get around this bug. For example, sections of the AI that require tethering are disabled, and they work once the fix is in place and you enable them.

Really the game suffers mostly from bad design. Its a simple Call of Duty clone with an Aliens veneer, and the fast-paced, blinged-out approach doesn’t fit Aliens. Xenomorphs don’t really lend themselves well to run-and-gun gameplay, and they were nerfed quite a lot to give it that sort of flow.

Finally, what made you want to ‘fix’ Aliens, and how is it coming along?

I am a HUGE Aliens fan (no suprise there) and I followed this game very closely. Like everyone else I was quite disappointed when the game came out, comparing it to the [preview] footage we were shown. However, I saw the potential in it.  The level design, weapon design, overall aesthetic and feel was spot on. It’s just the game sucked.

What first began as trying to improve the graphics led eventually to poking around in the files themselves, looking at how everything is configured and set up. Immediately I noticed things that, to me, didn’t seem to make sense. Restrictions and strange values, or disabled features. So I started playing with them. Three years later, ACM Overhaul is what came of that!

Unfortunately there are no real modding tools for Aliens: Colonial Marines, so I am using UE Explorer, which allows you to view some information stored in the game’s compiled files, and a hex editor to make changes to that information. It’s very slow and time consuming, as well as limiting. Unfortunately there is not much else that can be done with just these tools alone, other than further balancing and tweaking.

How long do you think it will be before your overhaul of Aliens is finished? Or will there be an end?

I don’t think I will ever be ‘finished’. It is a very tough game to mod that requires an inordinate amount of time to make any changes. It is quite frustrating to work with, so I head back in every now and then and see what else I can do. Like I said earlier, there is not much more that can actually be achieved through modding, but what has been done can still be tweaked a lot.