A few months ago, I had an idea for a hobby project, to rewrite an old game in a modern way, preserving the gist of its gameplay while taking creative liberties with the underlying technology. After some consideration, I decided Grand Theft Auto: Vice City would be a great match for this type of project. Now that I've got some free time, I decided to get to it. This article is the first in the series, documenting my progress.
If you're unfamiliar, GTA: Vice City was a seminal entry in the Grand Theft Auto franchise, it was developed in less than a year following Grand Theft Auto III's earth-shattering success back in 2001. Technologically, they are nearly identical, to the point that the main archive's filename remained gta3.img. But experience-wise, they were night and day. Vice City was the game which made GTA what it is today. III, however successful, was merely setting the scaffolding for it.
You're reading the Motor Vehicle Theft series
Motor Vehicle Theft is a hobby reimplementation project of Grand Theft Auto: Vice City, progress and description of which is documented in the articles of this series.
Next articleDefine "reimplement"
Unlike most of these projects, I'm not interested in making the game playable on other operatings systems or making a replica of the original game where the only benefit is proper functioning on modern high-DPI displays with widescreen resolutions. There are mods for the original game that get you there, more or less. Like any worthy music cover, taking a spin on the original is what makes the whole process fun and worthy of consideration, both for users and developers.

Vice City was a great game in 2002. In 2019, it's... It didn't age well. Here are some of the issues I've identified and intend to change fundamentally:
- Outdated streaming system is woefully incapable of challenging a modern machine.
- The formats used belong in a museum, not to mention how badly they're designed.
- GUI needs replacing given that it is fairly low resolution and not suited for modern displays.
- All the player mechanics are... Not good. They're clunky, clumsy or just plain imprecise.
The streaming system
The distances used for LoD resolution are laughable, traffic/pedestrian generation rules are abysmal, stuff unnecessarily fades into view, city is divided into zones with load barriers. The city geometry is beyond simplistic and, after crunching the numbers, the vertex/triangle count of the city itself (counting every instance) doesn't rival a single modern game character in terms of complexity.
The primary archive containing the majority of the game's textures and models is barely 312 MB. It can be loaded completely into system memory even on the shoddiest smartphone in 2019. And that's pretty much what's going to happen, unlike in the original where the archive is just "target-locked" and permanent storage is called upon way too often unnecessarily.
The formats

Alongside the primary archive and a few exposed common, barebone texture dictionaries and 3D models, a big portion of the game files are plaintext files which range from listing the number of objects defined for the world (their definitions and placements) to weather pattern descriptors via Tommy's fist fighting mechanics (defined in fistfite.dat). The main archive was designed for reading off an optical disc, with wide alignment (2048 B) inducing lots of unnecessary padding. Most consumer machines today don't even have optical disc readers anymore. The following is the "important" format list:
- DIR+IMG is the primary archive format combo. Former is used to index the latter.
- ADF file format is used for radio stations. It is obfuscated (lmao). XOR 0x22.
- DAT "file format", more like a generic extension, is used for general gameplay data.
- IDE file format represents definitions of items that can be placed in the world.
- IPL file format represents the actual placements of items in the game world.
- IFP is the animation format, nothing to write home about.
- SCM is the script format given the game uses a custom scripting engine.
- DFF/TXD/RAW are formats for models, textures and sounds respectively.
Graphical User Interface
Pretty much the only data modifications that will be undertaken by hand in this project. Radio UI needs love especially. One of the strongest aspects of Grand Theft Auto is the licensed music. My intention is to drop the shoddy text-based radio interface in favor of the radio wheel present in Grand Theft Auto V.
The mechanics
While the driving, running, shooting and fighting animations will not be changed as that would entail manual editing of the data of the original game (which is a no-no), the way they're actuated will be changed. Also, their dynamics. In fact, that's a given as even replicating original behavior would require a custom rewrite.
So, where do you even start?

