Simulation tweaks

- Added an option to completely disable Simulation for specific Base
Parts.
- Added Base Parts without animations to this array.
- Removed Base Objects Init (mpAddEventhandler "mpKilled") from
indestructible Base Objects, as it is not needed.
- Moved Dynamicsimulation server side (not needed client side)
- Resorted epochonfig.hpp
All changes are running on our Server without any problems and with a
good performance boost, as the dynamicsimulationhandler has not to
handle a few thousand objects anymore
This commit is contained in:
He-Man 2017-11-30 22:59:29 +01:00
parent f582311331
commit 8ab05047e9
16 changed files with 217 additions and 181 deletions

View File

@ -1,14 +1,12 @@
serverRestart = "false"; // true sends #shutdown command to server after the time specified in ForceRestartTime serverRestart = "false"; // true sends #shutdown command to server after the time specified in ForceRestartTime
forceRestartTime = 14400; // 4 hour restarts forceRestartTime = 14400; // 4 hour restarts
StorageSlotsLimit = 1500; // Max storage slots allowed. Warning! Higher the number lower performance.
BuildingSlotsLimit = 1500; // Max building slots allowed. Warning! Higher the number lower performance.
// Time based // Time based
StaticDateTime[] = {}; // {0,0,0,8,0} would forces the server to start at 8am each time it is started while allowing the year, month and day to stay real time. Any values left at 0 will result in no change. StaticDateTime[] = {}; // {0,0,0,8,0} would forces the server to start at 8am each time it is started while allowing the year, month and day to stay real time. Any values left at 0 will result in no change.
timeDifference = 0; // Server uses real time this will allow you to offset just the hour. timeDifference = 0; // Server uses real time this will allow you to offset just the hour.
timeMultiplier = 4; // Sets a time multiplier for in-game time. The command range is now capped at 0.1 - 120 to avoid performance problems. timeMultiplier = 4; // Sets a time multiplier for in-game time. The command range is now capped at 0.1 - 120 to avoid performance problems.
lootMultiplier = 0.5; // 1 = max loot bias. This controls how much loot can payout per Epoch loot container. lootMultiplier = 0.5; // 1 = max loot bias. This controls how much loot can payout per Epoch loot container.
// Events // Events
WeatherStaticForecast[] = {}; // Default: {75.5,0,{0,0,0},0,{1,1}}; // Clear day; {19,1,{1,1,40},1,{5,5}}; // Cold Foggy Rainy Overcast Windy; Format: {temp <scalar>,rain <scalar>,fog <array>,overcast <scalar>,wind <array>} WeatherStaticForecast[] = {}; // Default: {75.5,0,{0,0,0},0,{1,1}}; // Clear day; {19,1,{1,1,40},1,{5,5}}; // Cold Foggy Rainy Overcast Windy; Format: {temp <scalar>,rain <scalar>,fog <array>,overcast <scalar>,wind <array>}
events[] = { events[] = {
@ -72,6 +70,8 @@ removevehmagazinesturret[] = { // Remove these Magazines from the given Turret f
disableVehicleTIE = "true"; disableVehicleTIE = "true";
// BaseBuilding // BaseBuilding
StorageSlotsLimit = 1500; // Max storage slots allowed. Warning! Higher the number lower performance.
BuildingSlotsLimit = 1500; // Max building slots allowed. Warning! Higher the number lower performance.
UseIndestructible = "false"; // Enable / Disable Indestructible BaseObjects UseIndestructible = "false"; // Enable / Disable Indestructible BaseObjects
IndestructibleBaseObjects[] = { // Can be Names or Classes IndestructibleBaseObjects[] = { // Can be Names or Classes
"Constructions_static_F", "Constructions_static_F",
@ -86,10 +86,40 @@ ExceptedBaseObjects[] = { // Not Indestructible, also if in a Class of Indestr
"WoodLargeWallDoor_EPOCH", "WoodLargeWallDoor_EPOCH",
"WoodWall4_EPOCH" "WoodWall4_EPOCH"
}; };
UseDeSimulateObjects = "true"; // Disable Simulation for specifed Base Objects
DeSimulateObjects[] = { // Base Objects to disable Simulation. Can be Names or Classes
"PlotPole_EPOCH",
"WoodFoundation_EPOCH","Foundation_EPOCH",
"WoodQuarterFloor_EPOCH","WoodHalfFloor_EPOCH","WoodFloor_EPOCH",
"MetalQuarterFloor_EPOCH","MetalHalfFloor_EPOCH","MetalFloor_EPOCH",
"CinderQuarterFloor_EPOCH","CinderHalfFloor_EPOCH","CinderFloor_EPOCH",
"WoodLargeWall_EPOCH","WoodLargeWallDoorway_EPOCH","WoodLargeWallCor_EPOCH","WoodWall1_EPOCH","WoodWall2_EPOCH","WoodWallWindow_EPOCH",
"CinderWallHalf_EPOCH","CinderWall_EPOCH",
"WoodRamp_EPOCH","WoodStairs_EPOCH","WoodStairs2_EPOCH",
"SolarGen_EPOCH","SandbagWall_EPOCH","BarbedWire_EPOCH","Sink_EPOCH","BagBunker_EPOCH","WaterPump_EPOCH","Scaffolding_EPOCH","SunShade_EPOCH","WatchTower_EPOCH","SandbagWallLong_EPOCH","TankTrap_EPOCH"
};
ExceptedDeSymObjects[] = { // Not Desymulated, also if in a Class of DeSimulateObjects
};
// Dynamic Simulation System
enableDynamicSimulationSystem = "true"; // enable / disable the complete dynamic simulation system
//Individual toggles for testing
vehicleDynamicSimulationSystem = "true"; // type car, air, boat
playerDynamicSimulationSystem = "true"; // clients
baseDynamicSimulationSystem = "true"; // plot pole and base pieces
// Distances and Coef
isMovingCoefValue = 2;
groupDynSimDistance = 500;
vehicleDynSimDistance = 350;
emptyVehicleDynSimDistance = 250;
propDynSimDistance = 50;
// Traders // Traders
taxRate = 0.1; // controls the price increase for purchases taxRate = 0.1; // controls the price increase for purchases
starterTraderItems[] = { { "ItemSodaBurst", "meatballs_epoch", "MortarBucket", "CinderBlocks", "VehicleRepair", "CircuitParts", "ItemCorrugated", "PartPlankPack", "ItemRock", "ItemRope", "ItemStick" }, { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 } }; // Starter Items for fresh spawned trader first array is classnames second is quantity. starterTraderItems[] = { // Starter Items for fresh spawned trader first array is classnames second is quantity.
{"ItemSodaBurst","meatballs_epoch","MortarBucket","CinderBlocks","VehicleRepair","CircuitParts","ItemCorrugated","PartPlankPack","ItemRock","ItemRope","ItemStick"},
{5,5,5,5,5,5,5,5,5,5,5}
};
NPCSlotsLimit = 30; // Max number of traders static or dynamic. Warning! Higher the number lower performance. NPCSlotsLimit = 30; // Max number of traders static or dynamic. Warning! Higher the number lower performance.
forceStaticTraders = "true"; // disables traders moving from work to home forceStaticTraders = "true"; // disables traders moving from work to home

View File

@ -13,7 +13,7 @@
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/init/both_init.sqf https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/init/both_init.sqf
*/ */
//[[[cog import generate_private_arrays ]]] //[[[cog import generate_private_arrays ]]]
private ["_cfgDynamicSimulation","_communityStatsInit","_customVarsInit","_dynSimToggle"]; private ["_communityStatsInit","_customVarsInit","_dynSimToggle"];
//[[[end]]] //[[[end]]]
// Check if Advanced Vehicle Repair is enabled // Check if Advanced Vehicle Repair is enabled
@ -71,16 +71,3 @@ EPOCH_group_upgrade_lvl = ["CfgEpochClient", "group_upgrade_lvl", [4,"100",6,"30
// disable remote sensors on server and client as all Epoch AI is local to the side controlling it. // disable remote sensors on server and client as all Epoch AI is local to the side controlling it.
disableRemoteSensors (["CfgEpochClient", "disableRemoteSensors", true] call EPOCH_fnc_returnConfigEntryV2); disableRemoteSensors (["CfgEpochClient", "disableRemoteSensors", true] call EPOCH_fnc_returnConfigEntryV2);
// Enable Dynamic simulation on both server and clients (maybe only needed server side)
// DynSim is handled locally and yes server and clients will need these configurations
_dynSimToggle = ["CfgDynamicSimulation", "enableDynamicSimulationSystem", true] call EPOCH_fnc_returnConfigEntryV2;
enableDynamicSimulationSystem _dynSimToggle;
if(_dynSimToggle)then
{
_cfgDynamicSimulation = 'CfgDynamicSimulation' call EPOCH_returnConfig;
"IsMoving" setDynamicSimulationDistanceCoef getNumber(_cfgDynamicSimulation >> "isMovingCoefValue");
"Group" setDynamicSimulationDistance getNumber(_cfgDynamicSimulation >> "groupDynSimDistance");
"Vehicle" setDynamicSimulationDistance getNumber(_cfgDynamicSimulation >> "vehicleDynSimDistance");
"EmptyVehicle" setDynamicSimulationDistance getNumber(_cfgDynamicSimulation >> "emptyVehicleDynSimDistance");
"Prop" setDynamicSimulationDistance getNumber(_cfgDynamicSimulation >> "propDynSimDistance");
};

View File

@ -1,17 +0,0 @@
class CfgDynamicSimulation
{
//If this is false none of the below settings matter
enableDynamicSimulationSystem = true;
//Individual toggles for testing
vehicleDynamicSimulationSystem = true; // type car, air, boat
playerDynamicSimulationSystem = true; // clients
baseDynamicSimulationSystem = true; // plot pole and base pieces
// Distances and Coef
isMovingCoefValue = 3;
groupDynSimDistance = 1600;
vehicleDynSimDistance = 1600;
emptyVehicleDynSimDistance = 1600;
propDynSimDistance = 1600;
};

View File

@ -88,7 +88,6 @@ showHUD[] =
#include "Configs\CfgSwitchMovehandler.hpp" #include "Configs\CfgSwitchMovehandler.hpp"
#include "Configs\CfgVehicleUpgrades.hpp" #include "Configs\CfgVehicleUpgrades.hpp"
#include "Configs\CfgReadingDocuments.hpp" #include "Configs\CfgReadingDocuments.hpp"
#include "Configs\CfgDynamicSimulation.hpp"
#include "Configs\CfgMarkerSets.hpp" #include "Configs\CfgMarkerSets.hpp"
// A3 specific configs // A3 specific configs

View File

@ -13,13 +13,17 @@
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server/compile/epoch_bases/EPOCH_server_loadBuildings.sqf https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server/compile/epoch_bases/EPOCH_server_loadBuildings.sqf
*/ */
//[[[cog import generate_private_arrays ]]] //[[[cog import generate_private_arrays ]]]
private ["_ExceptedBaseObjects","_IndestructibleBaseObjects","_UseIndestructible","_VAL","_ammoClass","_ammoObj","_anims","_animsData","_arr","_arrCount","_baseObj","_buildingJammerRange","_cfgBaseBuilding","_cfgEpochClient","_class","_color","_damage","_location","_marker","_maxTTL","_owner","_response","_serverSettingsConfig","_storageSlot","_textureSlot","_ttl","_vehHiveKey","_worldspace"]; private ["_Simulated","_DamageAllowed","_ExceptedBaseObjects","_IndestructibleBaseObjects","_UseIndestructible","_VAL","_ammoClass","_ammoObj","_anims","_animsData","_arr","_arrCount","_baseObj","_buildingJammerRange","_cfgBaseBuilding","_cfgEpochClient","_class","_color","_damage","_location","_marker","_maxTTL","_owner","_response","_serverSettingsConfig","_storageSlot","_textureSlot","_ttl","_vehHiveKey","_worldspace"];
//[[[end]]] //[[[end]]]
_maxTTL = parseNumber EPOCH_expiresBuilding; _maxTTL = parseNumber EPOCH_expiresBuilding;
_serverSettingsConfig = configFile >> "CfgEpochServer"; _serverSettingsConfig = configFile >> "CfgEpochServer";
_baseDynamicSimulationSystem = [_serverSettingsConfig, "baseDynamicSimulationSystem", true] call EPOCH_fnc_returnConfigEntry;
_UseIndestructible = [_serverSettingsConfig, "UseIndestructible", false] call EPOCH_fnc_returnConfigEntry; _UseIndestructible = [_serverSettingsConfig, "UseIndestructible", false] call EPOCH_fnc_returnConfigEntry;
_IndestructibleBaseObjects = [_serverSettingsConfig, "IndestructibleBaseObjects", []] call EPOCH_fnc_returnConfigEntry; _IndestructibleBaseObjects = [_serverSettingsConfig, "IndestructibleBaseObjects", []] call EPOCH_fnc_returnConfigEntry;
_ExceptedBaseObjects = [_serverSettingsConfig, "ExceptedBaseObjects", []] call EPOCH_fnc_returnConfigEntry; _ExceptedBaseObjects = [_serverSettingsConfig, "ExceptedBaseObjects", []] call EPOCH_fnc_returnConfigEntry;
_UseDeSimulateObjects = [_serverSettingsConfig, "UseDeSimulateObjects", true] call EPOCH_fnc_returnConfigEntry;
_DeSimulateObjects = [_serverSettingsConfig, "DeSimulateObjects", []] call EPOCH_fnc_returnConfigEntry;
_ExceptedDeSymObjects = [_serverSettingsConfig, "ExceptedDeSymObjects", []] call EPOCH_fnc_returnConfigEntry;
_cfgEpochClient = 'CfgEpochClient' call EPOCH_returnConfig; _cfgEpochClient = 'CfgEpochClient' call EPOCH_returnConfig;
_cfgBaseBuilding = 'CfgBaseBuilding' call EPOCH_returnConfig; _cfgBaseBuilding = 'CfgBaseBuilding' call EPOCH_returnConfig;
_buildingJammerRange = getNumber(_cfgEpochClient >> "buildingJammerRange"); _buildingJammerRange = getNumber(_cfgEpochClient >> "buildingJammerRange");
@ -30,6 +34,8 @@ _VAL = ["", [], "", "", 0, []];
for "_i" from 0 to _this do { for "_i" from 0 to _this do {
_vehHiveKey = format ["%1:%2", (call EPOCH_fn_InstanceID),_i]; _vehHiveKey = format ["%1:%2", (call EPOCH_fn_InstanceID),_i];
_response = ["Building", _vehHiveKey] call EPOCH_fnc_server_hiveGETTTL; _response = ["Building", _vehHiveKey] call EPOCH_fnc_server_hiveGETTTL;
_Simulated = true;
_DamageAllowed = true;
if ((_response select 0) == 1 && (_response select 1) isEqualType [] && !((_response select 1) isEqualTo [])) then { if ((_response select 0) == 1 && (_response select 1) isEqualType [] && !((_response select 1) isEqualTo [])) then {
_arr = _response select 1; _arr = _response select 1;
@ -81,20 +87,30 @@ for "_i" from 0 to _this do {
_baseObj = createVehicle [_class, [0,0,0], [], 0, "CAN_COLLIDE"]; _baseObj = createVehicle [_class, [0,0,0], [], 0, "CAN_COLLIDE"];
if (_UseIndestructible) then { if (_UseIndestructible) then {
if ({_baseObj iskindof _x} count _ExceptedBaseObjects == 0) then { if ({_class iskindof _x} count _ExceptedBaseObjects == 0) then {
{ {
if (_baseObj iskindof _x) exitwith { if (_class iskindof _x) exitwith {
_baseObj allowdamage false; _baseObj allowdamage false;
_DamageAllowed = false;
}; };
} foreach _IndestructibleBaseObjects; } foreach _IndestructibleBaseObjects;
}; };
}; };
if (_UseDeSimulateObjects) then {
if ({_class iskindof _x} count _ExceptedDeSymObjects == 0) then {
{
if (_class iskindof _x) exitwith {
_baseObj enablesimulationglobal false;
_Simulated = false;
};
} foreach _DeSimulateObjects;
};
};
_baseObj setposATL _location; _baseObj setposATL _location;
_baseObj setVectorDirAndUp _worldspace; _baseObj setVectorDirAndUp _worldspace;
if (_Simulated && _baseDynamicSimulationSystem) then { // Only needed, if simulation is not disabled
// new Dynamicsimulation // new Dynamicsimulation
if(["CfgDynamicSimulation", "baseDynamicSimulationSystem", true] call EPOCH_fnc_returnConfigEntryV2)then
{
_baseObj enableSimulationGlobal false; // turn off sim on server start, let dynSim activate it to true _baseObj enableSimulationGlobal false; // turn off sim on server start, let dynSim activate it to true
_baseObj enableDynamicSimulation true; _baseObj enableDynamicSimulation true;
_baseObj triggerDynamicSimulation false; // this object doesnt need to turn anything on in the server _baseObj triggerDynamicSimulation false; // this object doesnt need to turn anything on in the server
@ -138,7 +154,9 @@ for "_i" from 0 to _this do {
}; };
_baseObj setDamage _damage; _baseObj setDamage _damage;
if (_DamageAllowed) then { // Only needed, if damage is allowed
_baseObj call EPOCH_server_buildingInit; _baseObj call EPOCH_server_buildingInit;
};
_baseObj setVariable ["BUILD_SLOT", _i, true]; _baseObj setVariable ["BUILD_SLOT", _i, true];
if (_owner != "-1") then { if (_owner != "-1") then {

View File

@ -13,7 +13,7 @@
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server/compile/epoch_bases/EPOCH_server_saveBuilding.sqf https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server/compile/epoch_bases/EPOCH_server_saveBuilding.sqf
*/ */
//[[[cog import generate_private_arrays ]]] //[[[cog import generate_private_arrays ]]]
private ["_ExceptedBaseObjects","_IndestructibleBaseObjects","_UseIndestructible","_cfgBaseBuilding","_findnextslot","_newVehicle","_objSlot","_oemType","_playerUID","_serverSettingsConfig","_slot","_staticClass","_staticClassConfig","_storageObj","_vehiclePos"]; private ["_cfgBaseBuilding","_findnextslot","_newVehicle","_objSlot","_oemType","_playerUID","_serverSettingsConfig","_slot","_staticClass","_staticClassConfig","_storageObj","_vehiclePos"];
//[[[end]]] //[[[end]]]
params ["_vehicle", "_player", ["_token","",[""]] ]; params ["_vehicle", "_player", ["_token","",[""]] ];
@ -25,10 +25,6 @@ _playerUID = getPlayerUID _player;
if (!isNull ropeAttachedTo _vehicle) exitWith{}; if (!isNull ropeAttachedTo _vehicle) exitWith{};
_oemType = typeOf _vehicle; _oemType = typeOf _vehicle;
_serverSettingsConfig = configFile >> "CfgEpochServer";
_UseIndestructible = [_serverSettingsConfig, "UseIndestructible", false] call EPOCH_fnc_returnConfigEntry;
_IndestructibleBaseObjects = [_serverSettingsConfig, "IndestructibleBaseObjects", []] call EPOCH_fnc_returnConfigEntry;
_ExceptedBaseObjects = [_serverSettingsConfig, "ExceptedBaseObjects", []] call EPOCH_fnc_returnConfigEntry;
_cfgBaseBuilding = 'CfgBaseBuilding' call EPOCH_returnConfig; _cfgBaseBuilding = 'CfgBaseBuilding' call EPOCH_returnConfig;
_staticClassConfig = (_cfgBaseBuilding >> _oemType >> "staticClass"); _staticClassConfig = (_cfgBaseBuilding >> _oemType >> "staticClass");
if (isText _staticClassConfig) then { if (isText _staticClassConfig) then {
@ -51,16 +47,6 @@ if (isText _staticClassConfig) then {
EPOCH_activeGardens pushBackUnique _storageObj; EPOCH_activeGardens pushBackUnique _storageObj;
}; };
if (_UseIndestructible) then {
if ({_storageObj iskindof _x} count _ExceptedBaseObjects == 0) then {
{
if (_storageObj iskindof _x) exitwith {
_storageObj allowdamage false;
};
} foreach _IndestructibleBaseObjects;
};
};
if (getNumber(_cfgBaseBuilding >> _staticClass >> "isSecureStorage") == 1) then{ if (getNumber(_cfgBaseBuilding >> _staticClass >> "isSecureStorage") == 1) then{
_storageObj setVariable["EPOCH_Locked", false, true]; _storageObj setVariable["EPOCH_Locked", false, true];
}; };
@ -70,8 +56,9 @@ if (isText _staticClassConfig) then {
_storageObj setVariable["STORAGE_SLOT", _slot, true]; _storageObj setVariable["STORAGE_SLOT", _slot, true];
_storageObj call EPOCH_server_save_storage; _storageObj call EPOCH_server_save_storage;
if (isDamageAllowed _storageObj) then { // Only needed, if damage is allowed
_storageObj call EPOCH_server_storageInit; _storageObj call EPOCH_server_storageInit;
};
diag_log format["Epoch: STORAGE: %1 created storage %2 at %3 with slot %4", _playerUID, _staticClass, _vehiclePos, _slot]; diag_log format["Epoch: STORAGE: %1 created storage %2 at %3 with slot %4", _playerUID, _staticClass, _vehiclePos, _slot];
}; };
@ -95,16 +82,6 @@ if (isText _staticClassConfig) then {
if (_objSlot != -1) then { if (_objSlot != -1) then {
_newVehicle = [_vehicle, false] call EPOCH_server_simulSwap; _newVehicle = [_vehicle, false] call EPOCH_server_simulSwap;
if (_UseIndestructible) then {
if ({_newVehicle iskindof _x} count _ExceptedBaseObjects == 0) then {
{
if (_newVehicle iskindof _x) exitwith {
_newVehicle allowdamage false;
};
} foreach _IndestructibleBaseObjects;
};
};
_newVehicle setVariable["BUILD_OWNER", _playerUID, true]; _newVehicle setVariable["BUILD_OWNER", _playerUID, true];
_newVehicle call EPOCH_saveBuilding; _newVehicle call EPOCH_saveBuilding;
}; };

View File

@ -35,12 +35,12 @@ if (_objSlot != -1) then {
_textureSlot = _object getVariable["TEXTURE_SLOT", 0]; _textureSlot = _object getVariable["TEXTURE_SLOT", 0];
_damage = damage _object; _damage = damage _object;
//_worldspace = [getposATL _object,vectordir _object,vectorup _object];
//_newObj = createVehicle [_class, [0,0,0], [], 0, "CAN_COLLIDE"];
_newObj = [_class,_object] call EPOCH_swapBuilding; _newObj = [_class,_object] call EPOCH_swapBuilding;
_newObj setVariable ["BUILD_SLOT",_objSlot,true]; _newObj setVariable ["BUILD_SLOT",_objSlot,true];
if (isDamageAllowed _newObj) then { // Only needed, if damage is allowed
_newObj call EPOCH_server_buildingInit; _newObj call EPOCH_server_buildingInit;
};
if (_textureSlot != 0) then { if (_textureSlot != 0) then {
// get texture path from index // get texture path from index

View File

@ -29,7 +29,9 @@ if (_objSlot != -1) then {
_class = _upgrade select 0; _class = _upgrade select 0;
_newObj = [_class,_object] call EPOCH_swapBuilding; _newObj = [_class,_object] call EPOCH_swapBuilding;
_newObj setVariable ["BUILD_SLOT",_objSlot,true]; _newObj setVariable ["BUILD_SLOT",_objSlot,true];
if (isDamageAllowed _newObj) then { // Only needed, if damage is allowed
_newObj call EPOCH_server_buildingInit; _newObj call EPOCH_server_buildingInit;
};
_newObj call EPOCH_saveBuilding; _newObj call EPOCH_saveBuilding;
}; };
} else { } else {

View File

@ -10,12 +10,41 @@ if (!isNull _object && !(_class isEqualTo "")) then {
if (!isNull _newObj) then { if (!isNull _newObj) then {
_object hideObjectGlobal true; _object hideObjectGlobal true;
_serverSettingsConfig = configFile >> "CfgEpochServer";
_UseIndestructible = [_serverSettingsConfig, "UseIndestructible", false] call EPOCH_fnc_returnConfigEntry;
_IndestructibleBaseObjects = [_serverSettingsConfig, "IndestructibleBaseObjects", []] call EPOCH_fnc_returnConfigEntry;
_ExceptedBaseObjects = [_serverSettingsConfig, "ExceptedBaseObjects", []] call EPOCH_fnc_returnConfigEntry;
_UseDeSimulateObjects = [_serverSettingsConfig, "UseDeSimulateObjects", true] call EPOCH_fnc_returnConfigEntry;
_DeSimulateObjects = [_serverSettingsConfig, "DeSimulateObjects", []] call EPOCH_fnc_returnConfigEntry;
_ExceptedDeSymObjects = [_serverSettingsConfig, "ExceptedDeSymObjects", []] call EPOCH_fnc_returnConfigEntry;
_Simulated = true;
if (_UseIndestructible) then {
if ({_class iskindof _x} count _ExceptedBaseObjects == 0) then {
{
if (_class iskindof _x) exitwith {
_newObj allowdamage false;
};
} foreach _IndestructibleBaseObjects;
};
};
if (_UseDeSimulateObjects) then {
if ({_class iskindof _x} count _ExceptedDeSymObjects == 0) then {
{
if (_class iskindof _x) exitwith {
_newObj enablesimulationglobal false;
_Simulated = false;
};
} foreach _DeSimulateObjects;
};
};
if (_Simulated) then { // Only needed, if simulation is not disabled
// new Dynamicsimulation // new Dynamicsimulation
if(["CfgDynamicSimulation", "baseDynamicSimulationSystem", true] call EPOCH_fnc_returnConfigEntryV2)then if([configFile >> "CfgEpochServer", "baseDynamicSimulationSystem", true] call EPOCH_fnc_returnConfigEntry)then
{ {
_newObj enableDynamicSimulation true; _newObj enableDynamicSimulation true;
_newObj triggerDynamicSimulation false; // this object doesnt need to turn anything on in the server _newObj triggerDynamicSimulation false; // this object doesnt need to turn anything on in the server
}; };
};
switch (_method) do { switch (_method) do {
case 0: { case 0: {

View File

@ -369,7 +369,7 @@ if (!isNull _player) then {
// [] remoteExec ["bis_fnc_reviveInit",_player]; // [] remoteExec ["bis_fnc_reviveInit",_player];
// new Dynamicsimulation // new Dynamicsimulation
if(["CfgDynamicSimulation", "playerDynamicSimulationSystem", true] call EPOCH_fnc_returnConfigEntryV2)then if([configFile >> "CfgEpochServer", "playerDynamicSimulationSystem", true] call EPOCH_fnc_returnConfigEntry)then
{ {
_newPlyr enableDynamicSimulation true; _newPlyr enableDynamicSimulation true;
_newPlyr triggerDynamicSimulation true; _newPlyr triggerDynamicSimulation true;

View File

@ -102,7 +102,7 @@ if (!local _player) then {
_newPlyr = _group createUnit[_class, _location, [], 0, "CAN_COLLIDE"]; _newPlyr = _group createUnit[_class, _location, [], 0, "CAN_COLLIDE"];
// new Dynamicsimulation // new Dynamicsimulation
if(["CfgDynamicSimulation", "playerDynamicSimulationSystem", true] call EPOCH_fnc_returnConfigEntryV2)then if([configFile >> "CfgEpochServer", "playerDynamicSimulationSystem", true] call EPOCH_fnc_returnConfigEntry)then
{ {
_newPlyr enableDynamicSimulation true; _newPlyr enableDynamicSimulation true;
_newPlyr triggerDynamicSimulation true; _newPlyr triggerDynamicSimulation true;

View File

@ -102,7 +102,7 @@ if !(_debugBox isEqualTo "") then {
if((_deSimulate) || (_disableSim isEqualTo "true"))then{ if((_deSimulate) || (_disableSim isEqualTo "true"))then{
_ep enableSimulationGlobal false; _ep enableSimulationGlobal false;
}; };
if(["CfgDynamicSimulation", "enableDynamicSimulationSystem", true] call EPOCH_fnc_returnConfigEntryV2)then{ if([configFile >> "CfgEpochServer", "enableDynamicSimulationSystem", true] call EPOCH_fnc_returnConfigEntry)then
_ep enableDynamicSimulation (_dynSim isEqualTo "true"); _ep enableDynamicSimulation (_dynSim isEqualTo "true");
}; };
_ep allowDamage (_allowDmg isEqualTo "true"); _ep allowDamage (_allowDmg isEqualTo "true");

View File

@ -29,6 +29,7 @@ _jammerRange = getNumber(_config >> "buildingJammerRange");
_serverSettingsConfig = configFile >> "CfgEpochServer"; _serverSettingsConfig = configFile >> "CfgEpochServer";
_immuneIfStartInBase = [_serverSettingsConfig, "immuneIfStartInBase", true] call EPOCH_fnc_returnConfigEntry; _immuneIfStartInBase = [_serverSettingsConfig, "immuneIfStartInBase", true] call EPOCH_fnc_returnConfigEntry;
_vehicleDynamicSimulationSystem = [_serverSettingsConfig, "vehicleDynamicSimulationSystem", true] call EPOCH_fnc_returnConfigEntry;
_removeweapons = [_serverSettingsConfig, "removevehweapons", []] call EPOCH_fnc_returnConfigEntry; _removeweapons = [_serverSettingsConfig, "removevehweapons", []] call EPOCH_fnc_returnConfigEntry;
_removemagazinesturret = [_serverSettingsConfig, "removevehmagazinesturret", []] call EPOCH_fnc_returnConfigEntry; _removemagazinesturret = [_serverSettingsConfig, "removevehmagazinesturret", []] call EPOCH_fnc_returnConfigEntry;
@ -213,7 +214,7 @@ for "_i" from 1 to _maxVehicleLimit do {
}; };
// new Dynamicsimulation // new Dynamicsimulation
if(["CfgDynamicSimulation", "vehicleDynamicSimulationSystem", true] call EPOCH_fnc_returnConfigEntryV2)then if(_vehicleDynamicSimulationSystem)then
{ {
_vehicle enableSimulationGlobal false; // turn it off until activated by dynamicSim _vehicle enableSimulationGlobal false; // turn it off until activated by dynamicSim
_vehicle enableDynamicSimulation true; _vehicle enableDynamicSimulation true;

View File

@ -99,7 +99,7 @@ _newHitpoints = getAllHitPointsDamage _newVeh;
} foreach (_OldHitPoints select 0); } foreach (_OldHitPoints select 0);
// new Dynamicsimulation // new Dynamicsimulation
if(["CfgDynamicSimulation", "vehicleDynamicSimulationSystem", true] call EPOCH_fnc_returnConfigEntryV2)then if([configFile >> "CfgEpochServer", "vehicleDynamicSimulationSystem", true] call EPOCH_fnc_returnConfigEntry)then
{ {
_newveh enableSimulationGlobal false; // turn it off until activated by dynamicSim _newveh enableSimulationGlobal false; // turn it off until activated by dynamicSim
_newveh enableDynamicSimulation true; _newveh enableDynamicSimulation true;

View File

@ -115,7 +115,7 @@ if !(isNull _vehObj) then{
}; };
// new Dynamicsimulation // new Dynamicsimulation
if(["CfgDynamicSimulation", "vehicleDynamicSimulationSystem", true] call EPOCH_fnc_returnConfigEntryV2)then if([configFile >> "CfgEpochServer", "vehicleDynamicSimulationSystem", true] call EPOCH_fnc_returnConfigEntry)then
{ {
_vehObj enableSimulationGlobal false; // turn it off until activated by dynamicSim _vehObj enableSimulationGlobal false; // turn it off until activated by dynamicSim
_vehObj enableDynamicSimulation true; _vehObj enableDynamicSimulation true;

View File

@ -91,7 +91,17 @@ diag_log "Epoch: Init Variables";
call compile preprocessFileLineNumbers "\epoch_server\init\server_variables.sqf"; call compile preprocessFileLineNumbers "\epoch_server\init\server_variables.sqf";
call compile preprocessFileLineNumbers "\epoch_server\init\server_securityfunctions.sqf"; call compile preprocessFileLineNumbers "\epoch_server\init\server_securityfunctions.sqf";
// Enable Dynamic simulation
_dynSimToggle = [_serverSettingsConfig, "enableDynamicSimulationSystem", true] call EPOCH_fnc_returnConfigEntry;
enableDynamicSimulationSystem _dynSimToggle;
if(_dynSimToggle)then
{
"IsMoving" setDynamicSimulationDistanceCoef ([_serverSettingsConfig, "isMovingCoefValue", 2] call EPOCH_fnc_returnConfigEntry);
"Group" setDynamicSimulationDistance ([_serverSettingsConfig, "groupDynSimDistance", 500] call EPOCH_fnc_returnConfigEntry);
"Vehicle" setDynamicSimulationDistance ([_serverSettingsConfig, "vehicleDynSimDistance", 350] call EPOCH_fnc_returnConfigEntry);
"EmptyVehicle" setDynamicSimulationDistance ([_serverSettingsConfig, "emptyVehicleDynSimDistance", 250] call EPOCH_fnc_returnConfigEntry);
"Prop" setDynamicSimulationDistance ([_serverSettingsConfig, "propDynSimDistance", 500] call EPOCH_fnc_returnConfigEntry);
};
["I", _instanceID, "86400", ["CONTINUE"]] call EPOCH_fnc_server_hiveSETEX; ["I", _instanceID, "86400", ["CONTINUE"]] call EPOCH_fnc_server_hiveSETEX;
diag_log format["Epoch: Start Hive, Instance ID: '%1'", _instanceID]; diag_log format["Epoch: Start Hive, Instance ID: '%1'", _instanceID];