{
    "archive_path": "archive/1791669896.612895",
    "base_url": "patkerr.co.uk/2d-vehicles",
    "basename": "",
    "bookmarked_date": "2026-10-10 22:04",
    "canonical": {
        "archive_org_path": "https://web.archive.org/web/patkerr.co.uk/2d-vehicles",
        "dom_path": "output.html",
        "favicon_path": "favicon.ico",
        "git_path": "git/",
        "google_favicon_path": "https://www.google.com/s2/favicons?domain=patkerr.co.uk",
        "headers_path": "headers.json",
        "htmltotext_path": "htmltotext.txt",
        "index_path": "index.html",
        "media_path": "media/",
        "mercury_path": "mercury/content.html",
        "pdf_path": "output.pdf",
        "readability_path": "readability/content.html",
        "screenshot_path": "screenshot.png",
        "singlefile_path": "singlefile.html",
        "warc_path": "warc/",
        "wget_path": "patkerr.co.uk/2d-vehicles/index.html"
    },
    "domain": "patkerr.co.uk",
    "extension": "",
    "hash": "R7PR6HH3PH6QTC67DVMF",
    "history": {
        "archive_org": [],
        "dom": [],
        "favicon": [
            {
                "cmd": [
                    "curl",
                    "--silent",
                    "--location",
                    "--compressed",
                    "--max-time",
                    "120",
                    "--output",
                    "favicon.ico",
                    "--user-agent",
                    "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 ArchiveBox/0.7.4 (+https://github.com/ArchiveBox/ArchiveBox/) curl/curl 8.14.1 (x86_64-pc-linux-gnu)",
                    "https://www.google.com/s2/favicons?domain=patkerr.co.uk"
                ],
                "cmd_version": "curl 8.14.1 (x86_64-pc-linux-gnu)",
                "end_ts": "2026-10-10T22:05:18.402964+00:00",
                "index_texts": null,
                "output": "favicon.ico",
                "pwd": "/data/archive/1791669896.612895",
                "schema": "ArchiveResult",
                "start_ts": "2026-10-10T22:05:17.824804+00:00",
                "status": "succeeded"
            }
        ],
        "git": [],
        "headers": [
            {
                "cmd": [
                    "curl",
                    "--silent",
                    "--location",
                    "--compressed",
                    "--head",
                    "--max-time",
                    "120",
                    "--user-agent",
                    "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 ArchiveBox/0.7.4 (+https://github.com/ArchiveBox/ArchiveBox/) curl/curl 8.14.1 (x86_64-pc-linux-gnu)",
                    "https://patkerr.co.uk/2d-vehicles/"
                ],
                "cmd_version": "curl 8.14.1 (x86_64-pc-linux-gnu)",
                "end_ts": "2026-10-10T22:05:18.810002+00:00",
                "index_texts": null,
                "output": "headers.json",
                "pwd": "/data/archive/1791669896.612895",
                "schema": "ArchiveResult",
                "start_ts": "2026-10-10T22:05:18.412388+00:00",
                "status": "succeeded"
            }
        ],
        "htmltotext": [],
        "media": [],
        "mercury": [
            {
                "cmd": [
                    "/app/node_modules/@postlight/parser/cli.js",
                    "https://patkerr.co.uk/2d-vehicles/"
                ],
                "cmd_version": "1.0.0",
                "end_ts": "2026-10-10T22:05:25.611824+00:00",
                "index_texts": null,
                "output": "mercury",
                "pwd": "/data/archive/1791669896.612895",
                "schema": "ArchiveResult",
                "start_ts": "2026-10-10T22:05:22.236220+00:00",
                "status": "succeeded"
            }
        ],
        "pdf": [],
        "readability": [
            {
                "cmd": [
                    "/app/node_modules/readability-extractor/readability-extractor",
                    "/tmp/tmpw22l6_pv",
                    "https://patkerr.co.uk/2d-vehicles/"
                ],
                "cmd_version": "0.0.11",
                "end_ts": "2026-10-10T22:05:22.226470+00:00",
                "index_texts": [
                    "A project history \u00b7 1996\u20132026\n        2D Vehicles\n\n        \n          \n            \n              One weekend in late August 1996, I wrote a 2D physics simulation which later became\n              the basis of the vehicle system in the eventually popular game \"Grand Theft Auto\" aka\n              \"GTA\".\n            \n            \n              It began as a little wireframe demo written in GFA BASIC on my Atari ST home computer\n              (and was later ported to C for use in the actual game).\n            \n            \n              I have\n              \n                recreated*\n              it here in JavaScript for its 30th anniversary in a slightly prettier, \"remastered\"\n              form, for anyone who is interested in seeing or playing it.\n            \n            Play Motion Lab\n          \n          \n            \n              \n            \n            \n              The 1996 idea, recreated in Motion Lab.\n            \n          \n        \n        \n          Instructions\n          You can play the recreation above, with touch controls if you are on mobile.\n\n          \n            In addition to the default \"Car\" mode (1), you can also select the technically simpler\n            Spaceship aka \"Ship\" (2) and \"Brick\" (3) modes, either via the mode selector in Settings\n            or by pressing the corresponding numbers on your keyboard.\n          \n\n          \n            Collision barriers around the sides of the playfield can be toggled by clicking or\n            pressing \"B\", and \"G\" toggles vertical gravity (which only really makes sense in the\n            Ship and Brick modes).\n          \n\n          \n            Camera controls are provided by \"Z\" and \"X\": \"Z\" toggles what is called the camera's\n            \"dead zone\", which changes how far the vehicle can move before the camera follows it;\n            \"X\" toggles a speed-related zoom feature which pulls the camera back a bit when you are\n            going faster (just like in GTA).\n          \n\n          \n            *(in an entirely non-copyright and non-trademark infringing way, of course)\n          \n\n          \n            \n              [VOLUNTARY DISCLAIMER: This work is wholly independent of, and in no way affiliated\n              with, the \"Grand Theft Auto\" franchise and its publisher \"Take-Two\", or the developer\n              entity known as \"Rockstar Games\". I am more than happy to make this abundantly clear.\n              Delighted, even.]\n            \n          \n        \n      \n            \n                How it works\n                A small idea with two layers.\n              \n            \n              The prototype combined a general-purpose 2D rigid body with a deliberately simple\n              model of a car.\n            \n\n            \n              The original simulation started with something like the \"Brick\", and I then added some\n              enhancements to make the \"Ship\" (which is deliberately reminiscent of the classic game\n              \"Thrust\" from 1986), before finally adding the elements which were required to make it\n              feel a bit more like a \"Car\".\n            \n\n            \n              At the core of the system is a simple classical 2D rigid body dynamics simulation.\n              From what I can tell, this approach was not yet common in games at the time (with some\n              notable exceptions), and most game vehicles were done using basic high-school \u2018point\n              physics\u2019 (F = ma), with any rotational component being handled by various wonky\n              \"hacks\". Using proper rigid-body physics (including torques) handles rotation more\n              coherently.\n            \n\n            \n              On top of that core, I then added a \"novel\" vehicle simulation layer, based on a\n              simple, approximate, and technically incorrect model of how tyres behave. It was\n              basically a semi-educated guess on my part and, although I knew it wasn't really\n              physically accurate, it nevertheless seemed to be \"good enough\" for my purposes at the\n              time.\n            \n\n            From input to motion\n            \n              These diagrams describe the current JavaScript recreation. The browser interface\n              supplies the controls, the simulation advances in fixed time steps, and the Canvas\n              renderer draws the resulting state. Keeping those jobs separate makes it easier to\n              follow where a button press becomes a force, and where that force becomes movement.\n              Select any diagram to open it at full size.\n            \n            \n              \n                \n              \n              \n                The overall flow, from the page and controls to simulation and drawing.\n              \n            \n\n            One body, three behaviours\n            \n              A vehicle combines a rigid body with a shell that describes its display shape and\n              collision geometry, and a dynamics object that supplies its behaviour. The Brick\n              accepts forces from a pointer drag; the Ship adds thrust at an attachment point; the\n              Car adds engine force and steering, with resistance applied at four tyre positions.\n              Switching mode replaces the shell and behaviour while preserving the body's position\n              and motion.\n            \n            \n              \n                \n              \n              \n                How the vehicle coordinator combines shape, behaviour and body state.\n              \n            \n\n            Forces can move and turn the body\n            \n              The rigid body tracks position and velocity alongside angle and angular velocity. A\n              force through its centre changes its motion; a force applied away from the centre can\n              also turn it. The simulation adds up the forces and torque, updates velocity, then\n              advances position and angle. A point on a rotating body has its own velocity,\n              combining the body's movement with the motion around its centre.\n            \n            \n              Barriers use that same point velocity. When a shape crosses an edge, the simulation\n              moves it back inside and applies a contact impulse if it is moving into the barrier.\n              An off-centre impact can therefore change both its velocity and its spin. This is a\n              simple barrier solver, with frictionless edges, rather than a general collision\n              system.\n            \n            \n              \n                \n              \n              \n                The shared physics core and the steps used to resolve barrier contacts.\n              \n            \n\n            The deliberately approximate tyres\n            \n              For each tyre, the Car measures the velocity at its position and resolves it into two\n              components: along the wheel's heading and sideways across it. It applies a small\n              resistance to rolling and a much stronger resistance to sideways motion. Steering\n              changes the front wheels' headings, so their forces also turn the body. The handbrake\n              increases rear rolling resistance and reduces rear sideways grip.\n            \n            \n              Those resistance forces are proportional to velocity, without a force cap. That is a\n              convenient damping model rather than a realistic account of tyre friction, slip or\n              available grip. It produces the useful feeling of wheels resisting sideways movement\n              with very little machinery. The Ship and Brick use the same physics core with\n              different ways of applying forces.\n            \n            \n              \n                \n              \n              \n                The force models, including wheel velocity components and handbrake behaviour.\n              \n            \n\n            Putting the pieces together\n            \n              The Vehicle coordinator asks the selected dynamics object to apply its forces, then\n              advances the rigid body. It also converts the shell's local points into world\n              positions for drawing and finds the surface point facing each barrier. When a flat\n              face touches a barrier, it uses the midpoint of the contacting points, avoiding the\n              artificial spin that choosing a single corner would introduce.\n            \n            \n              \n                \n              \n              \n                A closer look at mode installation, simulation updates and contact geometry."
                ],
                "output": "readability",
                "pwd": "/data/archive/1791669896.612895",
                "schema": "ArchiveResult",
                "start_ts": "2026-10-10T22:05:20.281481+00:00",
                "status": "succeeded"
            }
        ],
        "screenshot": [],
        "singlefile": [],
        "title": [
            {
                "cmd": [
                    "curl",
                    "--silent",
                    "--location",
                    "--compressed",
                    "--max-time",
                    "120",
                    "--user-agent",
                    "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 ArchiveBox/0.7.4 (+https://github.com/ArchiveBox/ArchiveBox/) curl/curl 8.14.1 (x86_64-pc-linux-gnu)",
                    "https://patkerr.co.uk/2d-vehicles/"
                ],
                "cmd_version": "curl 8.14.1 (x86_64-pc-linux-gnu)",
                "end_ts": "2026-10-10T22:05:20.274333+00:00",
                "index_texts": null,
                "output": "2D Vehicle Physics Prototype \u00b7 Pat Kerr",
                "pwd": "/data/archive/1791669896.612895",
                "schema": "ArchiveResult",
                "start_ts": "2026-10-10T22:05:20.265780+00:00",
                "status": "succeeded"
            }
        ],
        "wget": [
            {
                "cmd": [
                    "wget",
                    "--no-verbose",
                    "--adjust-extension",
                    "--convert-links",
                    "--force-directories",
                    "--span-hosts",
                    "--no-parent",
                    "-e",
                    "robots=off",
                    "--reject=js,mjs,woff,woff2,ttf,otf,eot,mp4,m4v,mov,webm,ogv,mkv,avi,flv",
                    "--timeout=120",
                    "--restrict-file-names=windows",
                    "--page-requisites",
                    "--user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 ArchiveBox/0.7.4 (+https://github.com/ArchiveBox/ArchiveBox/) wget/GNU Wget 1.21.3",
                    "--compression=auto",
                    "--timestamping",
                    "https://patkerr.co.uk/2d-vehicles/"
                ],
                "cmd_version": "GNU Wget 1.21.3",
                "end_ts": "2026-10-10T22:05:20.256961+00:00",
                "index_texts": null,
                "output": "patkerr.co.uk/2d-vehicles/index.html",
                "pwd": "/data/archive/1791669896.612895",
                "schema": "ArchiveResult",
                "start_ts": "2026-10-10T22:05:18.818371+00:00",
                "status": "succeeded"
            }
        ]
    },
    "icons": null,
    "is_archived": true,
    "is_static": false,
    "latest": {
        "archive_org": null,
        "dom": null,
        "favicon": "favicon.ico",
        "git": null,
        "media": null,
        "pdf": null,
        "screenshot": null,
        "singlefile": null,
        "title": "2D Vehicle Physics Prototype \u00b7 Pat Kerr",
        "warc": null,
        "wget": "patkerr.co.uk/2d-vehicles/index.html"
    },
    "link_dir": "/data/archive/1791669896.612895",
    "newest_archive_date": "2026-10-10T22:05:22.236220+00:00",
    "num_failures": 0,
    "num_outputs": 6,
    "oldest_archive_date": "2026-10-10T22:05:17.824804+00:00",
    "path": "/2d-vehicles/",
    "schema": "Link",
    "scheme": "https",
    "snapshot_id": "f274f9ac-4122-4e4b-bd7c-8932a8bd4604",
    "sources": [
        "/data/sources/1791669896-import.txt"
    ],
    "tags": null,
    "tags_str": "",
    "timestamp": "1791669896.612895",
    "title": "2D Vehicle Physics Prototype \u00b7 Pat Kerr",
    "updated": "2026-10-10T22:05:17.824307+00:00",
    "updated_date": "2026-10-10 22:05",
    "url": "https://patkerr.co.uk/2d-vehicles/"
}