How we are making a remaster of Star Wars Episode I Racer

Star Wars Episode I Racer (SWE1R or SWR) is a 1999 racing video game. Designed to be as portable as possible from its conception, it was released on Windows, N64, GBC, Macintosh, Dreamcast and was later ported to Switch, Playstation 4 and Xbox One. Windows multiplayer uses the IPX protocol (now deprecated), while Mac uses TCP/IP.

The games plays well with a great sense of speed gained by crusing through the levels. It is fast and the controls of the pods are really smooth. There are 25 tracks of varying length and environment. The game's graphics however, are getting dated. The 640 by 480 pixels resolution and the pixelated font can look blurred, and the windowing system is forced in fullscreen mode which can be annoying.

original game screenshot

Screenshot of the original game running in forced fullscreen 640 by 480 pixels


For years, the Star Wars Racer's community was joking about an HD remaster, while slowly making progress understanding the inner workings of the game. Today, the modding community has enough tools and knowledge to be able to deliver tangible graphics improvements, as well as a couple of additionnal features.

This article is about the history and the progress of this project, as well as the people that made it possible. If you are only interested about the results and want to see it with your own eyes, skip ahead to this section. Otherwise, follow along the modding efforts of the community !

In order for you to understand the steps of this journey, we first need a bit of explaining of how the game read and display assets such as 3D models and icons. When running the game, it will load 4 binary blocks for models, sprites, textures and splines (tracks). Each asset is identified with an identifier. If we can change these identifiers or modify how they are used, we can already do some fun stuff.

model swap

Swapping Ben Quadinaros and Sebulba

Most of the early results would be about finding model ids and swapping them. If we can understand the binary blocks, we can do better. By modifying them to put the data we want, we can have some custom models already. Special thanks to Aphex and LightningPirate for their work on this. They are the ones who understand the most about these files and their unique format. This is a good start but we hit some limits when trying to do more ambitious things. Indeed, the game contains a lot of fixed limits for the number of triangles per 3D model, or for the maximum size of textures.

An HD part by LeadPhalanx, inserted in the modelBlock by Aphex's tool

In order to break these limits, we'll have to replace how the game display assets with our own code. This is much simpler said than done, because we need to understand the inner workings of the game very precisely, or it won't work at all.
When I joined the project, some decompilation was already done here and there. By merging bits and pieces from everyone, as well as finding similar code in other LucasArt games of the era (Jedi Knight Dark Forces II and Indiana Jones and the infernal machine), our understanding grew steadily. I was helped in this process by Galeforce that was doing similar work than me for speedrunning tools, and Tilman who was also interested by the graphics part. After much effort in decompilation and reverse engineering of the game, we could finally use our own windowing system and renderer, which already unlocks a resizeable window and a 1080p resolution !

OpenGL renderer in action

Screenshot of the game running in windowed mode 1080p with HD fonts, with a custom OpenGL renderer

How are we going to do HD graphics now ? Increasing the resolution is only the beginning. Now that we have understood the rendering of the game, we can start modifying it to add new features. We are going to replace the function responsible for drawing the objects, get the model Ids for each part and filter the ones we will render with our own code. Like that, the replacement is invisible from the point of view of the game, and we can swap any original game asset with a 3D model of our own. This will bypass the hard-coded limits of the original game for triangles and textures completely, and allow us full control of how to render our own replacement models. When the game tries to render model X, we check if we have a replacement for it, and if that is the case we render it instead. Simple and efficient !

model id render

Each unique color is a model ID we can replace

model id replacement

Replaced Anakin's pod with our own gltf model

Since we control the rendering of these new models, we can even add more modern graphics techniques such as having the environment cast light to the model (IBL for those who are interested) or normal mapping. There are a lot of new possibilities ahead !

Download and use the 3D model replacement mod, with HD fonts.

Here is a download link to the mod. Download the zip file and unzip it in the same directory as your game. You should now have a new dinput.dll and assets/ directory.

Add the gltf or glb files you want to replace in the assets/gltf directory by reading the text file contained in it. Pods need to have three nodes whose name starts with "cockpit", "engineR" and "engineL". Don't hesitate to share your work in the official discord server if you want to make custom pods as well !

Alternatively, download the lego pod replacement pack from here or from discord, and unzip it into the assets/gltf directory. Note that this release only works for the GOG Version of the game.

The use of this mod is as made simple as possible so that anyone can use it. Artists drop their gltf files named properly in the correct folder, and the mod (dinput.dll file), will detect the files and replace the corresponding in-game model.

A showcase of the lego pod replacement pack in action, from DigitalUnity

false_perspective

Work in progress for high definition Bullseye Navior's pod, from LeadPhalanx

Bonus stuff !

Here is a list of some interesting work done by the modding community throughout the years, both technical and artistic. I put them here as a showcase of what the modding community has been doing over the years. Some features are available in annodue, developped by Galeforce, and others you'll have to get yourself from the #modding channel of the official discord server

false_perspective

Did you know this perspective trick for rendering the holotable ?

HD_parts
HD_parts
HD_parts

LeadPhalanx work for HD parts

Alternate backgrounds for the splash screen
Alternate backgrounds for the splash screen
Alternate backgrounds for the splash screen

Gonzalo's alternative backgrounds

Tilman's renderer with collision and trigger rendering

Dynamic IBL rendering done by yours truly

Annodue state saving / rollback and free cam by Galeforce

Annodue quick track and pod selection menu by Galeforce

Of course, there are still some small issues here and there that I'll need to fix (as well as making a Steam Version that doesn't crash on load), but I believe the project is in a good enough state to be used by anyone to have custom pods and parts in Star Wars Racer.

If you are interested about this project, also check annodue, another mod for speedrunners that add new capabilities and menus.

If you want to read about my personal experience doing this project, you can go to this article.