News for hackers. Stuff that matters.

PatKerr

Re:2D Vehicles on Wednesday October 14, 2026 @01:29PM (#50091465)
Hi. Just spotting this comment now.

It was probably just due to some parameter tweaks that were made during "tuning", especially when the game designers started making adjustments.

I'll maybe see if I can reproduce such changes eventually, but I'm going to be busy travelling from the next little while, so don't hold your breath! Sorry.

Re:2D Vehicles on Sunday October 11, 2026 @12:57PM (#50045263)
Just use "view source" from inside Motion Lab.

I deliberately kept it as plain JavaScript with no aggressive obfuscation.

There are even some comments! ;-)

Re:2D Vehicles (Driving Physics in GTA1) on Sunday October 11, 2026 @11:16AM (#50044215)
I don't know this thread, with the magic word "GTA" didn't take off, but the other one somehow did

I guess the later lost must have caught the weekend lull or something.

https://news.ycombinator.com/item?id=49991852

Re:2D Vehicles on Sunday October 11, 2026 @09:37AM (#50043178)
I actually use that word quite a lot in normal writing, and find that my general tone is quite bot-similar.

I am nevertheless unworried by this. ;-)

#replicant

Re:2D Vehicles on Saturday October 10, 2026 @07:31PM (#50038184)
Partial AI use, yes, on the diagrams -- somewhat as an experiment to see whether it was any good. I thought it was better than nothing.

But the core text was hand-written, and the code faithfully represents the logic of the hand-crafted original from 30 years ago.

Re:2D Vehicles on Saturday October 10, 2026 @07:29PM (#50038174)
The original was very similar, but with minimum UI (no "Settings" panel), and it was just black on white line drawings, although I did add skid trails etc. after I'd got the core of it working.
Re:2D Vehicles on Saturday October 10, 2026 @07:27PM (#50038162)
It's probably not a realistic enough simulation to be a viable learning aid, but that's a funny idea.

I might build something else on top of this though, and will try to keep parking in mind!

Re:2D Vehicles on Saturday October 10, 2026 @07:25PM (#50038153)
That's an interesting problem, and I can't immediately see why you would keep getting a side-effect like that.

Good luck with figuring it out!

Re:2D Vehicles on Saturday October 10, 2026 @07:12PM (#50038084)
There isn't much "air resistance" (or general velocity dampening) on these things, and the velocities carry over when you change the body's "shell".

So, it's sort of intended, but also not very significant one way or the other.

Re:2D Vehicles on Saturday October 10, 2026 @06:41PM (#50037907)
LOL!

I am the author of this thing, and I find your comment very amusing. ;-)

Re:2D Vehicles on Saturday October 10, 2026 @06:39PM (#50037891)
Just the little bits of text glueing the (yes, machine generated) diagrams together as I recall, when I was indeed trying to finish the thing off in a bit of a hurry.

I wrote the rest of it "by hand" though.

Re:2D Vehicles on Saturday October 10, 2026 @06:30PM (#50037839)
Thanks. I'm glad you liked it.
Re:2D Vehicles on Saturday October 10, 2026 @06:28PM (#50037825)
Correction, it was some mildly ChatGPT-assisted PatSlop.

I speak with some authority on the matter. ;-)

Re:2D Vehicles on Saturday October 10, 2026 @06:17PM (#50037749)
What in particular would you like to know?

As I said in the summary article, the core is a "textbook" 2D rigid body simulation (the "Brick" layer), and the Car bit is mostly a matter of deciding what forces are applied to the tyres.

In short, the tires "like" to go back and forward, but resist going sideways (relative to the direction they are pointing in).

The forces which are applied at the tyres are roughly equivalent to friction, but not quite (friction is stranger than many people think, and is not actually very velocity dependent). In some ways my tyre forces actually behave more like a form of "viscous drag" actually. I knew this was a bit dodgy at the time, and it was a sort of conscious "hack" that was chosen to produce "playable" behaviour as simply as I could.

Re:2D Vehicles on Saturday October 10, 2026 @06:04PM (#50037659)
Thanks. I'm glad you got something out of it.
Re:2D Vehicles on Saturday October 10, 2026 @05:58PM (#50037607)
Yes, I let the AI generate the diagrams from the code, a bit like tools such as "Doxygen" would in the olden days.

I was a bit pushed for time, and didn't feel inclined to try making the diagrams myself.

Still, I agree that they're a bit "slop adjacent". However, I thought they would be better than nothing for someone trying to get their bearings.. and I did iterate on them a bit to get them to be more useful than the initial clanker efforts!

Re:2D Vehicles on Saturday October 10, 2026 @05:54PM (#50037580)
Maybe I'll make one, if I get time, and am not distracted by other things.
Re:2D Vehicles on Saturday October 10, 2026 @05:53PM (#50037572)
You're very welcome.
Re:2D Vehicles on Saturday October 10, 2026 @05:51PM (#50037554)
Hello. I am the Pat Kerr in question.