Jump to content

Recommended Posts

Shurix, is this script executed on the client, server or both?

In the latest update we've made changes to the locality of the zombie 'AI' script. It is now nearly entirely executed by server only which saves a lot of performance for clients.

 

Kind regards,

Sanchez

Share this post


Link to post
Share on other sites

I create triggers on the server, then pass them as an array to the clients. The clients are triggering their own spawner scripts.

 

In the past I tried creating the triggers and spawning zombies on server-side only but found that server triggers don't work for clients for some reason. Maybe I missed a trigger setting that defined it as global..?

InfAllLocations = [
	//["Baltic Sea",[4699.25,3524.91,0.01]],
	["Mitrovice",[3795.29,7222.12,0.01]],
	["Branibor",[7682.46,4312.29,0.01]],
	......
	["Castle Georgiev",[24405.9,1367.89,0.01]]
];




if (isServer) then
{ 

civilian setFriend [resistance , 0];
civilian setFriend [east , 0];
resistance setFriend [civilian , 0];
	
	_ztriggers = [];

		{
			private ["_markName","_markPos","_mPosX","_mPosY","_mkrY","_mkrX","_detectorName","_x"];
			_location=_x;
			_locationName = _location select 0;
			_locationPos= _location select 1;
			//_locationPos = [(_locationPos select 0),(_locationPos select 1),0.01];
			_trigger=createTrigger["EmptyDetector",_locationPos];
			_size = 100;
			if (_locationName in ["Krasnoznamen'sk","Sevastopol'","Airport Dubovo","Lyepestok","Ekaterinburg","Sabina","Branibor"]) then
			{
				_size = 500;
			} else {
				_size = 300;
			};
			_trigger setTriggerActivation ["EAST", "PRESENT", true];
			//_trigger setTriggerStatements ["this","[thisTrigger,[0,0]] exec ""custom\zombies\spawn.sqf"";",""];
			//diag_log format["Infected: Setting a Trigger in %1 at %2",_location,_locationPos];
			_ztriggers pushBack [_trigger,_size];
			sleep 0.1;
		} forEach InfAllLocations;
		
		diag_log format["ZOMBIES: All locations are marked with triggers. Sending _ztriggers=%1",_ztriggers];
		missionNamespace setVariable ["ztriggers", _ztriggers];
		publicVariable "ztriggers";
};

if (!isServer) then {

civilian setFriend [resistance , 0];
civilian setFriend [east , 0];
resistance setFriend [civilian , 0];

	diag_log format["ZOMBIES: waiting for ztriggers"];
	waitUntil {!isNil "ztriggers"};
	_ztriggers = missionNamespace getVariable ["ztriggers", []];
	diag_log format["ZOMBIES: _ztriggers %1",_ztriggers];
    {
		_trigger = _x select 0;
		_size = _x select 1;
		_trigger setTriggerArea[_size,_size,0,false];
		_trigger triggerAttachVehicle [player];
		_trigger setTriggerActivation ["EAST", "PRESENT", true];
		//_trigger setTriggerStatements ["this","thisTrigger spawn INF_fnc_autopop","thisTrigger spawn INF_fnc_playerLeavingZone;"];
		//_trigger setTriggerStatements ["this","[thisTrigger,[0,0]] exec ""custom\zombies\spawn.sqf"";",""];
		call compile format ["_trigger setTriggerStatements ['this','[thisTrigger,[%1,true,false]] exec ""custom\zombies\spawn.sqf"";',''];", str _size];
	} forEach _ztriggers;
};

Share this post


Link to post
Share on other sites

MrSanches,

Thanks for your reply.

I will review the latest zombie.sqf code in 2.6 and see how that may help me in my modding.

Probably it will even help me get the bots to actually fight back and not simply get slaughtered :)

Share this post


Link to post
Share on other sites

I wonder if the zombie.sqf is executed at all by the server, if not, then there's your issue.

Share this post


Link to post
Share on other sites

I wonder if the zombie.sqf is executed at all by the server, if not, then there's your issue.

 

