Torndeco

Exile Loot Optimize Overrides (Incomplete)

9 posts in this topic

https://github.com/Torndeco/exile-loot-optimize

This is just some side code from my work with RZMod.
All this does is override on how the loot check works, to squeeze some more performance outof the server.

Only attempt this if you understand how to do Exile Client Overrides / SQF Coding.
This is incomplete and will result in loot spawning around your traders.

The logic is still the exact same how the loot spawns / despawns.
To disable loot spawning you will need to call the following on a server

[_pos,"TRADER"] call CustomServer_system_loot_disable;
[_pos,"CUSTOM",300] call CustomServer_system_loot_disable; // Custom range 300m

For example on the server run...

{
  [_x,"TRADER"] call CustomServer_system_loot_disable;
} forEach [<Trader Positions>];

If you are confused, i recommend you don't use these changes....


-------------

Basically this is what is changed

Buildings/Loot Containers  Changed References from NetID->Object Reference (no point in NetID overhead)
Server FSM, all the sqf code is in the FSM, and the config value lookups are only done once.

Removed the distance checks to traders / territories.
Instead when a trader/flag is spawned it adds a variable to a building to disable loot spawning it (avoids doing distance check).

Edited by Torndeco
3 people like this

Share this post


Link to post
Share on other sites

RPT error:

0:35:09 Error in expression <ot deleteAt _forEachIndex;
};
}
forEach ExileServerBuildingsWithLoot;>
 0:35:09   Error position: <ExileServerBuildingsWithLoot;>

 

Share this post


Link to post
Share on other sites
Advertisement

You never overrode your ExileServer_system_lootManager_initialize

Edited by Torndeco

Share this post


Link to post
Share on other sites

Nope i have no interest in benchmarking it either
Its less work on the server todo, benchmarking is just a waste of time imo

Plus the performance gains would be dependant on number of players, number of loot buildings with loot.
Its to subjective to say you will gain x in fps

Edited by Torndeco
1 person likes this

Share this post


Link to post
Share on other sites

Working great on my server. Less overhead is better!

1 person likes this

Share this post


Link to post
Share on other sites

Improved the Loot Cleanup, more optimized now :)
If you are already using this, all you need todo is update your server fsm....

Basically buildings are added to a loot array when loot is spawned. So the array is in order of time spawned:)
So when loot cleanup encounters a building were is loot isn't due to despawn, it doesn't need to check the rest the buildings in the array.
Also i switched from deleteAt (it didn't work fully as intended) -> deleteRange (works as intended) and is more efficent :)

 

Edited by Torndeco
3 people like this

Share this post


Link to post
Share on other sites

@Torndeco

server_main.fsm line 126

"	if ((time - (_building getVariable [""ExileLootSpawnedAt"", 0])) < _lootLifeTime) exitWith {}" \n

is missing a ";" at the end =) no rpt errors after placing it
great work anyway

cheers

Share this post


Link to post
Share on other sites

Fixed, copy paste error :)
Don't forget you can submit pull requests on github.

Share this post


Link to post
Share on other sites
Advertisement

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

  • Recently Browsing   0 members

    No registered users viewing this page.