GTA developer recreated the driving model from the first game for its 30th anniversary - the prototype works in a browser

News

Recently, the former programmer of the original Grand Theft Auto revisited the iconic game and decided to talk about how it was structured from the inside.

Patrick Kerr wrote a 2D physics simulation over a weekend in late August 1996. Subsequently, this simulation became the core of the transport system in Grand Theft Auto:

It all started with a small wireframe demo written in GFA BASIC on my home Atari ST computer. It was later ported to C for use directly in the game. For the 30th anniversary of this development, I recreated it in JavaScript — in a slightly more beautiful, “remastered” form — so that everyone can look at it or play with it.

Within this simulation, players are offered several modes: “car” (1), the technically simpler “spaceship” or “ship” (2); and “brick” (3). You can set a barrier along the edges of the playing field or make it seamless.

Initially, Patrick says, the simulation somewhat resembled the “brick” mode presented in this simulation. Then he implemented several improvements, and what players can now see in “ship” mode resulted — this version of physics “deliberately resembles the classic 1986 game Thrust.”

After that, Patrick implemented the elements necessary for the simulation to become a little more like the one available in “car” mode.

The system is based on a simple classical simulation of rigid body dynamics in two dimensions. According to Patrick, in those years, such an approach was not yet widespread in games “...although there were notable exceptions. Most in-game vehicles were modeled using basic school-level point physics.”

By this, the developer means the well-known formula F = m * a (force = mass multiplied by acceleration received by a body under the action of force).

The rotational component, Patrick explains, was handled using various “rather dubious ‘crutches’.” The use of full rigid body physics, including torques, allows for more consistent modeling of rotation.

In addition, on top of the basic level, the developer added a vehicle simulation layer based on a “simple, approximate, and technically incorrect” tire behavior model:

Essentially, it was my fairly educated guess. Although I understood that it didn't quite correspond to real physics, for my purposes at the time, it still seemed “good enough.”

The prototype of the “2D Vehicles” driving system from the first Grand Theft Auto can be evaluated at the following link.

Never miss our newsAdd this site to your preferred sources to see us more oftenAdd on Google