diff --git a/src/AI/Commander/AICommander.hpp b/src/AI/Commander/AICommander.hpp index 3e6b0a335..e59c87db5 100644 --- a/src/AI/Commander/AICommander.hpp +++ b/src/AI/Commander/AICommander.hpp @@ -131,18 +131,22 @@ #define ENEMY_CLUSTER_EFF_MAX [30, 7, 6, 2, 9999, 9999, 9999, 9999, 9999, 9999, 9999, 9999, 9999, 9999] // Max amount of simultaneous actions -#define CMDR_MAX_TAKE_OUTPOST_ACTIONS 3 +#define CMDR_MAX_TAKE_OUTPOST_ACTIONS 2 #define CMDR_MAX_REINFORCE_ACTIONS 3 -#define CMDR_MAX_SUPPLY_ACTIONS 3 +#define CMDR_MAX_SUPPLY_ACTIONS 6 #define CMDR_MAX_OFFICER_ASSIGNMENT_ACTIONS 3 -//#define CMDR_MAX_ATTACK_ACTIONS 100 QRFs are unlimited +// QRF actions +#define CMDR_MAX_ATTACK_ACTIONS 4 #define CMDR_MAX_PATROL_ACTIONS 6 -#define CMDR_MAX_CONSTRUCT_ACTIONS 3 +#define CMDR_MAX_CONSTRUCT_ACTIONS 2 // Max amount of units at airfields #define CMDR_MAX_INF_AIRFIELD 80 #define CMDR_MAX_VEH_AIRFIELD 25 +// Max amount of ground vehicles which can be imported at each external reinforcement +#define CMDR_MAX_GROUND_VEH_EACH_EXTERNAL_REINFORCEMENT 5 + #ifdef OOP_ASSERT #define ASSERT_CLUSTER_ACTUAL_OR_NULL(actual) \ ASSERT_MSG(actual isEqualType [], QUOTE(actual) + " is invalid type. It should be an array."); \ @@ -182,5 +186,5 @@ // This maps activity=value like: 25=~0.5, 100=1, 1000=~2 #define __ACTIVITY_FUNCTION(rawActivity) (log (0.09 * MAP_LINEAR_SET_POINT(vin_diff_global, 0.2, 1, 3) * (rawActivity) + 1)) -// https://www.desmos.com/calculator/yxhaqijv19 -#define __DAMAGE_FUNCTION(rawDamage, campaignProgress) (exp(-0.2 * (1 - sqrt(0.9 * MAP_GAMMA(vin_diff_global, campaignProgress))) * (rawDamage)) - 0.1) +// https://www.desmos.com/calculator/vgvrm8x3un +#define __DAMAGE_FUNCTION(rawDamage, campaignProgress) (exp(-0.5 * (1 - sqrt(0.9 * MAP_GAMMA(vin_diff_global, campaignProgress))) * (rawDamage - 8)) - 0.1) diff --git a/src/AI/Commander/AICommander.sqf b/src/AI/Commander/AICommander.sqf index 802d3ec42..338840c08 100644 --- a/src/AI/Commander/AICommander.sqf +++ b/src/AI/Commander/AICommander.sqf @@ -2121,6 +2121,11 @@ http://patorjk.com/software/taag/#p=display&f=Univers&t=CMDR%20AI params [P_THISOBJECT, P_OOP_OBJECT("_worldNow"), P_OOP_OBJECT("_worldFuture")]; private _side = T_GETV("side"); + // Limit amount of concurrent actions + private _activeActions = T_GETV("activeActions"); + pr _count = {GET_OBJECT_CLASS(_x) == "QRFCmdrAction"} count _activeActions; + if (_count >= CMDR_MAX_ATTACK_ACTIONS) exitWith {[]}; + private _srcGarrisons = CALLM0(_worldNow, "getAliveGarrisons") select { // Must be on our side and not involved in another action (GETV(_x, "side") == _side) and @@ -3027,7 +3032,7 @@ http://patorjk.com/software/taag/#p=display&f=Univers&t=CMDR%20AI _loc, _generalGarrisons # 0, CALLSM1("Location", "getCapacityInfForType", LOCATION_TYPE_AIRPORT) - _nInf, - _nVehMax - _nVeh + (_nVehMax - _nVeh) min CMDR_MAX_GROUND_VEH_EACH_EXTERNAL_REINFORCEMENT ] } else { [] diff --git a/src/AI/Commander/CmdrAction/Actions/ConstructLocationCmdrAction.sqf b/src/AI/Commander/CmdrAction/Actions/ConstructLocationCmdrAction.sqf index cf872cea4..2288db301 100644 --- a/src/AI/Commander/CmdrAction/Actions/ConstructLocationCmdrAction.sqf +++ b/src/AI/Commander/CmdrAction/Actions/ConstructLocationCmdrAction.sqf @@ -241,7 +241,7 @@ CLASS("ConstructLocationCmdrAction", "CmdrAction") #ifndef RELEASE_BUILD private _delay = random 2; #else - private _delay = 50 * log (0.1 * _detachEffStrength + 1) * (1 + 2 * log (0.0003 * _dist + 1)) * 0.1 + 2 + (random 15 + 30); + private _delay = 75 * log (0.1 * _detachEffStrength + 1) * (1 + 2 * log (0.0003 * _dist + 1)) * 0.1 + 2 + (random 30 + 30); #endif // Shouldn't need to cap it, the functions above should always return something reasonable, if they don't then fix them! diff --git a/src/AI/Commander/CmdrAction/Actions/TakeLocationCmdrAction.sqf b/src/AI/Commander/CmdrAction/Actions/TakeLocationCmdrAction.sqf index 4d545e1d9..180d99c7c 100644 --- a/src/AI/Commander/CmdrAction/Actions/TakeLocationCmdrAction.sqf +++ b/src/AI/Commander/CmdrAction/Actions/TakeLocationCmdrAction.sqf @@ -208,7 +208,7 @@ CLASS("TakeLocationCmdrAction", "TakeOrJoinCmdrAction") #ifndef RELEASE_BUILD private _delay = random 2; #else - private _delay = 50 * log (0.1 * _detachEffStrength + 1) * (1 + 2 * log (0.0003 * _dist + 1)) * 0.1 + 2 + (random 15 + 30); + private _delay = 75 * log (0.1 * _detachEffStrength + 1) * (1 + 2 * log (0.0003 * _dist + 1)) * 0.1 + 2 + (random 30 + 30); #endif // Shouldn't need to cap it, the functions above should always return something reasonable, if they don't then fix them! diff --git a/src/AI/Commander/CmdrStrategy/CmdrStrategy.sqf b/src/AI/Commander/CmdrStrategy/CmdrStrategy.sqf index f109fd9af..8307e6f12 100644 --- a/src/AI/Commander/CmdrStrategy/CmdrStrategy.sqf +++ b/src/AI/Commander/CmdrStrategy/CmdrStrategy.sqf @@ -244,7 +244,7 @@ CLASS("CmdrStrategy", ["RefCounted" ARG "Storable"]) P_OOP_OBJECT("_tgtCluster"), P_ARRAY("_detachEff")]; private _tgtClusterPos = GETV(_tgtCluster, "pos"); - private _adjustedDamage = CALLM2(_worldNow, "getDamageScore", _tgtClusterPos, 1000); + private _adjustedDamage = CALLM2(_worldNow, "getDamageScore", _tgtClusterPos, 2500); APPLY_SCORE_STRATEGY(_defaultScore, _adjustedDamage) ENDMETHOD; @@ -381,7 +381,7 @@ CLASS("CmdrStrategy", ["RefCounted" ARG "Storable"]) P_OOP_OBJECT("_tgtLoc"), P_ARRAY("_detachEff")]; private _tgtPos = GETV(_tgtLoc, "pos"); - private _adjustedDamage = CALLM2(_worldNow, "getDamageScore", _tgtPos, 1000); + private _adjustedDamage = CALLM2(_worldNow, "getDamageScore", _tgtPos, 2500); APPLY_SCORE_STRATEGY(_defaultScore, _adjustedDamage) ENDMETHOD; diff --git a/src/GameManager/GameManager.sqf b/src/GameManager/GameManager.sqf index 9453356e9..cc3ddc1e6 100644 --- a/src/GameManager/GameManager.sqf +++ b/src/GameManager/GameManager.sqf @@ -523,7 +523,7 @@ CLASS("GameManager", "MessageReceiverEx") ENDMETHOD; vin_fnc_autoLoadMsg = { - diag_log _this; + diag_log ("[Vindicta Autoload] " + _this); ["autoloadwarning", [format ["%1
%2", LOCS("Vindicta_GameManager", "Autoload"), _this], "PLAIN", -1, true, true]] remoteExec ["cutText", ON_ALL, false]; ["autoloadwarning", 10] remoteExec ["cutFadeOut", ON_ALL, false]; }; @@ -543,6 +543,12 @@ CLASS("GameManager", "MessageReceiverEx") LOC("Autoload_NoSaves") call vin_fnc_autoLoadMsg; }; + // log + diag_log "[Vindicta Autoload] All saved games:"; + { + diag_log format [" %1", _x]; + } forEach _recordNamesAndHeaders; + // Check all headers for loadability pr _checkResult = T_CALLM1("checkAllHeadersForLoading", _recordNamesAndHeaders); @@ -554,6 +560,12 @@ CLASS("GameManager", "MessageReceiverEx") !(INCOMPATIBLE_WORLD_NAME in _x#1) }; + // Log + diag_log "[Vindicta Autoload] Saved games compatible for load:"; + { + diag_log format [" %1", _x]; + } forEach _dataForLoad; + if(count _dataForLoad == 0) exitWith { LOC("Autoload_NoSavesForMap") call vin_fnc_autoLoadMsg; }; @@ -562,6 +574,8 @@ CLASS("GameManager", "MessageReceiverEx") _dataForLoad#0 params ["_recordName", "_errors"]; + diag_log format ["[Vindicta Autoload] Selected saved game: %1", _recordName]; + if(INCOMPATIBLE_SAVE_VERSION in _errors) exitWith { LOC("Autoload_Version") call vin_fnc_autoLoadMsg; }; @@ -584,17 +598,19 @@ CLASS("GameManager", "MessageReceiverEx") private _autoLoadTime = PROCESS_TIME + 30; while { !IS_ADMIN_ON_DEDI && _autoLoadTime > PROCESS_TIME } do { sleep 0.5; - format [LOC("Autoload_CountDown"), _autoLoadTime - PROCESS_TIME] call vin_fnc_autoLoadMsg; + format [LOC("Autoload_CountDown"), ceil (_autoLoadTime - PROCESS_TIME)] call vin_fnc_autoLoadMsg; }; if(!IS_ADMIN_ON_DEDI) then { - T_CALLM2("postMethodAsync", "loadGame", [_recordName]); + pr _args = [_recordName, T_GETV("storageClassName")]; + T_CALLM2("postMethodAsync", "loadGame", _args); } else { LOC("Autoload_AdminAbort") call vin_fnc_autoLoadMsg; }; }; } else { - T_CALLM2("postMethodAsync", "loadGame", [_recordName]); + pr _args = [_recordName, T_GETV("storageClassName")]; + T_CALLM2("postMethodAsync", "loadGame", _args); }; #undef LOC_SCOPE diff --git a/src/GameMode/CivilWar/CivilWarGameMode.sqf b/src/GameMode/CivilWar/CivilWarGameMode.sqf index ed57ca24a..e0166ad58 100644 --- a/src/GameMode/CivilWar/CivilWarGameMode.sqf +++ b/src/GameMode/CivilWar/CivilWarGameMode.sqf @@ -387,7 +387,7 @@ CLASS("CivilWarGameMode", "GameModeBase") // _casualtiesRatio - value in range 0..1. Max when a certain amount of casualties was reached. pr _casualtiesRatio = 0; pr _casualties = T_GETV("casualties"); - _casualtiesRatio = _casualties / 400; + _casualtiesRatio = _casualties / 750; _casualtiesRatio = CLAMP(_casualtiesRatio, 0.0, 1.0); // Final aggression: diff --git a/src/UI/InGameMenu/InGameMenuTabGameModeInit.sqf b/src/UI/InGameMenu/InGameMenuTabGameModeInit.sqf index d71defad5..8722975fc 100644 --- a/src/UI/InGameMenu/InGameMenuTabGameModeInit.sqf +++ b/src/UI/InGameMenu/InGameMenuTabGameModeInit.sqf @@ -234,7 +234,7 @@ CLASS("InGameMenuTabGameModeInit", "DialogTabBase") private _foundForbiddenCharacter = false; (toArray _forbidden) findIf { private _xStr = toString [_x]; - private _id = _string find _xStr; + private _id = _campaignName find _xStr; if (_id != -1) exitWith { _foundForbiddenCharacter = true; true; }; false; }; diff --git a/src/Unit/Unit.sqf b/src/Unit/Unit.sqf index 9146564b2..18861e6f9 100644 --- a/src/Unit/Unit.sqf +++ b/src/Unit/Unit.sqf @@ -1188,15 +1188,16 @@ CLASS("Unit", ["Storable" ARG "GOAP_Agent"]) pr _nCargo = CALLM0(_gar, "countCargoUnits"); // Some number which scales the amount of items in this box - pr _nGuns = 1.3 * _nInf * _lootScaling / ((_nVeh + _nCargo) max 1); + pr __n = _nInf * _lootScaling / ((_nVeh + _nCargo) max 1); + pr _nGuns = 0.8 * __n; // Modifier for cargo boxes if (_catID == T_CARGO) then { - _nGuns = _nGuns * 3; + _nGuns = 6 * __n; }; // Add weapons and magazines - pr _arr = [[T_INV_primary, _nGuns, 10], [T_INV_secondary, 0.4*_nGuns, 5], [T_INV_handgun, 0.1*_nGuns, 3]]; // [_subcatID, num. attempts] + pr _arr = [[T_INV_primary, 1.5*_nGuns, 10], [T_INV_secondary, 0.3*_nGuns, 5], [T_INV_handgun, 0.1*_nGuns, 3]]; // [_subcatID, num. attempts] { _x params ["_subcatID", "_n", "_nMagsPerGun"]; if (count (_tInv#_subcatID) > 0) then { // If there are any weapons in this subcategory