I think it is getting executed. As I said zombies attack me, my vehicle and throw cars at me.

 

Anyway, I think it has to do with the locality of the zombies. I will redo my trigger-setting script to run on the server-side and spawn zombies on the server-side as well. Setting proper trigger locality is going to be fun.

Share this post


Link to post
Share on other sites

BTW, on Taviana I have military outposts all over the map with MGs standing 7 meters off the ground on concrete bunkers. Zombies see the static gunners first and pile around the bunker unable to reach them. I understand that zombies are stupid, but I would add a height difference check when looking for the next target to exclude unreachable targets.

 

886824ec4728b860b72dba8f8c74d43b.jpg

Share this post


Link to post
Share on other sites

You said the issue was: After replacing the mod with 2.6 though using exactly the same logic, the zombies are getting spawned but they just stand there or loiter without attacking anyone.

 

But now you're saying: I think it is getting executed. As I said zombies attack me, my vehicle and throw cars at me.

 

What is the issue again that we're discussing? xD

 

Also - I've got mixed feelings about the height difference check (although its already being done for flying helicopters)

If you're in clear line of sight of a zombie yet you're unreachable, I don't think zombies should ignore you. Traditionally they'll be stupid and they'll wait for you (google 'zombies surrounded' to see an example of this traditional/stereotype zombie behaviour e.g. click here )

 

On the other hand, if these zombies are so obsessed with you that they aren't even bothered at all to go to other close targets, it might need a few tweaks. But I have yet to test this/see it happen.

 

Kind regards,

Sanchez 

Share this post


Link to post
Share on other sites

I see both sides of the debate on zombies waiting for u if ur high up vs moving to next target in view. For me that's a fine balance and depending on the type of mission u have and acquired targets will depend. If there are no other targets than I think the zombies would stay IF they have and see other targets than they should switch to new more easy target. Just my 1.5 cents.

Share this post


Link to post
Share on other sites

MrSanches,

 

I said I think zombie.sqf is getting executed because in 2.5 they run after me and attack. My spawn scripts remain the same between 2.5 and 2.6.

In 2.6 they spawn and stand still or move around if I get close but do not attack.

 

In both cases they were spawned from a trigger local to the client and this behavior must be caused by the locality change on zombie init in 2.6 as you mentioned earlier.

 

Not to worry though. I'm sure this is caused by the difference between server/client locality. We went through that in the initial versions of EpochMod when bots were spawned but did not attack the players.

Share this post


Link to post
Share on other sites

Side activate is on the actual spawner.

Additionally, the gamelogic zombie settings have the option. I have a feeling you have a terribly outdated version of this mod. Please verify.

 

Kind regards,

Sanchez

Yeh i think i have a extremely outdated version, the side activation is on nothing XD thnx for the suggestion just read the config.cpp on the pbo and it says version 1.0 XD

 

One thing though i see there is a multi-faction activation which is great but you cant get civs, could you add civs to the list pls and add a third activation side. So it means if i choose OPFOR zombie all the other factions (BLU, CIV, IND) will activate it vise versa with Independent zombies should only be a couple of lines extra, sorry if im being picky but it is an amazing mod :)

 

P.S - i noticed that there is only one faction activation on the zombie deletion module. just in case ryan didnt know

Share this post


Link to post
Share on other sites

I am having the same issue as Shurix. After recent update the zombies I place in the editor or in Zeus will react to waypoints given but when I stand right in front of them they do not move toward me and attack me. If I move right up next to them they will swing at me but wont follow, just stare at me.

Share this post


Link to post
Share on other sites

I was able to get zombies to attack me and bots using 2.6 by adding the following code

civilian setFriend [resistance , 0];
civilian setFriend [east , 0];

resistance setFriend [civilian , 0];
resistance setFriend [east , 0];

and addRating value to each spawned zombie group

{_x addRating -10000} forEach units _grp
if (_x < _numToSpawn) then {goto "loop"}
deletegroup _grp
~ryanzombiesfrequency

Share this post


Link to post
Share on other sites

Not as of yet I think.

