Author Topic: Vehicles causing Choppy FPS?(Solved)  (Read 1626 times)

So it turns out that my FPS drop is coming from vehicles just being spawned in the game. It mainly persists with the Abrams by Stratofortress and the BTR by Gcat. I have no idea why. But as soon as i spawn these vehicles in my fps gets choppy. I do have strato's TOW launchers around the map but theres only 4 of them. Any of you got any ideas on why this is happening?

Fixed Script_ObstructRadiusDamage:https://www.mediafire.com/?u05vcfhdogx2r49

Addons To Debug(Minus the Abrams):http://www.mediafire.com/download/lmktgzdhk97excl/DebugPlz.zip


« Last Edit: June 06, 2016, 08:18:35 PM by Ctrooper »

All the weapons having this block of code per weapon making package pyramids is probably a contributor to this issue:
Code: (Weapon_AK74.cs) [Select]
package AK74S
{
  function Armor::onTrigger(%this, %player, %slot, %val)
{
if(%player.getMountedImage(0) $= AK74SImage.getID() && %slot $= 4 && %val)
{
  %player.mountImage(AK74SSCImage,0);
}     

else if(%player.getMountedImage(0) $= AK74SSCImage.getID() && %slot $= 4 && %val)
{
  %player.mountImage(AK74SImage,0);
}
Parent::onTrigger(%this, %player, %slot, %val);
}

function servercmdDropTool(%client,%slot)
{
if(%client.player.getMountedImage(0) $= AK74SSCImage.getID())
{
  %client.player.unmountImage(0);
}
return Parent::servercmdDropTool(%client,%slot);
}
};
ActivatePackage(AK74S);
calling armor::ontrigger() is pretty slow with the amount of code that it goes through; there must be some better way to do this, but i'm not so sure
this is the resulting trace:

lastly, this is not the only weaponpack that uses 50 packages. nekram's pack also does this.

also this should fix one of the more minor errors i saw in the console.log:
http://pastebin.com/NN2ZW58J
« Last Edit: June 01, 2016, 11:19:44 PM by QuadStorm »

What you could do instead of the many packages, is just have one support package with the contents
Code: [Select]
package scopes
{
  function Armor::onTrigger(%this, %player, %slot, %val)
{
if(isObject(%player.getMountedImage(0).scopeImage) && %slot $= 4 && %val)
%player.mountImage(%player.getMountedImage(0).scopeImage,0);
Parent::onTrigger(%this, %player, %slot, %val);
}
function servercmdDropTool(%client,%slot)
{
if(isObject(%client.player) && isObject(%client.player.getMountedImage(0).scopeImage))
%client.player.unMountImage(0);
}
};
activatePacakge(scopes);

Then just set the scopeImage of the unscoped weapon to the scope weapon, and vthe scopeImage of the scoped weapon to the unscoped one.

Quote
also this should fix one of the more minor errors i saw in the console.log:
http://pastebin.com/NN2ZW58J

Thank you!

Quote
What you could do instead of the many packages, is just have one support package with the contents
Ill do that instead thank you.


We do need a fix for obstruct radius damage though. Thats an important one as well. Unfortunately i have no idea how it works so if you find a fix you'll have to guide me through it.

Bump, ran into an issue with the scoping package support. I made "Package scopes" for full auto images and "Package scopesS" for semi auto images. My new images were HipImage and AimImage. So i replaced, for example, AK74Image with HipImage and AK74SCImage (Scoped) with AimImage. It works, but if i do this for other weapons, they end up sharing images and it screws everything up. Not sure if i skipped a step, any ideas on whats going on?

Also, still getting a console error from the death yell pack:



and heres the errors im getting for the obstruct radius damage:


Vehicles don't have a .getHackPosition function, and you seem to be calling .getClassName on a non-existent object.

Code: [Select]
function Vehicle::getHackPosition(%this)
{
return %this.getPosition();
}
This is just a cheap workaround.


Also, the package code I provided is pretty well just a toggle between images and any changes to it are pretty much just going to overcomplicate it.
The reason I made it like that is so you can just set "scopeImage" to any image datablock and hitting right click while holding it will switch to the other image.

Quote
This is just a cheap workaround.
This fixed it, thank you.

Posted a link to the fixed Obstructradiusdamage script.

Still need a fix for the Death yells, looking at it rn but i may not be able to figure it out. Also im going to scratch the tank off the list because i think i fixed it, just a small error i made while doing some mods to it.

Bump, new problem came up.

Run a trace and post a console log.

Its done, after looking at the trace it looks like ill have to "walk away" from my footsteps mod. But theres also a snip in there with AbramsVehicle::OnTick or something.




Console Log is apparently too big to attach

do you have ports improved vehicle collision mod or something?

if you do, remove it and see if it fixes anything. Otherwise, try a trace with the footstep mod off

Quote
do you have ports improved vehicle collision mod or something?
Yes, after deleting it my problem was solved thank you so much.

My main problem has been solved, and thanks to you guys the ObstructRadiusDamage is fixed too. But if youd like to take a crack at the Death yell pack and the lazer range finder and see if you can debug those, that would be awesome. Otherwise, thanks for the help!

Yes, after deleting it my problem was solved thank you so much.

My main problem has been solved, and thanks to you guys the ObstructRadiusDamage is fixed too. But if youd like to take a crack at the Death yell pack and the lazer range finder and see if you can debug those, that would be awesome. Otherwise, thanks for the help!
are you talking about the console errors whenever someone dies related to laser range finder? i can fix those if you need.