“Insider Rockstar North” was an ill-fated blog by Obbe Vermeij, a developer from the Rockstar North game studio. On this blog, Obbe wrote about many interesting things that took place during the development of the Grand Theft Auto Trilogy (GTA III, GTA Vice City, GTA San Andreas).
The GTA Trilogy is an important reference point for computer games because it was one of the first game franchises to offer unparalleled freedom. Players were able to drive, fly, interact with the city, swim, and do many other things in a huge sandbox. One could easily say that these games were some of the first metaverses.
Obbe seems to have been one of the key people who contributed to this freedom with his mindset, even while there were considerations of minimizing this freedom to make the game less heavy.
Gta1 had 3 cities and we wanted to do the same. There was one particular meeting that I still have nightmares about. In R*N we would usually make the big game decisions with 5 people. We had a meeting where 3 people wanted the cities to be on different maps. This would save memory as the models for the skylines of the cities wouldn't need to be in memory at the same time. Gta1 had 3 cities on different maps. The player would take planes/buses/trains to travel between maps.
I wanted the cities to be on the same map as it is important to be able to drive between cities. Even if this meant we'd have to find some memory elsewhere. The 5th guy wasn't there that day. I wasn't able to convince the others. It was super frustrating as it seemed we were about to make a massive mistake.
The following day we had another meeting. The 5th guy agreed with me and was much more persuasive than me. He talked them round and the cities ended up on the same map. Disaster averted.
Obbe Vermeij
The 3 cities with the country side in between, almost killed the map artists. gtaIII and Vice had maps of 4x4km and even then there was loads of water. The SA map was 6x6 and densily packed.
- Obbe Vermeij
However, it was precisely this freedom that everyone, including myself, relished in the game. Developers and game artists found inspiration in this as well.
We took the code from Vice City as the foundation for SA. Many things were improved but no structural improvements were needed.
R*NY organized another 'research' trip. They hired a bunch of town cars and we drove between Vegas, LA and San Fransisco. The artists took pictures. It was loads of fun.
- Obbe Vermeij
The artists gave me a texture for the moon in III. I placed the moon in the sky, made sure it was visible at night and that it was a reasonable size.
A few days later 4 artists were at my desk asking me to change the size of the moon.
"No problem" I said.
It turned out they couldn't decide what the size of the moon should be. 2 of them wanted it smaller to be more realistic. The other 2 wanted it larger to be more cinematic.
This went on a bit and I suggested to make the size of the moon changeable in the game. This way they could decide in their own time and let me know the conclusion. Since I was working on the sniper rifle, I made it so that the moon toggled through 3 sizes (small, medium, large) as the player sniped it.
The artists never got back to me so I just left it in. It was still there in SA.
- Obbe Vermeij
As the player moves, numerous textures, backgrounds, and 3D models must be loaded. Every asset in a game is loaded from the hard drive to the temporary memory (RAM) and from there it gets drawn by the graphics card and displayed on the monitor. Loading from the hard drive in a video game needs to be continuous, fast, and done smartly, so the player feels free to move without lagging. This method is called streaming, and in such a huge game, developers needed to leverage their ingenuity and employ various techniques and tricks.
For example, from GTA III until GTA San Andreas, the game could manage up to seven different car models around the player simultaneously due to the lack of RAM memory in that era. This meant that during intense situations, like when the police were chasing you and the game had to load police cars and helicopters, the number of pedestrian cars loaded decreased, often to just one or two.
For instance; if the player has a 6 star wanted level, the game would load the fbi car and the helicopter.
There may still be police cars and swat vans around from when the player had a lower wanted level.
If there are any injured pedestrians, the game had to load the ambulance.
Before you know it, the game only has 1 or 2 models left for regular civilian cars.
Even without the wanted level, the game was often forced to load certain car models.
- Obbe Vermeij
As a cherry on top, all those assets had to be loaded using a slow CD-ROM, as this was the storage medium in many consoles at the time.
The major issue with CDs is that data is read as the disc spins. Consider this scenario: if data points are scattered across various locations (e.g., points A, B, and C), accessing them involves traversing back and forth, consuming valuable time during reads.
Their solution was clever; they grouped related data together. By doing so, a single spin could fetch everything needed—from point A to point B and even point C—without constant back-and-forth movements.
We all recall the CD reader’s distinctive whirrs and clicks during these read operations—quite an experience to imagine!
To tackle this, developers devised several street magic :
they designed a sophisticated algorithm for efficient loading and unloading,
they meticulously arranged data on the CD, ensuring that elements closely linked in the 3D game world were also physically close on the CD for simultaneous reading, and
in problematic areas, they fine-tuned details, such as creating inclines or increasing air resistance, to slow down vehicle movement subtly (without the player realizing the reasons behind it).
- Obbe Vermeij
The hardest technical challenge to solve during the development of gta3 was the streaming. Streaming involves loading and un-loading models as the player moves over the map. The streaming was coded by Adam Fowler.
When we started out with gta3 the hope was that the entire map would fit in memory. The map would simply be loaded at the start of the game.
Memory was limited on the PS2 and the artists were forced to reduce the texture sizes and to re-use textures everywhere. This resulted in the city looking bland. They eventually asked Adam whether he could develop a streaming system.
The idea of streaming is to load the map only around the player. As the player moves, the models for nearby models are loaded from the CD into memory and buildings that are now far away are removed.
Streaming is also used for vehicle models, pedestrian models, sound effects, music and scripts but the map posed the greatest difficulty as this involved more data than everything else combined.
Unfortunately the CD was quite slow in loading the models. The loading speed depends on the location of the models on the CD (the track). Models that are close together are loaded quickly but models that are far away are slow. (This is because the CD needs to accelerate/decelerate as the head moves to a different track). This is causing a lot of the sounds coming from the CD drive when playing gta.
Adam spent a lot of time ingenuously moving the models around on the CD. The idea was to place models close together in the CD if they were also close together in the world.
Even after all these optimizations, streaming was still not fast enough. You can literally think of it as a race between the player travelling and the streaming loading the models. At times the player would be too fast and the world just wasn't there yet. These problems seemed to get worse with older CDs.
If we couldn't speed the streaming up any further, we had no option but to slow the player down.
In Portland (first island in gta3) there used to be a big strip running all along the island. This was a worst case scenario. The player could go fast and there were loads of buildings to load. The streaming couldn't cope here. Eventually the artists had to change the layout and basically put a building on top of the strip. The player had to go around which would slow him down allowing the streaming to catch up.
Over time we identified other areas where the streaming was not coping and we would set up zones here. Within these zones we increased the drag (air resistance) on the vehicles a little. Maybe 5 or 10%. It was hardly noticeable but it helped.
- Obbe Vermeij
Another noteworthy aspect to remember is the cheat codes. Interestingly, they were stored as hashes [1], making them challenging to discover. This is why certain cheats have two or three different cheat codes. This phenomenon in computing is known as a hash collision [2], which occurs when two distinct texts result in the same hashed value.
The cheats in the trilogy were activated by simply typing a sequence of characters.
On PC the sequence would be something like
ILOVESCOTLAND to make it rain or
GUNSGUNSGUNS to give the player loads of weapons.
The game remembers the last 20 or so keypresses and every time a new key is pressed, these keypresses are compared with the cheats. If there is a match, the cheat will activate.
The straightforward way of doing this would be to compare the string "ILOVESCOTLAND" with the string of keypresses. This approach would mean that the strings for the cheats would be in memory as readable text. Any hacker could easily find the cheats and they would all be discovered on the day of release.
This is why I used 'hash codes' to store the cheats. A hash code is a number that is calculated from a string. As an example; a simple hash algorithm could add up the ASCII values of each character of the string.
The hash code for ILOVESCOTLAND would be 983.
For GUNSGUNSGUNS it would be 951.
This is just an example. The actual Hash algorithm used is more complicated.
The game would also calculate the Hash code for the last 20 or so keypresses and compare the numbers.
The good news is that it is harder to hack the cheat because the code only stores the number (ie 983) and not the full string (ILOVESCOTLAND). This part worked because the cheats were not hacked. (They were eventually discovered by people trying random input until a cheat happened)
The bad news is that different strings can result in the same hash code.
This is why initially when cheats were discovered people found random strings (ie HDLMAAXOPK) and not the string I had set up (ie ILOVESCOTLAND)
This also meant the cheats triggered more often than I had planned. This caused cheats to sometimes happen unintentionally. This has actually happened during peoples' speed runs. These speed runs had to be aborted as the rules are clear. No cheats.
- Obbe Vermeij
The weather turned up to be a fine-tuned look-up table [3] inside the game.
Every in-game hour, the next weather type is picked from a table. The table is 40 (or maybe 34, can't quite remember) entries long. If it is raining now, it will be raining again in 40 in-game hours.
The visual effects for the weather type will transition over the hour.
For instance:
At 2:00 it would be 100% sunny.
At 2:15 it would be 75% sunny and 25% overcast
At 2:30 it would be 50/50
etc
The table frequently has the same weather type for several hours so the weather isn't always in-flux.
There are script commands to override the weather type. This allows the level designers to force the weather type for a particular mission or cut-scene.
- Obbe Vermeij
All those nice things, couldn’t be done on empty stomach. So the company hired a chef as well for the developers.
For most of the time development was manageable. Certainly less stressful than Vice City. To finish it off a good stretch of crunch was required. The company got a chef to provide a good meal for those working late. That really helped.
On the day of release, stores opened at midnight. It was a cold, rainy night but I went to have a look anyway at one of the big stores in Edinburgh. (Virgin on Princess Street). I didn't expect it to be too busy but there was a line of 50 meters or so. I bumped into 2 artists from the office doing the same thing. We were standing there looking at all these people being so excited. People got their game and hurried straight home to play the game we'd made, all through the night. It was magical.
That's the thing about making games. You're just working away in an office and it's hard to gage the excitement of players out there. Especially before the internet, you just didn't have that feedback.
- Obbe Vermeij
If you really like the story behind the first GTA games, consider checking Renderware engine. This is the game engine they used and the tool to craft such nice games.
Bellow, you will find some resources to feed your curiosity :
- A video from inside the Rockstar North offices while developing early versions of GTA
- A video of how is it to develop a game with Renderware
- Manuals of Renderware (vol.1, vol.2, vol.3) from EA’s GitHub [4]
Links :
- https://en.wikipedia.org/wiki/Hash
- https://en.wikipedia.org/wiki/Hash_collision
- https://en.wikipedia.org/wiki/Lookup_table
- https://github.com/electronicarts/RenderWare3Docs
Read also :
- “Object detection in Grand Theft Auto San Andreas using AI” https://medium.com/predict/object-detection-in-grand-theft-auto-san-andreas-using-ai-f3800eb3ca0c
Comments