It's fine, I got around it by placing a spawner that spawns z's randomly 200m from the spawned with the enable wandering logic. Keeps it dynamic enough :)

Just still trying to stop zombies killing players even with ace prevent instant death enabled.

Share this post


Link to post
Share on other sites

It's fine, I got around it by placing a spawner that spawns z's randomly 200m from the spawned with the enable wandering logic. Keeps it dynamic enough :)

Just still trying to stop zombies killing players even with ace prevent instant death enabled.

 

About that, we're nearly done with a logic that enables/disables the zombies from attacking civilians. Figured we'd do so after the reports about ACE unconsciousness and the fact that civilians may be used in a mission in a way that requires them not to get attacked.

 

 

Kind regards,

Sanchez

Share this post


Link to post
Share on other sites

Is the ace unconscious players still taking damage from zombies something that can be fixed?

Also a suggestion. Any way we can have a logic that turns of or tones down zombie damage to vehicles and occupants?

I like the slow to med dawn of the dead style play that could trap u in a vehicle and swipe at it etc but player and vehicle don't take damage or very little. (Trapped).

Obviously keep the damage as an option for the folk who like the world war z type of gameplay :)

I tried running over a zombie and it broke my wheel which is fine as I got surrounded quickly and was intense as Fuck but the vehicle blowing up really quickly is a bit over the top for the type of play I'm after.

Thanks

Share this post


Link to post
Share on other sites

Is the ace unconscious players still taking damage from zombies something that can be fixed?

Also a suggestion. Any way we can have a logic that turns of or tones down zombie damage to vehicles and occupants?

I like the slow to med dawn of the dead style play that could trap u in a vehicle and swipe at it etc but player and vehicle don't take damage or very little. (Trapped).

Obviously keep the damage as an option for the folk who like the world war z type of gameplay :)

I tried running over a zombie and it broke my wheel which is fine as I got surrounded quickly and was intense as Fuck but the vehicle blowing up really quickly is a bit over the top for the type of play I'm after.

Thanks

Yeah we're working on the unconcious thing right now.

 

Place a difficulty: easier game logic to lower their damage. Later on when I get time I'll work on getting vehicle and tank attacks to not blow them up, just disable them, break the windows, and knock them around.

Share this post


Link to post
Share on other sites

Yeah we're working on the unconcious thing right now.

Place a difficulty: easier game logic to lower their damage. Later on when I get time I'll work on getting vehicle and tank attacks to not blow them up, just disable them, break the windows, and knock them around.

Sweet can't wait. Yeah it's when the bash up the fuel tank your fucked lol :)

The zombies attacks override farooq revive script and kills outright to if that helps u pinpoint any issues with them killing unconscious etc.

Share this post


Link to post
Share on other sites

I noticed the difference when I moved zombies from spawning on the client side to server-side. There is definitely an increase in server performance but I lost most of the zombie chatter.

 

When zombies spawned on the client side, you could hear them from a mile away and you could hear all 30 of them whining at the same time. Now I hardly ever hear a zombie sound.

 

Can you guys review the logic so that when zombie acquires the target you would do something like:

[_zombie,_target] say3D ("zombiespotted")

 

Thanks!

Share this post


Link to post
Share on other sites

Zombies already have 'spotted'/agro sounds. And you can't just make up syntaxes for commands that don't exist XD wish we could but naw.

 

Right now we've replaced say3D (which is local) with playSound3D which is global. When we tested it was all good.

 

Any chance you can record your experiences?

 

Kind regards,

Sanchez

Share this post


Link to post
Share on other sites

Any chance you can record your experiences?

 

 

It's sort of hit-and-miss. Sometimes I hear zombie sounds, sometimes I hear absolutely nothing and ninja zombies attack me from behind  :ph34r:

I'll try to record my experience and send you an example.

Share this post


Link to post
Share on other sites

thx for your mod, can you pls make for new spawner module activation by civilian present, there is only for independent,opfor and blufor

Share this post


Link to post
Share on other sites

thx for your mod, can you pls make for new spawner module activation by civilian present, there is only for independent,opfor and blufor

 

Done. :)

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×