The Grand Theft Auto series has long been celebrated for its immersive world and intricate gameplay. Adding to its allure are iconic cheat codes, which have been a staple of the series.
Recently, Obbe Vermeij, a former developer at Rockstar North, shared some intriguing technical details about the ingenuity that went into creating the cheats for the GTA Trilogy (GTA 3, GTA San Andreas and GTA Vice City), offering fans a unique glimpse into the games' development process.
Vermeij explained the use of hash codes in implementing cheat codes in the GTA series. Instead of storing the cheat phrases in plain text, the developers converted them into numerical hash codes. This method added a layer of security, making it more challenging for hackers to uncover the cheats.
For illustration, Vermeij described a simple algorithm that adds up each character's ASCII value. It gives 983 for "ILOVESCOTLAND," the cheat for rain in GTA 3 on PC. He stressed that the game's actual hash algorithm was more complicated.
So, instead of the game engine simply comparing the game's keypresses to the cheat codes to find out when one should be triggered, which would be very easy for a hacker to uncover, it would instead calculate the hash code for the last several keypresses and then compare those to find a match with a cheat.
However, this technique had an unintended side effect. Since different phrases could hash to the same number, random inputs by players sometimes inadvertently triggered cheats. This phenomenon explains why, upon the discovery of cheats, players would often stumble upon random strings that activated the same cheat effects as the intended "official" phrase.
This is best illustrated in the cheat codes for GTA San Andreas on PC, a title which coincidentally has the most number of different cheat codes in a GTA game to date, and the most number of "alternate" codes. For instance, both "STINGLIKEABEE" and "IAVENJQ" activate Super Punch, or "TURNUPTHEHEAT" and "OSRBLHH" both raise your Wanted Level, in each case because they hash to the same number associated with the relevant cheat.
Vermeij's revelations offer a fascinating perspective on the complexities and unintended consequences of game development. More significantly, they grant fans an especially rare glimpse into the mythical and mysterious practices of Grand Theft Auto's developer, Rockstar Games.








