Simple Car Simulator

Some of you may have already seen this hobby project of mine … here are just a few updates after more than a year:

  • Recently I added sound - in a rather crude way - and changed the domain name.

  • The graphics is probably way below your folks’ standards, I am more focusing on the vehicle modeling in terms of physics/mechanics and prefer using just the geometric primitives provided by Babylon.

  • I gave up on making it run on IE, pretty much testing on Chromium only now. FF runs it ok but much slower, usually below real time, at least on my cheap HW.

  • In game mode, the vehicle is controlled by mouse/pointer position… my friends tell me it is unusual but I find the arrow key controls really clumsy.

  • I doubt there would be interest to include it on Babylon’s demo list for the reasons listed above but let me know if such interest exists.

I would be happy to hear your thoughts and impressions :slight_smile: https://simcar.io

10 Likes

really good :slightly_smiling_face:

1 Like

Super clean, I watched a demo of it run on my phone and it seems really smooth.

1 Like

The menus don’t fit well on phone screens. One of the battles I don’t fight, since it is just a hobby. It does crack me up though that on some phones it runs about as fast as on my laptop.

2 Likes

Works great on a pixel3 if you where wondering what client

2 Likes

Thanks! I am always curious (and sometimes unpleasantly surprised) how it runs on different platforms. For example, the sound worked well on my laptop but then on my NUC+TV it had some funny interference effects when more than 1 sound played at a time.

Definitely something for our webpage (@PirateJC)!

2 Likes

So is this your own car physics system? I was thinking about it the other day and realized it would be a prime setup to do “physic materials” with. Where the texture that the wheel is on effects its properties.

2 Likes

It is a cool idea but a tire force calculation is somewhat complicated, a function of a whole bunch of things that just the contact information with the given material would not provide. Which is also why the playground here is made of large triangles rather than some general shape, so that the forces can be calculated reasonably fast. You can notice that the 8x8 vehicle physics calculation time (the P in the G-P-W numbers) is higher than the 4 wheelers, with 2x as many tire forces to calculate.
One example of tire modeling is the Pacejka model (you can Google it) but there are many others. I made “my own” here.

do the triangles have a uv?

could you project a uv onto them if they don’t?

Then you could have a texture that is sampled at the uv points for the contact rays and depending on the color that’s sampled there do some different stuff. I would imagine it could still be fairly fast.

1 Like

Im rewriting my answer: you may be right, I just don’t know enough about Babylon materials. The main trouble is with ray casting. It requires a render cycle to run through (afaik) and that kills the physics calculation speed.

1 Like

When I test drive the pixel3 at bestbuy it’s what I imagine driving a Tesla is like.

Honestly I want my iPhone 6s back… Android is cool and all, but I still feel like iPhone is king.

Iphone will always be fisher-price. They work fine as long as you’re only doing what big brother Apple wants you to do, and paying all the tolls along the way.

1 Like

Nice :slight_smile:

1 Like

well it took me some time to figure out the controls were using a mouse on PC

pointing forward is acc
pointing backward is decc
, you get it right is right , left is left