2D Vehicles

605 points - last Wednesday at 12:30 PM

Source

Comments

zeroq yesterday at 9:05 PM
When mentioning foundational 2d driving models one simply can't omit Marco Monster (2003) [1].

Also Physics for Game Developers (2001) had a hilarious chapter dedicated to car racing simulation. Most of the chapter is dedicated building the scene in a minute detail - for instance pointing out that the center of gravity of the car will change during the course due to fuel consumption - only to simplify and cancel out most things at the end to leave the reader with just a handful of variables.

[1] https://www.asawicki.info/Mirror/Car%20Physics%20for%20Games...

matsemann yesterday at 8:16 PM
I'm sorry, I really want to like and understand this, but the diagrams are worthless and mostly incomprehensible.

I would've liked to understand more about why it works the way it does, how it achieved the correct feel etc, not just regurgitate whatever the code does.

I would've liked to know more about how the author achieved what they did, not a blog post anyone with an llm could've written.

wongarsu yesterday at 8:39 PM
GTA I and II had really fun car physics. Just driving around and evading police was fun, in a way the later 3d games in the series didn't quite capture for me
slowin yesterday at 7:18 PM
It still feels great to play! I love the history too, it's actually a great example of why prototyping "toys" is so important in product development. It allows you to play with isolated concepts without baggage or the expectation to make things production grade. Just getting straight to the point.

Great story, programming and mechanics.

joshu yesterday at 7:42 PM
no dynamics model (uses bicycle model) but i built a solver for parking

http://truckslop.joshu.dev/

londons_explore yesterday at 7:42 PM
This is what taught me how to do handbrake turns.

And shortly after I learned how expensive tyres were, I stopped doing handbrake turns.

codeulike yesterday at 7:52 PM
Interesting that he namechecks Thrust from 1986, an absolutely amazing game for the BBC Model B, and I guess the first 'physics' game I ever encountered. The 'towing' physics were amazing.

https://youtu.be/Dt44PEIWBRg?is=CbVTRyDfo8Nt56fH

Thrust was by Jeremy C. Smith who went on to work on Exile with Peter Irvin

ionwake yesterday at 9:25 PM
To the creator, thank you. I spent many years almost 2 decades alter playing multiplayer gta2 with my good friend during late night sessions.

Thank you for a great little physics engine

discobean today at 1:51 AM
This is really cool. A few months back I wanted to re-create the gta feeling in 2d myself with claude - I have no idea how to write games.. After about a few weeks it ended up in 3d, and completely different, and nowhere near as fun.

https://2e7b8cb5.city-driver.pages.dev - remember to do ignition, and start the car

baw-bag yesterday at 10:55 PM
I have been trying on and off to achieve this for years and what really bothered me was at slow speeds (reversing into a parking space), my vehicle would move laterally to the wheel direction. I could never solve that issue without hacking it which really annoyed me. Last time I tried was during covid. I picked up "The Multibody Systems Approach to Vehicle Dynamics - 2004" for 99p in a local charity shop. Far, far too advanced for me but I did manage to simplify it with google and some questions on stack to get nice handling. Alas that slow speed lateral motion, just knowing it was there made me shelf it again.

I am determined not to use a LLM or even this article to solve it at some point in my life.

Thanks for sharing.

PatKerr yesterday at 9:51 PM
Hello. I am the Pat Kerr in question.
uptownhr today at 8:14 AM
https://games.zabaca.com/games/roadkill/ just created this and added a zomebie survival mode on top
plasticeagle today at 9:30 AM
I wrote a 2D car physics engine, using Verlet integration. Unfortunately, I wrote it in ActionScript instead of something sensible.

It did work great though.

defenestration today at 11:31 AM
Yes, it feels like the memory I have of driving and sliding in GTA 1 and 2. Cool that you have posted this. I like the way you have modelled the physics as simply as possible while still giving a realistic feel.
entropie yesterday at 10:11 PM
Can you please add a "parking simulator" mode? Iam not joking, my SO wants a simple way to train parking and I think that could work very well. Or maybe just let one draw obstacles.
bita_nidir yesterday at 8:08 PM
Nostalgic!

