Korwiin 13 Report post Posted November 9, 2016 I noticed that the default Tanoa Exile mission has Vendor NPCs created in the initPlayerLocal file, but the trader city objects are in the InitServer file. I am curious why not have both in the initPlayerLocal? I am thinking along the lines of any walls or barrier objects would need to be server side so that AI will walk around them, but the decorative stuff like beer bottles, photos, guns on the walls could move client side only, and possibly conserve server resources? Share this post Link to post Share on other sites
kuplion 1785 Report post Posted November 9, 2016 If the objects where in initPlayerLocal, they'd be created every time anyone joined the server so you'll end up with dozens of the same buildings and items all overlapping. The server also then has to deal with all the extra objects. Loading these objects via initServer means the server loads them just the once. 1 Share this post Link to post Share on other sites
Korwiin 13 Report post Posted November 10, 2016 I can see why that would be a problem. So the NPC Traders are loaded in the initPlayerLocal file by default. Are they somehow local client side only? Share this post Link to post Share on other sites
kuplion 1785 Report post Posted November 10, 2016 Correct. Share this post Link to post Share on other sites
Korwiin 13 Report post Posted November 10, 2016 Okay, I see now... createVehicleLocal is used for NPC traders. So for custom map edits/decorations, and most of the trader cities, wouldn't it be better if it was in InitPlayerLocal as a createVehicleLocal instead of a simple object on the server? Share this post Link to post Share on other sites
kuplion 1785 Report post Posted November 10, 2016 (edited) Put the trader NPCs in initPlayerLocal, put objects in initServer. That's the way to do it. Edited November 10, 2016 by kuplion Share this post Link to post Share on other sites
Mezo 1264 Report post Posted November 11, 2016 On 10/11/2016 at 5:37 AM, Korwiin said: Okay, I see now... createVehicleLocal is used for NPC traders. So for custom map edits/decorations, and most of the trader cities, wouldn't it be better if it was in InitPlayerLocal as a createVehicleLocal instead of a simple object on the server? The server spawning these objects is a one time thing. It happens when the server loads and that's it. You're not going to improve server performance by spawning them with the client, you're just going to slow the clients loading time. 2 Share this post Link to post Share on other sites
Korwiin 13 Report post Posted November 12, 2016 @Mezo thanks for the reply. The real question I should have asked is: When adding decorations to a trader area, would it be BETTER for server performance to use createVehicleLocal inside the initPlayerLocal.sqf instead of the conventional createSimpleObject inside the initServer.sqf? From the wiki createSimpleObject uses very little network traffic while createVehicleLocal the created object is not transferred through network in MP games. So the assumption is that simpleobjects still use some network/memory/cpu on server and local vehicles don't. Share this post Link to post Share on other sites
Mezo 1264 Report post Posted November 12, 2016 20 minutes ago, Korwiin said: @Mezo thanks for the reply. The real question I should have asked is: When adding decorations to a trader area, would it be BETTER for server performance to use createVehicleLocal inside the initPlayerLocal.sqf instead of the conventional createSimpleObject inside the initServer.sqf? From the wiki createSimpleObject uses very little network traffic while createVehicleLocal the created object is not transferred through network in MP games. So the assumption is that simpleobjects still use some network/memory/cpu on server and local vehicles don't. I see what you're saying and the theory is correct, providing createVehicleLocal does what it says it does... which it doesn't half of the time letting the server create the objects on start with createSimpleObject is for sure the best way to do it. This really isn't that big of a task for the server to handle. 2 Share this post Link to post Share on other sites