Making zeds more difficult

meshguru99

New Member
Hi --

I'd like to make the zeds more difficult for the player as the player moves inland. I'd like to spawn more zombies and make them harder-hitting and more sensitive to the player's presence. If possible, I'd like to make them faster.

Towards that goal, I've defined a function whose evaluation over the game map is nearly constant at unity everywhere near the Chernarus coastline and for two kilometers or so inland. Once the player leaves the vicinity of the coastline, the function evaluation increases in magnitude linearly until it reaches a maximum predefined value over the extreme northwest corner of the map -- where I've also built a new military base in one of those hidden valleys. One of my scripts spawned via execVM in init.sqf handles ongoing evaluations every ten seconds, so this was an ideal spot to put the evaluation of this adjustment factor as well. Let's call this value "GlobalZedDiffAdj". I'm not asking hot to do this. It's already done. It's the easy part.

Now, I've identifed several scripts in which it seems to make sense to use my difficulty factor.

First, in building_spawnZombies.sqf:
_zombieChance = getNumber (_config >> "zombieChance");
becomes
_zombieChance = GlobalZedDiffAdj * getNumber (_config >> "zombieChance");

_num0 = _min + floor(random(_max - _min + 1));
becomes
_num0 = floor( GlobalZedDiffAdj * ( _min + random(_max - _min + 1 ) ) );

and

_num0 = _num0 min (0 max (ceil(dayz_maxMaxModels / _spawnAreaRatio / _spawnAreaRatio * 2) - (count(((getPosATL _obj) nearEntities ["CAManBase", dayz_spawnArea / 4 * (_spawnAreaRatio / 4)]) - [player]))));
becomes
_num0 = _num0 min ( 0 max ( ceil( GlobalZedDiffAdj * dayz_maxMaxModels / _spawnAreaRatio / _spawnAreaRatio * 2 ) - (count(((getPosATL _obj) nearEntities ["CAManBase", dayz_spawnArea / 4 * (_spawnAreaRatio / 4)]) - [player]))));
.

Then, in camp_spawnZombies.sqf....
_amount = _this select 1;
becomes
_amount = GlobalZedDiffAdj * ( _this select 1 );

if (dayz_CurrentZombies > dayz_maxGlobalZombies) exitwith {};
if (dayz_spawnZombies > dayz_maxLocalZombies) exitwith {};
becomes
if ( dayz_CurrentZombies > ( GlobalZedDiffAdj * dayz_maxGlobalZombies ) ) exitwith {};
if ( dayz_spawnZombies > ( GlobalZedDiffAdj * dayz_maxLocalZombies ) ) exitwith {};

In player_spawnCheck.sqf....
_maxtoCreate = _maxControlledZombies - _controlledZombies;
becomes
_maxtoCreate = GlobalZedDiffAdj * ( _maxControlledZombies - _controlledZombies );

In player_zombieAttack.sqf ...
if (random 3 < 1) then {
becomes
if ( random( ceil( 3 / GlobalZedDiffAdj ) ) < 1 ) then {

_damage = (if (_woundDamage < 0.8 OR {(!(_wound IN dayZ_explosiveParts))}) then {0.1} else {0.01});
becomes
_damage = (if (_woundDamage < 0.8 OR {(!(_wound IN dayZ_explosiveParts))}) then {GlobalZedDiffAdj * 0.1} else {GlobalZedDiffAdj * 0.01});

_damage = 0.2 + random (0.512);
becomes
_damage = 0.2 + GlobalZedDiffAdj * random (0.512);

and....

_damage = 0.2 + random (1);
becomes
_damage = 0.2 + GlobalZedDiffAdj * random (1);

In player_zombieCheck.sqf ...
if (_dist < DAYZ_disAudial) then {
becomes
if (_dist < ( DAYZ_disAudial * GlobalZedDiffAdj ) ) then {

if (_dist < 100) then {
becomes
if (_dist < ( 100 * GlobalZedDiffAdj ) ) then {

Finally, in zombie_loiter.sqf
_unit forceSpeed ceil(random(3^0.5)^2)*2; // returns a value of 0, 2, 4, or 6
becomes
_unit forceSpeed ceil( random( ( 3 * ( GlobalZedDiffAdj/3 + 2/3 ) )^0.5 )^2 ) * 2; // returns a value of 0, 2, 4, 6, or 8 when GlobalZedDiffAdj = 2

I know how to insert the new modules into my mission file and override the existing functions. That's not my question. And I'm not considering the additional computational and communications load increasing the zed count might cause.

My questions are these ....

Are there unintended side-effects to the changes I've proposed above I don't know about? Are there any allowable function domain excursions I'm exceeding? Are there calculations or values elsewhere that negate my changes? I think I've covered zed count, damage, and speed above. Are there other locations where changes would make sense? Is there anything else I should know?

Thanks,

- ep
 
Back
Top