redarmy 422 Posted June 20, 2021 I love the map,and was extremely dissapointed by how poorly optimized it was. It simply has too many objects,not to mention interiors in houses.Actually considering how many objects and interiors,the map is quite decently optimized/runs well,but i feel BIS overdid it with tree placement(1.8 million if im not mistaken) So i went about finding the best ways to optimise it without sacrificing much in terms of view distance or whatnot... The best solution i came up with was to simply remove all bushes on the mapI find foliage on ths map very dense and grass everywhere so removing bushes doesnt degrade the visuals....so i tried that and did gain up to 10 FPS and brought the maps performance more in line with Tanoa(which i also tested this on and in some cases gained 20 FPS on that map,but Tanoa for me runs better so its not needed,but try yourself) Create a game logic and name it whatever,"logic1" in this case. The create a trigger with an activation reading: { _x hideObjectGlobal true } foreach (nearestTerrainObjects [logic1,["BUSH"],12000]); This will remove all bushes within 12000 meter radius.Or call it through the init if prefer.Go in and test.Have a real FPS counter to see the difference do not pause the game and look at fps in video options. This has made the difference and allowed me to play at a frame rate thats more consistent to other BIS maps. Hope this is of use to someone. Share this post Link to post Share on other sites
sarogahtyp 1108 Posted June 20, 2021 For the same purpose on malden I wrote the following: /* Author: Sarogahtyp Description: hide (delete) terrain objects for better map performance License: MIT - License Copyright 2019 Sarogahtyp (sarogahtyp@web.de) Permission is hereby granted, free of charge, to any person obtaining a copy of this SQF-Script and associated documentation files (the "SQF-Script"), to deal in the SQF-Script without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the SQF-Script, and to permit persons to whom the SQF-Script is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the SQF-Script. THE SQF-SCRIPT IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SQF-SCRIPT OR THE USE OR OTHER DEALINGS IN THE SQF-SCRIPT. */ diag_log "saroTweakFPS: started"; private _types_array = [ [ ["ROCK"], 33 ], [ ["TREE"], 33 ], [ ["BUSH"], 33 ], [ ["FENCE"], 0 ], [ ["WALL"], 0 ], [ ["HIDE"], 33 ] ]; private _world_half = worldSize / 2; private _world_diag_half = worldSize * 0.70711; private ["_type", "_var", "_dummy"]; //delete given percentage of terrain objects (not randomly cause it will be done on each machine locally and should be the same) _dummy = { _type = _x # 0; _var = _x # 1; _dummy = [_type, _var, _world_half, _world_diag_half ] spawn { private _type = _this select 0; private _var = _this select 1; private _world_half = _this select 2; private _world_diag_half = _this select 3; private _start_time = diag_tickTime; if(_var > 0) then { private _object_count = round (100 / _var); private _objects = nearestTerrainObjects [[_world_half, _world_half], _type, _world_diag_half , false, true]; { if((_forEachIndex + 1) % _object_count isEqualTo 0) then {_x hideObject true;}; } forEach _objects; }; diag_log format [ "saroTweakFPS: Processing %1s took %2 seconds", (_type # 0), ( diag_tickTime - _start_time ) ]; }; } count _types_array; Here you are able to set a percentage value to delete the chosen type of map object. Not deleting all of a type but some of some types should be less visible... Edit: There was a reason for not doing it globally but locally on each machine. But i forgot the reason... Edit: Mod version Download (for testing or for singleplayer only pls) :tweakFPS Edit: Steam Wokshop CBA-Version fully customizable through in-game CBA-Addon-Options 3 Share this post Link to post Share on other sites
redarmy 422 Posted June 20, 2021 46 minutes ago, sarogahtyp said: For the same purpose on malden I wrote the following: // hide (delete) terrain objects for better map performance // percentages for deletion _rock_perc = 50; _tree_perc = 25; _bush_perc = 25; _fence_perc = 5; _wall_perc = 5; _hide_perc = 25; _rock_fac = round (100 / _rock_perc); _tree_fac = round (100 / _tree_perc); _bush_fac = round (100 / _bush_perc); _fence_fac = round (100 / _fence_perc); _wall_fac = round (100 / _wall_perc); _hide_fac = round (100 / _hide_perc); // get all specific terrain objects // 3,513 _rocks = nearestTerrainObjects [[worldSize/2, worldSize/2], ["ROCK"], (worldSize * 1.41) , true, true]; // 101,960 _trees = nearestTerrainObjects [[worldSize/2, worldSize/2], ["TREE"], (worldSize * 1.41) , true, true]; // 288,461 _bushes = nearestTerrainObjects [[worldSize/2, worldSize/2], ["BUSH"], (worldSize * 1.41) , true, true]; // 11,189 _fences = nearestTerrainObjects [[worldSize/2, worldSize/2], ["FENCE"], (worldSize * 1.41) , true, true]; // 14,190 _walls = nearestTerrainObjects [[worldSize/2, worldSize/2], ["WALL"], (worldSize * 1.41) , true, true]; // 192,325 _hides = nearestTerrainObjects [[worldSize/2, worldSize/2], ["HIDE"], (worldSize * 1.41) , true, true]; //delete given percentage of terrain objects (not randomly cause it will be done on each machine locally and should be the same) { if((_forEachIndex + 1) % _rock_fac isEqualTo 0) then {_x hideObject true;}; } forEach _rocks; { if((_forEachIndex + 1) % _tree_fac isEqualTo 0) then {_x hideObject true;}; } forEach _trees; { if((_forEachIndex + 1) % _bush_fac isEqualTo 0) then {_x hideObject true;}; } forEach _bushes; { if((_forEachIndex + 1) % _fence_fac isEqualTo 0) then {_x hideObject true;}; } forEach _fences; { if((_forEachIndex + 1) % _wall_fac isEqualTo 0) then {_x hideObject true;}; } forEach _walls; { if((_forEachIndex + 1) % _hide_fac isEqualTo 0) then {_x hideObject true;}; } forEach _hides; Here you are able to set a percentage value to delete the chosen type of map object. Not deleting all of a type but some of some types should be less visible... Edit: There was a reason for not doing it globally but locally on each machine. But i forgot the reason... This is amazing man im going to use it on Livonia.Compatible there too?Just throw it in the init ? Also want to ask,what is "hide' referring to? EDIT just tested in Livonia. Works lovely . this is great. 1 Share this post Link to post Share on other sites
sarogahtyp 1108 Posted June 20, 2021 I personally prefer to register it as function to armas function library and use the preinit option to start it before everything else. For sure u could just use init.sqf to do this. Also I guess I used local variant to reduce network traffic. The hides should be some sort of rocks. See Demellion's comment on bikis entry for nearestTerrainObjects Edit: should be compatible to any map. Just dont use any 0 percentage because of zero divisor or edit the code yourself to handle this case. Share this post Link to post Share on other sites
redarmy 422 Posted June 20, 2021 4 minutes ago, sarogahtyp said: I personally prefer to register it as function to armas function library and use the preinit option to start it before everything else. For sure u could just use init.sqf to do this. Also I guess I used local variant to reduce network traffic. The hides should be some sort of rocks. See Demellion's comment on bikis entry for nearestTerrainObjects Edit: should be compatible to any map. Just dont use any 0 percentage because of zero divisor or edit the code yourself to handle this case. 'Hide" may be wooden log stacks as well. You should really upload this somewhere im sure theres alot of people who will be thrilled with this.Thanks for the heads up about zero divisor. Share this post Link to post Share on other sites
Valken 622 Posted June 20, 2021 Can you guys do the following so we can track the performance increase accurately: What is your CPU/RAM/GPU configuration? What screen resolution? Can these scripts be converted into a "mod" so we just load it and test it? Can someone post a screenshot comparison? Same seen before and after just to see the effect? Share this post Link to post Share on other sites
sarogahtyp 1108 Posted June 20, 2021 14 minutes ago, Valken said: Can you guys do the following so we can track the performance increase accurately: What is your CPU/RAM/GPU configuration? What screen resolution? Can these scripts be converted into a "mod" so we just load it and test it? Can someone post a screenshot comparison? Same seen before and after just to see the effect? I cant do a mod cause I did never one before. But I can do 2 empty multiplayer missions of it (one with and one without the script) then you can test the difference yourself... which map would you prefer? Share this post Link to post Share on other sites
sarogahtyp 1108 Posted June 21, 2021 (edited) okay, I created a mod of it for testing purpose. Ill publish a later version on workshop when I fiddled out how to use a userconfig file with the mod to allow server owners to configure the behavior. Current mod version just deletes 33% of most stuff. I updated my first post here with the current script version used by the mod. Mod Download: tweakFPS Wish you happy testing 😉 PS.: there are no mod dependencies Edit: I tested it on my poor machine on Malden and I had without Mod: 46/47 FPS with Mod: 52/53 FPS Edited June 21, 2021 by sarogahtyp added test results 1 Share this post Link to post Share on other sites
Valken 622 Posted June 21, 2021 I will try this shortly and see what get with my MAXED out quality settings. I've been compromising draw distance down to 1000 on MP servers to keep FPS high but at maxed settings. Probably Livonia, Tanoa and Cam Lao Nam as those maps have a ton of vegetation. Maybe Even Chernarus 2020 or Winter Chernarus as those lag on my system for no reason. Thanks for this. Edit - Results from EDEN by clicking on the listed town or city - default view, no camera changes System Haswell 4790K @ 4.5 GHz (it is hot here), DDR3-2400CL10 RAM, 1060 GTX, SSD GM, SOGPF, Tanoa, CONTACT and some sound, graphics mods Enhanced Video Settings loaded to max out graphics quality. 1080p Windowed Fullscreen, ULTRA PRESET with the following changes: VSYNC - OFF TEXTURE - MORE ULTRA OBJECTS - ULTRA +3 TERRAIN - ULTRA, anything above this crashes some maps SHADOW - SUPER PARTICLES - ULTRA+ PIP - SUPER OVERALL DISTANCE - 3800 or 1000 OBJECT DISTANCE - 3800 or 1000 SHADOW - 200 AA - 2x CMAA MLAA - ULTRA ALL OBJECTS + VEGETATION MAP RESULTS WITHOUT AND WITH TWEAK ON 3800 VS 1000M VIEW DISTANCE: GM cDLC - WINTER WFERLINGEN TWEAK OFF 45 v 55 TWEAK ON 35 V 46 GM cDLC - WFERLINGEN - GRASLEBEN <-- very dense and has lower FPS than Winter version TWEAK OFF 43 v 52 TWEAK ON 27 V 44 TANOA DLC - Georgetown TWEAK OFF 51 v 67 TWEAK ON 46 V 59 CONTACT DLC - Nadbor TWEAK OFF 39 v 45 TWEAK ON 37 V 45 SOGPF cDLC - Saigon TWEAK OFF 22 V 25 TWEAK ON 22 V 25 These are average FPS. It bounces up and down +3 FPS for me in EDEN. I think the average is lower due to the script running or looping... I am unsure if I should leave it alone for a longer time to keep it going and stabilize. I did not load CUP Chernarus so will test it again later. 1 Share this post Link to post Share on other sites
sarogahtyp 1108 Posted June 21, 2021 The deletion is done in preInit before you spawn. Therefore you dont need to wait and there is no script running after you are spawned. Your values are weird are you using the same graphic settings and view distance all the time? Here is the CBA-version which I published on Steam now. You are able to customize all deletion rates in the Addon-Options with it. After changing these a mission restart is needed. https://steamcommunity.com/sharedfiles/filedetails/?id=2523320712 2 Share this post Link to post Share on other sites
pvt. partz 248 Posted June 22, 2021 Doesn't this do the exact same? just in different way? https://steamcommunity.com/workshop/filedetails/?id=837729515 Share this post Link to post Share on other sites
Valken 622 Posted June 22, 2021 3 minutes ago, pvt. partz said: Doesn't this do the exact same? just in different way? https://steamcommunity.com/workshop/filedetails/?id=837729515 No, this sets a FIXED object deletion so the view / object distances are also FIXED! 7 hours ago, sarogahtyp said: The deletion is done in preInit before you spawn. Therefore you dont need to wait and there is no script running after you are spawned. Your values are weird are you using the same graphic settings and view distance all the time? Here is the CBA-version which I published on Steam now. You are able to customize all deletion rates in the Addon-Options with it. After changing these a mission restart is needed. https://steamcommunity.com/sharedfiles/filedetails/?id=2523320712 I noticed if I just load ENHANCED VIDEO SETTINGS and MAX out the models, objects and texture quality, it PREVENTS LOD'ing. That gain me very stable FPS as there is next to no swapping once loaded into memory at the expense of memory. I will try it again without the other mods as it is possible one of them is doing something in the background. 1 Share this post Link to post Share on other sites
sarogahtyp 1108 Posted June 22, 2021 4 hours ago, pvt. partz said: Doesn't this do the exact same? just in different way? https://steamcommunity.com/workshop/filedetails/?id=837729515 No, it does the exact opposite. It reduces view distance and level of detail. My script deletes terrain objects like trees, bushes, rocks and so on on the whole map. Share this post Link to post Share on other sites
Pagoda.br 8 Posted July 11, 2021 I tried it on server with hideObjectGlobal. Take ages to complete so i closed client and server, some network errors in RPT, i'm not sure if it was stuck or not. 12:47:47 NetServer: cannot find channel #2059452717, users.card=0 12:47:47 Message not sent - error 0, message ID = ffffffff, to 2059452717 (Pagoda) 12:47:47 NetServer: cannot find channel #2059452717, users.card=0 12:47:47 Message not sent - error 0, message ID = ffffffff, to 2059452717 (Pagoda) 12:47:47 NetServer: cannot find channel #2059452717, users.card=0 12:47:47 Message not sent - error 0, message ID = ffffffff, to 2059452717 (Pagoda) 12:47:47 NetServer: cannot find channel #2059452717, users.card=0 12:47:47 Message not sent - error 0, message ID = ffffffff, to 2059452717 (Pagoda) 12:47:47 NetServer: cannot find channel #2059452717, users.card=0 12:47:47 Message not sent - error 0, message ID = ffffffff, to 2059452717 (Pagoda) 12:47:47 NetServer: cannot find channel #2059452717, users.card=0 12:47:47 Message not sent - error 0, message ID = ffffffff, to 2059452717 (Pagoda) 12:47:47 NetServer: cannot find channel #2059452717, users.card=0 12:47:47 Message not sent - error 0, message ID = ffffffff, to 2059452717 (Pagoda) 12:47:47 NetServer: cannot find channel #2059452717, users.card=0 12:47:47 Message not sent - error 0, message ID = ffffffff, to 2059452717 (Pagoda) 12:47:47 NetServer: cannot find channel #2059452717, users.card=0 12:47:47 Message not sent - error 0, message ID = ffffffff, to 2059452717 (Pagoda) 12:47:47 NetServer: cannot find channel #2059452717, users.card=0 12:47:47 Message not sent - error 0, message ID = ffffffff, to 2059452717 (Pagoda) Share this post Link to post Share on other sites
sarogahtyp 1108 Posted July 11, 2021 Dont use hideObjectGlobal. U create giant network traffic with it and maybe massive server lags when new players connect. you could also consider to use my mod linked above. It runs fine afaik... Edit: Here the link to the mod again https://steamcommunity.com/sharedfiles/filedetails/?id=2523320712 1 Share this post Link to post Share on other sites
Pagoda.br 8 Posted July 11, 2021 sarogahtyp, I ran the mod script in the admin console (with 33%) and noticed no change in FPS. If i use 50% or 100% i see change in FPS. I also changed the spawn to a call, to make sure i know when the script is done, same results. I tried in the editor, on Altis, on an empty map and in my private mission, also on Altis, with tons of AI units, vehicles and objects. View distance was 3800 meters. May be the gain is the video card don't need to render those objects, many of then very simple because of LOD and distance, the object is still there, consuming processor. Share this post Link to post Share on other sites