Jump to content

Headless Client AI w/Epoch [WIP]


Shizweak

Recommended Posts

This is still a work in progress due to a couple of issues with BattlEye (script restrictions) and fixing some problems with automatic slot assignment for the HC. However, all the code is working when the HC is slotted correctly by an admin.

 

As some of you may know, the headless client is essentially another client that joins the game - but doesn't have a GUI. This allows you to offload AI to a separate process, which makes them more responsive under heavy load and in turn makes them a lot more deadly.

 

I've made a couple of small videos, based off of the scenario I'll be setting up on my public server - this is a military base on Skalitsky island. I'm also using a modified version of the Excelsior bridge (I made it longer and connect at different points of the island/main land).

 

The AI setup is randomised to an extent, there are 6 separate groups on the island - which all patrol/fortify several different areas. Each group has several different units, with different load outs (at the moment I have assault troops with AK74 GL, support LMG/snipers with PKP and SVD respectively) and each restart it chooses random amounts of clones for each unit, and places them randomly within the marker areas for their group. Each group has the potential to spawn about 30 units on average, so the maximum AI for this scenario would be 180 AI.

 

In the below examples, anywhere between 120-150 AI were spawned, the second example shows how deadly the AI are when you give them a DKSHM mounted vehicle!

 

Initial run:

 http://www.youtube.com/watch?v=em9cDZk2Y9k

 

Second run, AI using mounted vehicles:

http://www.youtube.com/watch?v=QRLp6lAA-TE

 

I'll be placing some weapons/building/general supply caches as loot incentives for raiding the island - although it won't be an easy task and most likely requiring assistance from water/air/road to be successful. Will be releasing the code once I'm happy with it.

 

 

Link to comment
Share on other sites

I'd be very interested in the code for this. Sarge was talking about offloading the process as well but never got around to doing it.

 

Currently just running AI missions on my server due to the slowdown that occurs when we hit around 50 people.

 

Great videos. Good to be seeing the AI trying to take out vehicles so enthusiastically.

Link to comment
Share on other sites

I'd be very interested in the code for this. Sarge was talking about offloading the process as well but never got around to doing it.

 

Currently just running AI missions on my server due to the slowdown that occurs when we hit around 50 people.

 

Great videos. Good to be seeing the AI trying to take out vehicles so enthusiastically.

 

Sarge uses UPSMON behind the scenes, so it shouldn't be too difficult to convert it over to a HC - in fact, I only changed two lines in UPSMON to get it running on the HC. Although I did end up disabling the surrender abilities, otherwise the AI would simply surrender on load.

 

And yes, the AI responsiveness is surreal - running around on foot is almost impossible too, without top notch team work.

 

 

Would be interested in this as welll, thanks for working on a project like this.

 

Thanks for the support, I hope to have a release out by the end of the coming weekend. 

Link to comment
Share on other sites

Thanks for the info, the issue I've been seeing with getting the HC to join it's correct slot is when other players are joining too (I'm using a timeout on the HC start up script) - majority of the time, it goes into the right slot - other times it will go into a standard player slot. Perhaps setting it's slot to "PLAYER COMMANDER" is the key - I'll give it a shot this evening!

 

Also, to anyone else reading - you may want to set localClient[]="{127.0.0.1}"; in your server config - this gives the HC unlimited bandwidth with the server. AFAIK this removes the issue with the HC desycing when too far from the AI itself - if your HC is running from a separate machine, you will need to add it's local network address into the array.

Link to comment
Share on other sites

i am getting this error

 

Error in expression <sqf"
if (str player) == "HeadlessClient") then
{
private["_aiunit","_xpos","_ypo>
  Error position: <) then
{
private["_aiunit","_xpos","_ypo>
  Error Missing ;
File mpmissions\__CUR_MP.Chernarus\custom\add_unit_server.sqf, line 1

Link to comment
Share on other sites

Now its showing me this in the RPT log of the client.

 

 

"PLOGIN: Waiting for server to start authentication"
"PLOGIN: Requesting Authentication... (28130374)"
"PLOGIN: Retrying Authentication... (28130374)"
"PLOGIN: Requesting Authentication... (28130374)"
"PLOGIN: Retrying Authentication... (28130374)"
"PLOGIN: Requesting Authentication... (28130374)"
"PLOGIN: Retrying Authentication... (28130374)"
"PLOGIN: Requesting Authentication... (28130374)"
"PLOGIN: Retrying Authentication... (28130374)"
"PLOGIN: Requesting Authentication... (28130374)"
"PLOGIN: Retrying Authentication... (28130374)"
"PLOGIN: Requesting Authentication... (28130374)"
"PLOGIN: Retrying Authentication... (28130374)"
"PLOGIN: Authentication Failed (28130374)"
"End Mission"

Link to comment
Share on other sites

Just don't initialize the "dayz player setup" for the HC - in the mission file, at the bottom of the init.sqf  try change:

if (!isDedicated) then { 

to:

if (!isDedicated && hasInterface) then { 

Otherwise the issue is probably related to database settings. Can you connect fine as a player?

Link to comment
Share on other sites

A slight difference in my .bat file for running the HC: localhost is specified, also have a password on my server:

Expansion\beta\ARMA2OA.exe -client -mod=@DayZ_Epoch;Expansion\beta;Expansion\beta\Expansion -skipIntro -nosplash -showScriptErrors -noPause -world=Chernarus -name=SgtHeadless -nosound -localhost=127.0.0.1 -connect=localhost -port=2302 -profiles=server -password=<server password here>

this works, though he can be seen and killed currently. He appears as a zombie just standing there, there is an option to tag him as a fwend..

Link to comment
Share on other sites

This thread is amazing, only saw it today. I have managed to get AI, headless client side zombies, my heli bus/evac scripts working on the HC.

 

Next is to try and get the HC to load a custom pbo so that i dont need to put it in the mission file.

Link to comment
Share on other sites

Same way. Instead of using an AI spawn script use a zombie spawn one. See:

http://opendayz.net/threads/spawning-zombies.14490/

Pretty much what i did, i did need to copy the FSM and tweak it abit as at first the zeds didnt move.

 

I also set it up so all the headless client code goes into its own addon folder that only the HC uses. You have to create your own BIKEY and sign the file, etc for this work. Otherwise the code will have to be in the mission or pushed to the HC via the server.

 

 

I have tested my helicopter bus script on a HC on a full server and there was not rubberbanding! yay

 

With the AI, I had DZAI running, it again needed a tweak or 2 as its designed to run on a server. The AI is much faster at responding and it 'seems' better.

 

I dont have any hard numbers for you tbh.

 

Only cavet i have had (if someone know a way around please let me know) 1 HC per server

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×
×
  • Create New...