Jump to content
  • 0

Server Lag, can this help _bldObj


Thug

Question

I have been adding add ons  to my servers and of course the vehicle count goes up and the lag gets worse. Someone told me to change my scripts. To use _bldObj in stead of _vehicle and _this.

 

Example:

 

_vehicle_2971 = objNull;
if (true) then
{
  _this = createVehicle ["MAP_nav_pier_C_R30", [4055.5073, 2685.8708, 5.104074], [], 0, "CAN_COLLIDE"];
  _vehicle_2971 = _this;
  _this setDir 108.386;
  _this setPos [4055.5073, 2685.8708, 5.104074];
};
 
Change to this:
 
_bldObj = objNull;
if (true) then
{
  _this = createVehicle ["MAP_nav_pier_C_R30", [4055.5073, 2685.8708, 5.104074], [], 0, "CAN_COLLIDE"];
  _bldObj setDir 108.386;
  _bldObj setPos [4055.5073, 2685.8708, 5.104074];
};
 
They said that it would help with the vehicle count and should help with the fps. With that being said if this is true, is there a program that will replace all the _vehicle_XXXX with _bldObj? OR will note pad++ do it. (i know how to do replace the _this in note pad++)  If np++ will, How?  Some of my scripts are very large. also the line _vehicle_2971 = _this; has to be removed, because it has number in it i was removing them one line at a time. That sucks.
 
Any help I thank you in advance.
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

This won't make any influence on your FPS.

Just make sure to execute such building addons server side.

There are conflicting opinions on this issue from what I'm seeing, some say 2 to 4 fps increase over _this. but the one thing I have noticed is its harder for people to edit your map changing into beidi,  if you offer it up for community use.. at least for the lazy or uniformed :) So many of the really cool maps are FPS killers, the more you have the worse it gets.. too many cars, trash, etc .. that make a edit look more apocalyptic, but kills ur FPS in return.. I just try to leave as much of the extras off as I can stand.. using less objects .. Yea all the junk looks cool.. but you have to make a trade off.. less map edits.. or more edits less junk.. like one I spent 20 hrs on lol.. looked freakin cool as hell.. till put on server . from 50 fps client side .. to 18 or less in that spot .. UGH! all that work .. 

Link to comment
Share on other sites

  • 0

For what is this step here? _vehicle_2971 = _this;

 

This is missing in the second example. So I don't know how costly the assignment to another variable is, as the object needs to be copied with all internal stuff the object has. So I would say the second way can save some steps.

 

Or did you just forget: _bldObj = _this? which everybody else just estimated that this is there. But nevertheless why not create a variable _vehicle = createVeh blablabla and do your changes on this _vehicle  and get rid of the assignment to another variable and get rid of the if (true) which is also nonsense ? Then you save 2 steps. If you save 2 steps for all the vehicles (if it's so) you may really save something if there are many.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Discord

×
×
  • Create New...