Jump to content
On_Sabbatical

Post here all what you know about implementation of the headless client in missions

Recommended Posts

How difficult would it be to convert a mission like Insurgency? I am very slowly managing to wrap what's left of my brain around HC implementation.

Share this post


Link to post
Share on other sites
Is it possible to use HC for BE warfare? If so would the server benefit from HC?

Not unless there is a new Warfare BE version with HC support. It doesn't just work with any mission out of the box; the mission actually needs to be designed with HC support, or otherwise modified to add such support.

Edited by MadDogX
clarfied Warfare BE to avoid confusion with BattlEye

Share this post


Link to post
Share on other sites

Thanks Mad, our server has been pumping out new maps to work with Rubber Edition warfare and today we tried Zargabad. Everything was ok until the server filled up with 30 something people, all buying ai, and before we knew it the server FPS went from 45-50 fps to 4-5 fps. Based on what I've read on this forum, I'm guessing the drop was due to the ai calculations required for maps with big cities. I was hoping that by implementing a HC we could eliminate this but I guess we'll have to just dramatically reduce the # of ai players can purchase.

Is there a guide on how to design a mission to work with a HC? I've seen the guides on how to startup a server and get it to use HC but none on implementing a mission.

Share this post


Link to post
Share on other sites
Thanks Mad, our server has been pumping out new maps to work with Rubber Edition warfare and today we tried Zargabad. Everything was ok until the server filled up with 30 something people, all buying ai, and before we knew it the server FPS went from 45-50 fps to 4-5 fps. Based on what I've read on this forum, I'm guessing the drop was due to the ai calculations required for maps with big cities. I was hoping that by implementing a HC we could eliminate this but I guess we'll have to just dramatically reduce the # of ai players can purchase.

AI under a player's control are always local to his client, so that probably isn't the problem. More likely the large number of players is causing a lot of server-side AI to spawn, which is affecting the framerate. Player group sizes can probably be left alone.

Is there a guide on how to design a mission to work with a HC? I've seen the guides on how to startup a server and get it to use HC but none on implementing a mission.

None that I know of. The Reddit guide from a few pages back did not contain any specific info on this. I haven't actually tried it myself either so take this with a grain of salt, but in principle adding HC support should work as follows:

1. Add a passive but playable entity (e.g. an animal) to the mission and give it a name such as "HCUnit". This player slot will be used for the headless client. (Note that AFAIK there must be an admin present when the mission is started to drag the HC into this slot and make sure no one else fills it.)

2. There needs to be a script in the mission that checks if the HC slot has been filled, then gets the corresponding client ID using the owner command. (i.e. owner HCUnit)

3. When the ID of the headless client is known, all existing server-side AI can be transferred to it using the setOwner command. (Not sure if this needs to be done for all AI entities or perhaps just the group leaders. Perhaps someone more knowledgable than I can shed some light on this.)

4. All future spawned AI (except those assigned to players) should either be created directly on the HC or transferred there immediately after creation, again via setOwner.

I hope this isn't too vague. Specifically concerning Warfare, I haven't looked at the code but I'm fairly sure the mission keeps track of server-side AI groups using an array (or perhaps multiple arrays) - so in step 3, you could iterate over this array and apply the setOwner command to all group units. As for step 4, you will need to check for functions that create AI units on the server, then modify these so that all spawned AI are moved to the HC (if the HC ID is set).

EDIT / BREAKING NEWS:

As of the most recent beta (101334), there is a new rule that can be placed in the mission.sqm file: forceHeadlessClient=1;

See Suma's post on dev-heaven.

Basically, you can edit the mission.sqm file and put this directive inside the unit definition of your HC entity. If I understand Suma correctly, this will reserve the slot exclusively for a headless client and auto-assign the HC to that slot when it joins the server. (Meaning it no longer needs to be manually placed there by an admin.)

This should make HC-usage fully automated.

Edited by MadDogX

Share this post


Link to post
Share on other sites

Bear in mind your arma2oa.cfg settings will affect your performance also.

[Monday, 28 January 2013 8:39 AM] Dslyecxi (Andrew): atm we're using:

MinBandwidth=71457280;

MaxBandwidth=322428800;

MaxMsgSend=1024;

MaxSizeGuaranteed=1024;

MaxSizeNonguaranteed=512;

MinErrorToSend=0.020000001;

MinErrorToSendNear=0.020000001;