It's not that difficult to pick a starting point, the most important character of every GTA game is the city itself. To this end, one needs to load all the files specifying the map constituent objects, stored in gta_vc.dat and default.dat as plaintext lists of pertinent item definition and placement files. These are all in plaintext and are more or less trivial to parse to find the required model, texture and sound names to index into the primary gta3.img archive as well as secondary .sdt/.raw sound archives. This is done by first parsing the binary gta3.dir which is essentially the directory index of the former. Each entry is 32 bytes long, which makes loading all 6034 entries a breeze. The format is as follows:
struct directory_entry {
std::uint32_t offset;
std::uint32_t size;
char file_name[24];
};
As I mentioned, the IMG format was envisioned in the age when optical discs were the primary source of data for console video games. To this end, the architecture of the format revolved around sectors sized and aligned on a 2048 B (2 KiB) boundary. As you might imagine, this introduces a lot of padding for the 312 MB blob of mesh and texture data. To clean up the mess, I am introducing a unified package format with support for compression and much lower alignment requirements, to coalesce all the disjoint data into a whole.
Helping the player navigate areas by textually marking each area as they pass through them in the corner of the screen.As discussed, IDEs are fairly trivial files which hold a bunch of plaintext entries with unique IDs, model and texture dictionary names alongside various metadata and flags needed by the original Renderware engine. Most of these flags are outdated and unnecessary, except the ones that aren't (hah!). An example of an object (objs) item definition is as follows:
# "objs" defines that we're now parsing objects
objs
# One of many entries
# id, dff model name, texture dictionary, number of subobjects, draw distance and flags
200, ind_land101, pjs, 1, 127, 0
# signifies end of objs section
end
We'll be changing the renderer from the ground up and producing realtime lighting, so many of the flags will be ignored as they were meant for an age past. We'll also be ignoring higher LoDs as, let's face it, even the 0th one is lacking in detail on a modern machine. Draw distance will be completely ignored, too, because even the modest machines can handle everything an engine written in late 1990s can throw at them.
Similarly, item placement files (IPLs) consist of a lot of unnecessary data for a modern reimplementation, the following specification for a single item placement is used:
IDE unique ID, Redundant DFF name, Interior ID, X, Y, Z, ScaleX, ScaleY, ScaleZ, RotationX, RotationY, RotationZ, RotationR
We will be ignoring all the data used for avoiding loading interiors and instead are going to have them treated the same way as anything else, relying on our fast data-oriented culling system to get rid of unnecessary instances when not in view.
More intricate info map zone data file containing information on pedestrian and vehicle spawning, constantly consulted by the main gameplay script. There are also collision and zone files which are relevant for the physics and gameplay systems, latter defining a lot of the rules on where certain pedestrians spawn and at what times, that sort of information. All of this neatly packages up the map, making it rather trivial to get it up and running. The terrain itself is cut up into quadratic meshes and enjoys no special status which further simplifies things wrt a modern game. As for the sky, my intent is to completely ignore everything that defines the horrible gradient skies and instead we'll introduce a sun, atmospheric scattering and neat clouds and link all of them to the time of day / weather system.
A quick look at the GUI redux
We discussed the need to redesign the GUI, both code and design wise, to be more visually appealing and to play well high-DPI displays. What better way to introduce the GUI redux but with a sampling of the radio station selection UI.
This would be a peculiar place to start with if we were tackling any other game, but music has been a staple of the Grand Theft Auto franchise since 2001 in the form of hand-picked soundtrack licenses distributed over a number of fictional radio stations. From Flashback FM to Vladivostok, each game had something for everyone's ears. Vice City is considered to have one of the best soundtracks of all the GTAs with fan favorite stations such as Flash FM, Emotion 98.3, VRock and Fever 105 (Cool like a cucumber and just as useful!).

Contrasting 2013 to 2002...
Before Grand Theft Auto V, going through the available radio stations was a chore as it was arranged in a linear fashion and actuated by spinning the mouse wheel. After two decades of Grand Theft Auto, Rockstar North finally figured out that they can apply the weapon selection wheel approach to choosing radio stations as well. This was the result:
Not much to say here, cool and good.Simple and efficient, not to mention they finally remembered to display the current song name for those who are discovering it for the first time. Which is usually a substantial portion of their audience if "GTA brought me here" comments on YouTube are to be believed. In Vice City, radio stations are just simple text rendered at the top of the screen without any information about the current song playing. You can take a look at it below if it had faded from your memory over the past... Wow, almost two decades.
Just no.User experience here is not great, neither functionally nor aesthetically. On first glance, you have no idea what radio station precedes or succeeds the current one. There is no information about the currently playing song or whether it is stuck on one of those "funny" in-between sections which get old quickly... Well, except for Fever 105 and Emotion 98.3 bits, their hosts are amazing.
...And how I did it
While my initial intent was to just implement the same wheel as seen is Grand Theft Auto V, I felt that would detract from the 80s vibe and the overall aesthetic of Vice City which I'm very fond of. To find a decent compromise, I made a visually pleasing blend of the two. Sequential changing, but a flat circle where you have a choice of two radio stations on each end as well as a glimpse of what is beyond them. The following is what I ended up with:
The redesigned radio station picker GUI for my reimplementation of Vice City.As there are only nine radio stations in Vice City, going through them is slick even with this admittedly form-over-function 80s neon design. Saturation is pretty heavy, but I feel it is in line with the overall cartoony approach to the GTA "3D" Universe of which Vice City was a part of. In essence, the 3D/HD difference is largely in the tone of the game. Since Grand Theft Auto IV, the franchise became a lot more serious in its attempts at social commentary and exploring darker themes with more true-to-life rendering.
Many attempts were made.But I digress! Naturally, that result took a while to arrive at. I knew I wanted to apply a Gaussian convolution to the world behind the radio station UI (activated by holding Q just like in GTA V) to focus the user's eyes on the choices. I also wanted to show metadata regarding the current song playing and to use radio station icons instead of text. On top of all this, I desired to match this with the cyan-pink vibe Vice City has going for it. Above you can see the multitude of steps taken.