It'd be amazing to hook is up with the engine sound simulator: https://github.com/ange-yaghi/engine-sim

algoth1 today at 2:01 PM
I just learned that when you are going 300mph,if you turn, you'll come to a smooth near sudden stop
lpeancovschi today at 12:48 AM
I built a 2d iOS game using this concept a while ago. It was built using SpriteKit: https://apps.apple.com/us/app/drift-mania-infinite-car-racer...
deleted yesterday at 10:36 PM
TomGarden yesterday at 9:53 PM
This feels incredible to play, even with the simple graphics. Wow. Top class
the-grump today at 12:21 AM
Oh how I loved driving around in GTA 2!

Thank you for your great work there and for sharing how you did it. I felt nostalgic playing with the model.

thih9 today at 4:00 AM
Why I like it and always have:

1. Hold accelerate for three seconds

2. Press handbrake and right for half second

3. Hold decelerate for three seconds

4. Press left for half second.

5. Goto 1.

andremendes yesterday at 7:59 PM
If you accelerate the Car, then switch the configuration from Car to Brick, the brick won't slow down. Not sure whether is it intended but it feels wrong.
Devalyus today at 8:37 AM
Going backwards while holding handbrake makes perfect circle :)
gaghak2010 yesterday at 7:48 PM
It's an interesting project, although not a physics expert I am so curious what the original version looked like!
olivierestsage today at 1:05 AM
I speak for an entire generation of people when I say thanks, nice job with this
m00x yesterday at 10:22 PM
This is painfully awful Claudeslop. They didn't even bother changing the default style.
MisterMunchkin yesterday at 8:04 PM
Even that little simulation is really fun. I’d like to play a little 2D game with this mechanic.
sans_souse today at 7:58 PM
Can we implement this inside an original GTA / GTA2 port?
DHolzer today at 8:19 AM
the classic ship feels great to control. It reminds me of flying FAO in Elite Dangerous. Thank you!
fitm3 today at 5:25 PM
Likely to be widely used
iammjm yesterday at 7:53 PM
Really nice. GTA 1 & 2 were really amazing. I had a lot of good times with them.
jryb yesterday at 8:02 PM
d doesn't turn right for me, but shift+d does. Arrow keys do work though.
octol today at 3:01 AM
I think this is just Autodesk Vehicle Tracking
hendry yesterday at 7:44 PM
Feels like the original, just need some thing to run over.
JacobJack yesterday at 9:23 PM
GFA Basic !… So many memories are coming back to me.
Cadman021 yesterday at 8:05 PM
I liked your idea. It was really cool.
carlos256 yesterday at 8:23 PM
AI content.
LumJerliu yesterday at 9:06 PM
Really nice game
hackermeows yesterday at 10:02 PM
no understeer? fronts are too grippy
TacticalCoder yesterday at 9:25 PM
> It began as a little wireframe demo written in GFA BASIC on my Atari ST home computer (and was later ported to C for use in the actual game).

The Atari ST is in the news today on HN! (there was a TFA about the Atari Falcon, which was a really big Atari ST).

Barbing yesterday at 10:04 PM
StopTheMadness Pro users on iOS: exempt website, so you won’t keep selecting the text on the controls. May still highlight the “Speed Zoom on” line though.
rasz today at 2:19 AM
no clutch = no clutch kick drifting
alexx-devv today at 7:58 AM
[flagged]
rrr_oh_man yesterday at 7:11 PM
[flagged]
NewsaHackO yesterday at 7:16 PM
>One weekend in late August 1996, I wrote a 2D physics simulation which later became the basis of the vehicle system in the eventually popular game "Grand Theft Auto" aka "GTA".

I don't mean to be... judgemental, but if you had the talent to go something like this, why devolve on the remake? One could think that a person with your level of skill would be one of the main vanguard for hand coding. Again, I don't want to be too judgemental, as I am not a great programmer and use assisted tools when planning and designing personal apps, but I am just curious.