This works up to ~135 players, at which point the packetloss bug becomes an issue. I don't know if tweaking the config would influence that at all.

The big coop we did yesterday, which spanned all of Celle 2 and had armor, FW, RW, and an MLRS, faced off against shitloads of Russian armor, FW, RW, and infantry, had ~200 AI active at any given time and we probably ended up going through the better part of 700-1000 AI over the course of about two hours. Oh, and that was at a playercount of ~100

Share this post


Link to post
Share on other sites
Yesterday our group tested the HC in a mission with very high AI count. The Mission took place on Fallujah, more precisely the Area south west of the town, the two bridges and a few blocks into the city. Server FPS remained very stable at around 50. The players experienced MUCH better performance compared to playing the same mission without HC. AI reactions and performance were top notch. They were immediately rushing to nearby cover if beeing under fire and their overall reaction time was much improved. We had ASR_AI and TPWCAS running and it seems as if the AI finally had enough computing time to use those mods to their full ability.

I'm actually interested about which TPWCAS settings you used.

I've implemented 'experimental HC' option, but haven't been able yet to properly test it myself yet.

Did you use it (i.e. tpwcas_mode = 4) or did you use the regular client-server setting (tpwcas_mode = 2), which should work for sure for HC side AI?

Share this post


Link to post
Share on other sites
I'm actually interested about which TPWCAS settings you used.

I've implemented 'experimental HC' option, but haven't been able yet to properly test it myself yet.

Did you use it (i.e. tpwcas_mode = 4) or did you use the regular client-server setting (tpwcas_mode = 2), which should work for sure for HC side AI?

No Idea, will ask our server guys.

I guess we used the default setting

Share this post


Link to post
Share on other sites

Headless client just randomly stopped working for us. We restarted our server, and now headless client wont connect to it, or any other server. I can spawn a HC on my local box using the exact same settings and have it connect to the server though.

SOLUTION FOUND!!!!!

where -port=x the HC will try to bind to x+2, so if you specify it as 2302, or leave it blank, it will try to bind to 2304

Problem: server binds to 2304

Solution: add -port=2303 Hc will bind to 2305

https://dev-heaven.net/issues/70604

Edited by mmavipc

Share this post


Link to post
Share on other sites
As of the most recent beta (101334), there is a new rule that can be placed in the mission.sqm file: forceHeadlessClient=1;

See Suma's post on dev-heaven.

Basically, you can edit the mission.sqm file and put this directive inside the unit definition of your HC entity. If I understand Suma correctly, this will reserve the slot exclusively for a headless client and auto-assign the HC to that slot when it joins the server. (Meaning it no longer needs to be manually placed there by an admin.)

This should make HC-usage fully automated.

Does the mission still need to be compatible? (setOwner to the HC etc.), or is it literally fully automated now, that it can just take control of the AI from a server?

Plus, is there a really simple way to implement this into an existing mission, like a one line init field to setOwner every unit or something.

Share this post


Link to post
Share on other sites

One question out of interest:

Currently you need a seperate license to run a HC, what would happen if you simply start another instance of the dedi server.exe and designate it as a HC?

Share this post


Link to post
Share on other sites
Does the mission still need to be compatible? (setOwner to the HC etc.), or is it literally fully automated now, that it can just take control of the AI from a server?

Plus, is there a really simple way to implement this into an existing mission, like a one line init field to setOwner every unit or something.

Yes, the mission needs to be escecially made to work with a HC, the only advantage of that new feature its that the HC would auto join on that slot so you dont need to move it around, also noone can take its slot. And no there is no magic way to implement it, you cant just setowner randomly since waypoints and other info would be lost. But it isn't that hard to just modify some spawn script to work on HC instead of server side.

Share this post


Link to post
Share on other sites

We had reports of AI anims being frozen (civilian ice skating bug) and bad performance using HC, both resolved through the use of Dsly's arma2oa.cfg settings mentioned earlier.

The one bug we haven't been able to resolve is AI on HC will strobe lights on searchlights and all vehicles.

Share this post


Link to post
Share on other sites

As I've found a big interest of using this for MSO & Own made missions I got few questions related to this.

I read a few page up that you only have to place forceheadlessclient=1; into the playable unit you want the HC to connect to? True? If not true then what do I need to do?

Secondly on some of our missions we use DAC & HETMANN ART (And if I am correct I can assign on HETMAN ART that the leaderHQ is connected by HC but I am unsure how to set it up for DAC since you need to setOwner you say).

