Constraint Chassis

It’s only difficult if you make it that way. It’s automated, which means you need to get the Instance structure right, but it automatically sets things up like the suspension and so on.

When making new models, I always configure things based on an existing model. There’s a basic 4-wheeled one with (almost) no body, which works right out of the box. That can be tweaked, a body welded to it, etc. to get what you want.

Note that I don’t support the chassis system anymore, since it’s (performance-wise) quite slow compared to other options.

But yes, if anyone would like the system, send me a DM and we’ll work something out.

1 Like

Wait so this method is slow? What’s making it slow. Is the the I,V in pairs stuff? I made my chassis off of this but I don’t see what’s making the performance bad. If you want you can DM me about it because I’m making this work for mobile and maybe I can see other recommendations you would do without A-chassis.

3 Likes

Nice! I’m sure this will be useful to many new developers. I might use it if i ever need a simple car.

It is very useful. You can turn this into a pretty advanced chassis if you want to btw. I do recommend this for new developers and especially for scripters that are trying to acheave somthing they want.

1 Like

My system is slow because it polls instead of being event-based.

would not using event make the server lag though? also if i were to make it better what should i change.

It would, if you used lots of these.

Let me explain.

Every single frame, the chassis checks to see how many wheels it has. For every wheel it might have, it checks each wheel to make sure it has the proper components of a wheel.

It instantiates modules based on how many wheels it has, and each module does checks for about 10 different Values each frame, and reads their values if they’re present. Every single property that can be scripted by the chassis is then updated.

It makes heavy use of metatables for the class system, so I wouldn’t be surprised if a decent chunk of the performance hit is calling metamethods. Each metamethod checks a class and all of its superclasses sequentially, and it also does many comparisons against internal method names to check if those are what’s being called.

Remember that any method access follows this chain, and any method accesses inside that method - it becomes a recursive mess of performance hit after performance hit that causes a single instance of the chassis to consume over 2% of the server’s CPU power. A single instance!

That means, in the age of 100- and 200-player servers, you can only have 50 running cars in one server before it starts to slow down. That is absolutely unacceptable. Some games have over 50 cars with only a few players on…

2 Likes

So in the server script It’s lagging because it’s Checking every frame also right?

What if you could at start of vehicle grab all wheels and store it and stop checking. Would that solve this problem? Or would removing this check would fix the problem and you would just need to acquire a way to specify how many wheels a vehicle has like maybe each constraint should have a number and can change a value.
This is a open source script after all so people will likely just change inside the script likely.
Sorry if I seem a bit off on it, it’s because I haven’t done scripting in a while and I have been building for a while.

For solving idled (no player) cars probobly having a script enable and disable when a humanoid is out of vehicle.

1 Like

I’m talking about my own chassis system, which is only distributed on request.

This, I think, is the problem with the philosophy of my system. It was designed to be highly dynamic and accept almost any configuration changes at any time, when in practice this is almost never what happens. It is not a fit for a game with tons of nearly identical cars, which only need four wheels hardcoded, two wheel steering, no tank drive, etc.

1 Like

Yes I Know you I are talking about yours. I was making the point that people can patch this if it’s a known thing people know of lol.

How would I make custom mobile controls for this chassis?

Can you specify what controls exactly?

The controls would be like the ones in the iOS/Android ports of the early-mid 2000’s GTA games

1 Like

Yea if you are able to get the inputs and change the MoveVector(Steer , Throttle , 0) you should be able to get it to work

1 Like

How exactly would I do that? Sorry, I’m not really good with scripting.

1 Like

Any idea how to get the spring constraints to be invisible? I have Constraints Details turned off so they shouldn’t be showing up and all the parts are transparent as well. For some reason just the springs are visible when you play the game. I want the whole thing to be invisible which it is except for the springs. Thanks!

1 Like

Hey there It looks like you made a chassis using not constraints but forces. I just want to ask does your chassis use raycast suspension if yes. Where can I study about it. I tried making it but it didn’t turned out very well.

Sorry for replying here I want to PM but it looks like your pm’s are closed.

1 Like

Un tick the Visible property you may see it when on edit mode but you wont see it while playing the game

1 Like

I found it in the script it was on line 83

Tune.SusVisible		= true			-- Spring Visible

I just needed to set it to false here and it finally went away.

1 Like

I found it in the script it was on line 83

Tune.SusVisible		= true			-- Spring Visible

I just needed to set it to false here and it finally went away.

I appreciate the help by the way

1 Like