altmp / altv-issues

Issues and roadmap for alt:V project
92 stars 17 forks source link

Handling API broken #2274

Open Konders opened 2 months ago

Konders commented 2 months ago

Description of the problem

Handling api completely broken some main fields by 'broken' i mean that handling API doesn't change vehicle behaviour, because if we just change handling.meta and restart the game - this fields working correctly

Here is a list of fields, and range of values that we tested on many vehicles

driveInertia: 0.01 - 2
driveMaxFlatVel: 1 - 100
initialDragCoeff: 10 - 120
initialDriveForce: 0.1 - 1.9
initialDriveGears: 1 - 8
initialDriveMaxFlatVel: 1 - 100

Reproduction steps

clientside: vehicle.handling.driveInertia = 0.05

Expected behaviour

Expected changes in vehicle behaviour

Additional context

I think this is should be not critical priority, but really high Because there is many issues about that, and we(server developers) cant implement tuning features that we want, so we are blocked atm

Operating system

Windows 11

Version

release/16.0.152

Crashdump ID

No response

Confirmation of issue's presence

BluePeer commented 2 months ago

That are Initial Values, you need to change them in General handling the vehicle needs this value on Spawn time (client side creation) later there are not change able

access them via alt.HandlingData.getForHandlingName and change before the spawn.

Konders commented 2 months ago

There are not only initial values; is there any way to implement correct setters after a vehicle spawns for those fields? It would open up a significant number of possibilities for tuning.

Because it's not possible to synchronize by any means right now, if we change the handling for a model before it streams, we can end up in a situation where there might be a car meet with 50 cars (even with the same model), and we can't synchronize them correctly.

Konders commented 2 months ago

I don't think that comparing to other multiplayers is a good idea, but for a Proof of Concept, it should be sufficient. So, in one multiplayer, people set initial values on a specific vehicle after its spawn. For example:

SetVehicleHandlingInt(vehicle, "CCarHandlingData", "strAdvancedFlags", value.strAdvancedFlags)
SetVehicleHandlingFloat(vehicle, "CHandlingData", "fInitialDriveMaxFlatVel", value.fInitialDriveMaxFlatVel + 0.0)
SetVehicleHandlingFloat(vehicle, "CHandlingData", "fInitialDriveForce", value.fInitialDriveForce + 0.0)
SetVehicleHandlingFloat(vehicle, "CHandlingData", "fDriveInertia", value.fDriveInertia + 0.0)
SetVehicleHandlingInt(vehicle, "CHandlingData", "nInitialDriveGears", value.nInitialDriveGears)
TrashaPanda commented 2 days ago

After you make changes to the above handling values, utilize "ModifyVehicleTopSpeed(veh, 1)" and that should kick them into effect. Pretty sure this issue is GTAV being weird itself. But that native seems to cause them to work throughout my experiences.

gotgameio commented 2 days ago

After you make changes to the above handling values, utilize "ModifyVehicleTopSpeed(veh, 1)" and that should kick them into effect. Pretty sure this issue is GTAV being weird itself. But that native seems to cause them to work throughout my experiences.

Tnx for your reply, i will try your advice. Idk about the issue itself is in GTAV, as i knew in other GTAV mp's this features are working out of the box without such issues with *initial props.

TrashaPanda commented 2 days ago

In fivem you NEED to use that native for the values to update after a car is spawned. Thats why i know about the issue and believe it to be gtav related.

gotgameio commented 2 days ago

In fivem you NEED to use that native for the values to update after a car is spawned. Thats why i know about the issue and believe it to be gtav related.

Dont get me wrong, for FiveM i was only reading docs and didnt checked my self, in Rage i was checked myself everything was fine few years ago. As i know in altV this issue is related to streaming, i can be wrong. I will try your suggestion and i hope this will help with initial* properties.