Hello guys!
I'm new here, having lots of fun with GMOD, but I feel the urge to program things nowadays rather than just play with what we have. So I wasn't satisfied with Source Engine's sphere collider based cars, tried to make my own with ray casts. Well, the result is pretty good actually! But I need to resolve many, many things.
What it has:
-Raycast suspension with 4 wheelss
-Configurable wheel size, suspension length, weight, etc in the lua file...
-Max speed I could achieve was around 2800 units/sec (PhysObj:GetVelocity():Length) on a straight line. Mass: 800 units, Forward force on two rear wheels: 10000 units for both.
I needed to put some barrels to the front and apply the forces above contact point. There is no anti rollbar so the car can become very unstable. No downforce. And the center of mass of this model is off-center. Probably higher speeds are possible. Still, much faster than the Buggy with the turbo.
What it hasn't:
-Gearbox (I just apply a constant force in hope it can accelerate without rolling over)
-Drag calculations
-Wheel physics are simple, no Pacejka, just simple opposite forces to keep it stable
-Sound effects
-Proper controls. It just goes by pressing WASD, doesn't matter where you are.
-Only works for the first player.
My lua knowledge is really, really lacking!!! Don't know how to make a client side script that sends the keypresses to the entity + make it possible to drive only when we are truly in the car... And how to make us sit into the car anyway?
-A proper car model. To be honest, I love this van, but I need to edit it, add wheels... hmmm wheels... yeah..., fix the doors and very important, to make it stable. Sadly, I didn't find any ways to change COM from a code.
-Some rubber burning!!!
-Proper way to spawn it and drive it... Ugh...
-Anti-rollbars! I see it rolling... I hatin'
https://www.youtube.com/watch?v=fLVdK2NFXyU
https://www.youtube.com/watch?v=J5eD1hAXqws
https://www.youtube.com/watch?v=tKFJJ0sB8_w
So it's getting pretty good, I like driving around, but you can see some unstableness plus the wheel physics are highly simplified. I may try to implement Pacejka magic formula. Or just an improved arcade style physics.
Who doesn't want a fun, race around gm_fork or in a city or on some fun terrain?
So things I will need to figure out, how to control the car properly by any players who spawned it and while they are driving it. And probably many other things later.
Welcome, looks like a neat project. You should be better off though posting this in the Lua development section though
Thank you!
Updates will come today for this! I hope it'll be a proper raycast car framework one day...
Is it possible to move this to Lua development section? Or may I ask an admin or moderator to do it?
You should ask a moderator but there are no PMs right no so ¯\_(ツ)_/¯
Sorry, you need to Log In to post a reply to this thread.