Thirdly - The performance? Is it good? Better AI?

Share this post


Link to post
Share on other sites
I read a few page up that you only have to place forceheadlessclient=1; into the playable unit you want the HC to connect to? True? If not true then what do I need to do?

That's just the easy part, but yes. Note that this line must be written directly into the mission.sqm file - it is not possible to do this from within the editor! (Hopefully that will be changed.)

Secondly on some of our missions we use DAC & HETMANN ART (And if I am correct I can assign on HETMAN ART that the leaderHQ is connected by HC but I am unsure how to set it up for DAC since you need to setOwner you say).

I cannot help you there.

Thirdly - The performance? Is it good? Better AI?

Reports so far say that the performance is way better and AI are far more deadly. Check out some of Dslyecxi's recent videos on YouTube.

Share this post


Link to post
Share on other sites

Hello all, I have been reading about this since the first beta it was released in and I am very interested in testing it out and using it in my missions.

What I do understand:

1) I am launching Two instances of the game on the server.

a) the Dedi server

b) the HC client

2) After placing the unit in the editor that the Headless client will utilize, I have to edit the Mission.sqm and add forceheadlessclient=1; for that unit.

3) After starting said client it will automatically connect to the server when a mission is available to connect to.

Obviously this means nothing until you offload the AI to the HC... but HOW..

After that I am LOST.. like I said I understand everything up to exactly how to get the AI to the HC... I use @COSLX, @GL4, @ASR_AI, and @ZEUS_AI (select pbo's from them) I found out I was not the only one when I came across ChrisB's youtube videos and posts here about the mods he and his clan use. Doesn't the HC use those AI enhancements?( since there installed on the HC as well? and how to I/ mission makers ensure that they are used etc?? I am completely lost..

For instance if your not familiar with Grouplink4 your have to drop several modules on the map in the editor and syncronize them to the player and to the enemy forces whoever they may be.. How would I offload the GL4 synchronizations and calculations to the HC?? Or is that already taken care of because of the HC launching with the same mods?

I guess it would be ....

isHC = (!(isServer) && !(hasInterface)) to detect if client is HC.

if (isHC == true) then{... I do what ..}. that is where I'm at .. How do I get the AI to the HC? If they are already placed on the map in the editor? of if their spawned? Arg...

Edited by Lordprimate

Share this post


Link to post
Share on other sites

If you are not going to write specific scripts to spawn the AI on the HC, then Setowner is probably your best bet:

http://community.bistudio.com/wiki/setOwner

All the exes should be launched with the same mod parameters. As for what runs where, if the mod is suitable for multiplayer you don't really need to think about it - the locality issues are covered by the scripts. GL4 for example - from memory - runs against client AI as well as server. Easiest thing to do it is test it - if you create a simple mission utilising HC and synchronize a few AI groups with GL4 Custom module, if they go charging off everywhere of their own volition you will know it is running.

Edited by jiltedjock

Share this post


Link to post
Share on other sites

Is there any gain in using dedicated server, HC and the player game in the same machine to play missions like mso or whatever in single player?How do i set up the HC in the same machine i play the game (CDkey) ?Do i have to install the game again with a second key?Or is there a way to add it to the HC only?

I have a 6 cores cpu i7 3930k @4.8Ghz.

By the way, i used TA2DST to setup and run HC and Dedicated server! i see HC connecting to server but i cannot connect bc of the CDkey!

Edited by Grillob3

Share this post


Link to post
Share on other sites
Is there any gain in using dedicated server, HC and the player game in the same machine to play missions like mso or whatever in single player?How do i set up the HC in the same machine i play the game (CDkey) ?Do i have to install the game again with a second key?Or is there a way to add it to the HC only?

I have a 6 cores cpu i7 3930k @4.8Ghz.

By the way, i used TA2DST to setup and run HC and Dedicated server! i see HC connecting to server but i cannot connect bc of the CDkey!

This kind of setup will certainly make the most of your CPU cores, but make sure to set kickduplicate = 0; in the server.cfg file, since the HC will be using the same key as your game client.

Share this post


Link to post
Share on other sites
This kind of setup will certainly make the most of your CPU cores, but make sure to set kickduplicate = 0; in the server.cfg file, since the HC will be using the same key as your game client.

Thanks for the reply.

But no matter what i do...using kickduplicate = 0 or not i am still getting "cdkey in use".

Edited by Grillob3

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

×