Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vehicle damage by crashing depends on FPS #2956

Open
1 task done
PlatinMTA opened this issue Apr 10, 2023 · 1 comment
Open
1 task done

Vehicle damage by crashing depends on FPS #2956

PlatinMTA opened this issue Apr 10, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@PlatinMTA
Copy link
Contributor

Describe the bug

The more FPS you have, the less damage dealt. Physics play a factor here, #929 is related.

Steps to reproduce

test_fps_vehicle_crash.zip

  1. Download and start that resource.
  2. Go to x,y,z: /sp -2523 -616 133
  3. Use /fps to set your desired FPS
  4. Use /launch to launch the vehicle to the wall
  5. Use /resetveh to reset the vehicle position

You will see that higher FPS will make the vehicle have less damage while crashing. 25FPS will dealt arround 148HP of damage, while 144FPS will do 124HP dmg. 24HP points of damage is not THAT noticeable, but it's a unfair advantage.

Version

Any.

Additional context

This only happens for crashing, bullet damage is constant and is related to damage value on the weapon property (30 damage = 30 HP lost). Just to consider, the damage dealt to other players/peds is arround 1/3 of that.

Relevant log output

No response

Security Policy

  • I have read and understood the Security Policy and this issue is not security related.
@PlatinMTA PlatinMTA added the bug Something isn't working label Apr 10, 2023
@PlatinMTA PlatinMTA changed the title Vehicle damage by crashing is FPS dependent Vehicle damage by crashing depends on FPS Apr 10, 2023
@ItsHamidMustafa
Copy link

ItsHamidMustafa commented Apr 14, 2023

I'm a new dev, idk things that much but ig if we can add extra damage to the vehicle [On high FPS], the problem can be solved..
public OnVehicleDeath(vehicleid, killerid, weaponid) { new Float:fps = GetTickCount() / 1000.0; if(fps > 60.0) // If FPS is higher than 60 { SetVehicleHealth(vehicleid, 0.0); // Deal maximum damage } else { // Normal vehicle death handling // ... } return 1; }

You can add damage, somehow like

{
    new Float:fps = GetPlayerFPS(killerid);
    if(fps > 60.0)
    {
        new Float:health = GetVehicleHealth(vehicleid);
        SetVehicleHealth(vehicleid, health - 24.0);
    }
}

@patrikjuvonen patrikjuvonen added this to TODO - gameplay things in Framerate Fixes Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Framerate Fixes
  
TODO - gameplay things
Development

No branches or pull requests

2 participants