Jump to content
bangabob

Enemy occupation system (eos)

Recommended Posts

4 hours ago, Chinook_ said:

Hello all,

Thxs Bangabob for a simple awesome script

Love this old, easy, functional script. I wanted to make this Headless Client compatible. I am a noob when it comes to writing a lengthy scripts.  My goal is when one or more HCs are available, EOS will spawn on the available HCs and share the load with others HCs. Can anyone here help?

 

Hey man.  If you look at my last post with link you will see EOS is not working as is.  Its needing some updating with its core functions (spawning location and patroling) that I have found so far. I added some new functions but some other core code is bugged and I am not great at fixing stuff.

I shelved it but may be i can get back to it if anyone else wants to help.

  • Like 1

Share this post


Link to post
Share on other sites

While looking at this script I have found the following errors:

eos\functinos\findSavePos.sqf

Change line 1 to:

_mkr=(_this select 0);

eos\functions\shk_patrol.sqf

Change line 49 to:

   _p = [_marker,true] call SHK_pos;}else{_p = [_marker,true] call SHK_pos;

Both seem to be typos resulting in variables being undefined.

 

On other matters:

@JandreswWhat makes you think the script does not work?  The example mission seems to run fine when I was plaing with it recently.

 

And finally: I wanted to clean up the code, without changing the functionality of the script:

  • Use call and spawn instead of execVM.
  • Make the system more robust to setup errors and to report errors better to aid correction.

I seem to have been successful with these objectives in respect of the main EOS functinallity, however the Bastion system now seems to be broke (It was not broken on the original mission) if I can get on top of the issue with the Bastion system and the bastion system works. I'll look in to releasing a copy.  Just not sure how much interest there is in this these days.  S

Edited by strider42
Bastion system working
  • Like 2

Share this post


Link to post
Share on other sites
12 hours ago, strider42 said:

While looking at this script I have found the following errors:

eos\functinos\findSavePos.sqf

Change line 1 to:


_mkr=(_this select 0);

eos\functions\shk_patrol.sqf

Change line 49 to:


   _p = [_marker,true] call SHK_pos;}else{_p = [_marker,true] call SHK_pos;

Both seem to be typos resulting in variables being undefined.

 

On other matters:

@JandreswWhat makes you think the script does not work?  The example mission seems to run fine when I was plaing with it recently.

 

And finally: I wanted to clean up the code, without changing the functionality of the script:

  • Use call and spawn instead of execVM.
  • Make the system more robust to setup errors and to report errors better to aid correction.

I seem to have been successful with these objectives in respect of the main EOS functinallity, however the Bastion system now seems to be broke (It was not broken on the original mission) if I can get on top of the issue with the Bastion system and the bastion system works. I'll look in to releasing a copy.  Just not sure how much interest there is in this these days.  S

 

Hey man. Nice to see someone is interested to making eos better.  The version I was using had errors popping and units not spawning.  It may have been on end. I think the find safe pos wasn't working either but it looks like you fixed it.

 

But I'd Ike to see a cleaned up version to be honest.  I think there are a few still around that like eos but this thread has been really silent. So most gave up I suspect.

 

I'd bet some would like to use the updated version tbh.

 

Thanks.

  • Like 1

Share this post


Link to post
Share on other sites
12 hours ago, jandrews said:

But I'd Ike to see a cleaned up version to be honest.  I think there are a few still around that like eos but this thread has been really silent. So most gave up I suspect.

 

I'd bet some would like to use the updated version tbh.

 

Thanks.

:yeahthat:...I'm one of them. Been using EOS forever, and a cleaned-up version would be nice.

Thanks to everyone willing to put in some work on this awesome script.

 

Share this post


Link to post
Share on other sites

This is the current sate of my update:

https://1drv.ms/u/s!AnX2_vGoXf5F92ntEGcycpjwwFk1?e=V9smx2

v2.01a

It should work just like v1.98.

To us it in your mission you need the following in the init.sqf file and replace your mission directory:

#define sPK_COMPILE compile preprocessFileLineNumbers

// Initialise functions.
#include "eos\eos_functions.hpp"

// Check the mission has a server game logic.
if (isnil "server") then {
   hint "YOU MUST PLACE A GAME LOGIC NAMED SERVER!";
};

// Start the EOS system.
[] call EOS_OpenMe;

and place a Game Logic called server on the map.

 

  The following has changed:

  • Functions are stored in memory - using execVM is inefficient because it reads the file from the disk, comiles it and then uses the spawn command to run it.
  • Functions are called with the call command with the exception of the 'core' functinos that use the spawn command - code should only be spawned if it is really required.  The biggest issue is overloading the scheduler.
  • I have 'tidied' most the EOS code, using a relatively standard 'C' style - This should make the code more readable.
  • I've tried to make the initialisation system more robust using param and params commands that check passed parameters.
  • I have cleared 2 bugs that would have stopped code running, thought I doubt they would be encounterd often.

In truth I have not done much testing.  I have run the example mission in single player and mutiplayer (but only as a player server) mode and it seems robust and does not report errors.  I am currently creating a mission to run on a dedicated server and to my mind that will be the real test.

Future plans:

  • Tidy the code so function file names match what functions are called in the code.
  • Currently new units and vehicles are created each time an AO is respawned.  I'd like to change that to remember what untis and vehicles had been selected.  There is potential there for a small improvement in performance.
  • I've never really understood why we have a number to specify a range of group sizes.  I think you should be able to specify whatever size you want, including a range.
  • I'm sure I can reduce the number of triggers to improve performance.
  • Introduce a random population system so each time the system is run the map is different.
  • I'd like an improve group creation system so a group have fixed elements.  So a group will always have a medic, say.

We will see how time allows.  S

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites

I love EOS and sure hope your update brings life back to it. I will be waiting your mp mission. I have used EOS in a lot of missions.

Share this post


Link to post
Share on other sites

If you're trying to optimize EOS, I recommend also using the setTriggerInterval script command to increase the interval value. I personally set it to 2, whereas by default a trigger's interval is 0.5.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Now this is more like it! This will help me immensely in mission making!🤘

  • Like 1

Share this post


Link to post
Share on other sites

Hey.  So far so good. Although it seems not all units are spawning.  I upped the amounts for the inf examples to include all units yet it seems no luck.  Does arma now scale to number of players?

 

I am using zen occupy house in place of sku because its better imo.

 

Yet not many units spawned in on any setting.

 

Anyone else notice this?

 

 

Share this post


Link to post
Share on other sites

So far so good, no errors now.

 

Edited by imager6
no errors now

Share this post


Link to post
Share on other sites

Strider42, what is the difference in the EOSinf and EOSmot zones. I am just using the EOSinf zone and your updates seem to be working very well. I have made a quick mission and put it on our groups mp server to test and saw no errors from EOS in the server log. I hope to test with a large group in the next several weeks. I am using the UNSUNG mode. I have inf, light vic's and  tanks spawning, with no errors. I just hope it works better than the old system frame wise with 45 to 60 players. 

This will be great news for mission planners who do not just use ZEUS for missions. THANKS FOR YOUR WORK!!!

 

 

 

Share this post


Link to post
Share on other sites
46 minutes ago, imager6 said:

Strider42, what is the difference in the EOSinf and EOSmot zones. I am just using the EOSinf zone and your updates seem to be working very well. I have made a quick mission and put it on our groups mp server to test and saw no errors from EOS in the server log. I hope to test with a large group in the next several weeks. I am using the UNSUNG mode. I have inf, light vic's and  tanks spawning, with no errors. I just hope it works better than the old system frame wise with 45 to 60 players. 

This will be great news for mission planners who do not just use ZEUS for missions. THANKS FOR YOUR WORK!!!

 

 

 

I did the same.  Yet the house script and inf patrols did not spawn correct numbers.

 

Be sure and check the amounts of units spawning.

 

The other vehicles did, but I did not find the static weapon.

Share this post


Link to post
Share on other sites
5 hours ago, imager6 said:

Strider42, what is the difference in the EOSinf and EOSmot zones.

 

The EOSinf spawn infantry and the EOSmot spawns motorised uints.
 

[
   ["EOSinf_1","EOSinf_2"], // 2 AOs specified.
   [3,1],                   // House infantry.
   [2,3,100],               // Patrol infantry.
   [0,0],                   // Light vehicle infantry.
   [0],                     // Armoured vehicles.
   [0],                     // Static vehicles.
   [0,0],                   // Helicopters (infantry).
   [0,0,350,EAST,true,false] // Settings.
]

[
   ["EOSmot_1","EOSmot_2"],// 2 AOs specified.
   [0,0],                  // House infantry.
   [0,0],                  // Patrol infantry.
   [3,1,90],               // Light vehicle infantry.
   [2,60],                 // Armoured vehicles.
   [0],                    // Static vehicles.
   [1,0,90],               // Helicopters (infantry).
   [0,0,350,EAST,false]    // Settings.
]

Hope that makes it more obvous.  S

Share this post


Link to post
Share on other sites
22 hours ago, jandrews said:

Yet not many units spawned in on any setting.

 

You do know now the "size" thing works with EOS? This is a typical infantry entry:

[2,3,90]

The 2 is the number of groups to spawn.

The 3 is the 'size' but it is really specifying a range.

The 90 is optional and is the percentage probability that the units will spawn.  If it is not specified it defaults to 100% so they will allways spawn.

Size:

Size Min. Max.
  0    1
  1    2    4
  2    4    8
  3    8   12
  4   12   16
  5   16   20

So in our example above, with a size of 3, it will span between 8 and 12 infantry units.

This applies to house infantry, patrol infantry, light vehicle and helicopters (as they transport infantry).  S

 

PS - Armoured and static vehicles are specified by a 2 element array:

[2,75]

The 2 Is the number of vehicles and I think they are all in the same group.

The 75 is optional and is the persentage probability that the units will spawn.  As before if it is omitted it defaults to 100%.

 

Share this post


Link to post
Share on other sites
16 minutes ago, strider42 said:

 

You do know now the "size" thing works with EOS? This is a typical infantry entry:


[2,3,90]

The 2 is the number of groups to spawn.

The 3 is the 'size' but it is really specifying a range.

The 90 is optional and is the percentage probability that the units will spawn.  If it is not specified it defaults to 100% so they will allways spawn.

Size:


Size Min. Max.
  0    1
  1    2    4
  2    4    8
  3    8   12
  4   12   16
  5   16   20

So in our example above, with a size of 3, it will span between 8 and 12 infantry units.

This applies to house infantry, patrol infantry, light vehicle and helicopters (as they transport infantry).  S

 

PS - Armoured and static vehicles are specified by a 2 element array:

[2,75]

The 2 Is the number of vehicles and I think they are all in the same group.

The 75 is optional and is the persentage probability that the units will spawn.  As before if it is omitted it defaults to 100%.

 

Haha.

 

I get eos scaling. I will max all the values and see what happens. Although I didn't know default was 100% probability.

Share this post


Link to post
Share on other sites

I am just using the EOSinf for spawning infantry, light vehicles and tanks, I have not tried helicopters. The new system is working very well with no errors that I can see.  I look forward to your future work. This is a great

system for mission makers for different sized groups by itself or along with a Zeus.

 

Share this post


Link to post
Share on other sites

Did some tinkering yesterday with values.  Maxd most numbers and with the varying ranges it's still kinda hard to see the full effect.  Nonetheless eos seems to work fine.

 

Baston may need more exploring.  I maxd those numbers and saw some issues with spawning units or lack there of.  The waves appear to be an issue as well.

 

Not sure your free time strider but if you are vested in fixing this stuff that may need further time.  I added a careless way point to the  transport heli yet it seems to still have issues unloading its troops and the spawning vehicles are not patrolling in to the zones.  For all spawn lines I turned debug on to visually see all spawned units.  Eos spawned most in but not as maxd as Iike.

 

So other ideas if time warrants.

 

Turrets spawning are lame when exposed. I attempted to add code which would spawn sand bags 360 around the turrets yet the code gets stuck.

 

Another idea is to have units fast rope from transport helis to avoid the silly npc pilots from loitering around the ao to find exact spot to dump units.

 

Another issue I see in towns is ai vehicles getting stuck against buildings.  Anyone have any code for ai to get unstuck if they don't move for x time?

 

Share this post


Link to post
Share on other sites

@jandrews I've been working on the EOS as I wanted to use in in another mission I have been creating and as such I'm very EOS focused and not so interested in the Bastion system.  Every now and then I get furstraighted with the way the code is written and I re-write it, or occasionally re-write it and reasise I have broken it.  I feel the engine need a rewrite so the code is written in a way I like.  There would, I belive, be some perfromance advantage to doing that but weather you would actually notice any difference I'm not sure. 

My biggest current issue has been I have some IRL work I need to focus on for a bit but I should be doing some work at weekends as time allows.

I've been kind of fighting with the way EOS gets its input.  It basically goes for a type of unit (house infantry, patrol infantry, ...) there is an array:

[

   numberOfGroups

   size

   probabilityOfPresence

]

but the size is not the number of untis in a group but translates to:

Size Min. Max.
  0    1
  1    2    4
  2    4    8
  3    8   12
  4   12   16
  5   16   20

It would be very easy to replace this with size = numberOfUnits or and array [ minUnits, maxUnits ].

However I would like to retain the compatibility with the current setup, though I have already changed this by creating a large array of deployment data rather than individula calls to create each AO.

If you solve any of the issues that are upseting you, I would be happy to work out how to add them to the mission.

My own bug-bear is the vehicle exploding when deployed in a build up area.  I have plans for this but things keep getting in the way.

S

Share this post


Link to post
Share on other sites

Thanks for the response strider42.

 

Am sure others would like to see your updates as well.

Share this post


Link to post
Share on other sites

I only recently started playing Arma3, but have been captivated. I began drafting my own automated spawn system when I came across a mention of EOS. Looks pretty bang-on with what I had in mind. Glad to see there's been some recent desire to update the code. I'm still reading through the EOS code, but I'm happy to collab with any improvements/updates that may be needed. I imagine compat modules would be useful to incorporate assets provided by RHS, CUP, etc. -- happy to work on that if that's helpful. 

Share this post


Link to post
Share on other sites

@darwinscusp EOS is pretty easy to play around with.  Just change the UnitPools.sqf file with the units you want and you are on your away.

 

In truth I am not convinced by a system that specifes multple factions you are not going to use.  I always imagine that most people are going to want to create there own pools.  I guess it could be useful if you wanted to use more than one enemy faction.  That said even in my latest implementation I still have the multiple factions system 😛

Share this post


Link to post
Share on other sites

I use multi factions in UNSUNG, Local VC, regional VC, NVA, Dac Cong all opfor and the system works very well. This is important for mission makers.

 

  • Like 2

Share this post


Link to post
Share on other sites

Just started playing with EOS to save resources and keep the ai numbers up. 

I'm having a problem with attack helis, the troop drop is working great but not attack.

I've tried different values but no go This works fine but I need to add a value for Heli attack.

 

null = [["z_0"],[0,2,100],[2,1,100],[0,0,100],[1,100],[0,100],[1,2,100],[0,0,250,EAST,TRUE,False]] call EOS_Spawn;                                     ([1,2,100] heli Drop) 

 

Here's my unitpools

// EAST N_Vietnamese FACTION
    if (_faction==0) then {
    _InfPool=    ["vn_o_men_nva_15","vn_o_men_nva_22","vn_o_men_nva_21","vn_o_men_nva_16","vn_o_men_nva_17","vn_o_men_nva_20","vn_o_men_nva_18","vn_o_men_nva_19","vn_o_men_nva_28","vn_o_men_nva_44","vn_o_men_nva_25","vn_o_men_nva_23","vn_o_men_nva_27","vn_o_men_nva_24","vn_o_men_nva_20","vn_o_men_nva_17","vn_o_men_nva_16","vn_o_men_nva_19","vn_o_men_nva_18","vn_o_men_nva_16","vn_o_men_nva_17","vn_o_men_nva_20","vn_o_men_nva_18"];    
    _ArmPool=    ["vn_o_armor_type63_01","vn_o_armor_m41_01","vn_o_wheeled_btr40_mg_03","vn_o_wheeled_btr40_mg_03"];
    _MotPool=    ["vn_o_wheeled_z157_01_vcmf","vn_o_wheeled_btr40_01"];
    _ACHPool=    ["vn_o_air_mi2_03_03"];
    _CHPool=    ["vn_o_air_mi2_01_01"];
    _stPool=    ["vn_o_nva_static_dshkm_high_01","vn_o_nva_static_pk_high","vn_o_nva_static_rpd_high","vn_o_nva_spiderhole_03","vn_o_nva_spiderhole_02"];
    _shipPool=    ["O_Boat_Armed_01_hmg_F","O_Boat_Transport_01_F"];
    _crewPool=    ["vn_o_men_nva_06","vn_o_men_nva_39","vn_o_men_nva_37"];
    _heliCrew=    ["vn_o_men_aircrew_04","vn_o_men_aircrew_03"];

 

Don't mind the shipPool, haven't got to it yet

 

Appreciate any help

 

Edit; disregard, figured it out  (No passengers is the answer)  [1,0,100]

Share this post


Link to post
Share on other sites

@strider42, just wanted to say thanks for updating this to functions. I would like to place a small little piece of code with only garrison units to use this command  (_unit disableAI "PATH"); This will allow the AI to stay put and still have full targeting capabilities.   I am a noob to advanced scripts like this. Can you show me an example? 

 

Share this post


Link to post
Share on other sites

@strider42, thanks so much for the update. I changed over all my templates to your update (Prairie Fire, IFAS, Cup and default.

 

I'm aware this issue is not based on Striders update but does anyone know why sometimes, be it Inf, Civilians, Tanks  or whatever sometimes have a waypoint located at the bottom left (0,0,0) corner of the map?

I go into zeus to correct it but it would be nice if it didn't happen.

 

Also phronk a couple of post up mentioned

"setTriggerInterval script command to increase the interval value. I personally set it to 2, whereas by default a trigger's interval is 0.5" 

Where can I find this to try it out.

 

Cheers Guys

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

×