Jump to content
zorrobyte

ZBE_Cache AI & Vehicle caching script/addon

Recommended Posts

How do you turn off the debug window when using the script in a mission?

[color="#FF8040"][color="#191970"][b]if[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#191970"][b]isServer[/b][/color][color="#8B3E2F"][b])[/b][/color] [color="#191970"][b]then[/b][/color] [color="#8B3E2F"][b]{[/b][/color][color="#8B3E2F"][b][[/b][/color][color="#FF0000"]1000[/color][color="#8B3E2F"][b],[/b][/color][color="#FF0000"]-1[/color][color="#8B3E2F"][b],[/b][/color][color="#000000"]false[/color][color="#8B3E2F"][b],[/b][/color][color="#FF0000"]100[/color][color="#8B3E2F"][b],[/b][/color][color="#FF0000"]1000[/color][color="#8B3E2F"][b],[/b][/color][color="#FF0000"]1000[/color][color="#8B3E2F"][b]][/b][/color][color="#191970"][b]execVM[/b][/color] [color="#7A7A7A"]"zbe_cache\main.sqf"[/color][color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color][/color]

Made with KK's SQF to BBCode Converter

The third parameter has to be set to false.

Share this post


Link to post
Share on other sites

Ah ok, ya i seen that when i placed it in the init.sqf wasn't totally sure what that was for, thanks.

Share this post


Link to post
Share on other sites

Hey ZB, would it be possible to reintroduce the spawning if enemy units are within a certain minimun distance (even without KnowsAbout rating) ? The reason is CQB just looks ridiculous at the moment with caching/uncaching around each corner then AI popping up imediately inside buildings (because of their formation). Perhaps another line in the userconfig ?

Share this post


Link to post
Share on other sites

hi, can someone explain what the carcachedistance, aircachedistance, and boatcachedistance parameters control exactly?

Share this post


Link to post
Share on other sites

carCacheDistance = How does the player needs to be away from cars until they get "cached" (hidden)

This applies to boatCachDistance and airCachDistance as well

Share this post


Link to post
Share on other sites
carCacheDistance = How does the player needs to be away from cars until they get "cached" (hidden)

This applies to boatCachDistance and airCachDistance as well

do these cache types only apply to empty vehicles?

Share this post


Link to post
Share on other sites
do these cache types only apply to empty vehicles?

Only empty. And they do not get hidden, they get "simulationEnabled false", which means the engine does not do anything with them (appart from calculating damage) in order to save server resources.

---------- Post added at 10:03 ---------- Previous post was at 10:01 ----------

Hey ZB, would it be possible to reintroduce the spawning if enemy units are within a certain minimun distance (even without KnowsAbout rating) ? The reason is CQB just looks ridiculous at the moment with caching/uncaching around each corner then AI popping up imediately inside buildings (because of their formation). Perhaps another line in the userconfig ?

Spawning distance is part of the minimum distance as well as Ai knowing if there are enemies. THey are both compared. So that issue you are having shouldn't be fault of ZBE unless you are putting a super-short AI distance.

Share this post


Link to post
Share on other sites

i'm a little confused, i read on armaholic "As a note if ran as an addon on server only, client's won't use empty vehicle caching. If your mission intends to have more then 100 empty vehicles, I strongly recommend using the script version!"

and here "Addon and script now work the same as of v4.4b. Run script in mission or use addon on server only."

and on mod/script i only see "if (isServer)"... this information is no longer valid?

this mod/script is now server side only?

best regards

havena

Share this post


Link to post
Share on other sites

Yeah, is server side only, as work is done on server and effects get applied for all clients.

Share this post


Link to post
Share on other sites

However, if you spawn a ton of AI on your client, then they would not be affected by ZBE_cache. This is unlikely in most missions however.

Share this post


Link to post
Share on other sites
However, if you spawn a ton of AI on your client, then they would not be affected by ZBE_cache. This is unlikely in most missions however.

You can always try in a test mission, but I would say it would work without issues. If I recall correctly all the commands are the Global variants that can be used anywhere and affect anyone.

Share this post


Link to post
Share on other sites

Holy crap, it's happening:

"Added: setGroupOwner script command for changing the locality of a group (setOwner will no longer work for objects with AI)"

This is an old document I authored a year or two ago, I may be able to start looking into moving around locality of units which is super exciting! Let me get my dev tools reinstalled and get back to work.

Share this post


Link to post
Share on other sites

I've yet to do a proof of concept to be sure setGroupOwner transfers waypoints, etc but I did start to plan out the loop.

Logic is:

  1. What type of machine am I running on? If Dedi then lowerLimit = 40, HC lowerLimit = 30, Client = 45 (TBD actual amounts)
  2. What is my average diag_fps over 30 seconds?
  3. If the averaged diag_fps is lower then lowerLimit then let's try to transfer the AI group to something else that can handle it
  4. Priority to transfer to: HC then the best connected client

As of now, setGroupOwner can only transfer AI from dedi to client/HCs and from clients/HC to other clients/HC (cannot transfer anything to dedicated server - vote here). AI that are on clients who disconnect are already transferred back to server, has been this way at least since Arma 2.

94c81ac8ba.png

Share this post


Link to post
Share on other sites

Looks like a plan ! I wonder if there is any transient microstutter when this transfer occurs (in the same way that creating AI causes a microstutter) ?

Share this post


Link to post
Share on other sites

not sure if this has been suggested yet, but it'd be nice if there were multiple cache ranges for different vehicle types. something to cache infantry at 500m, for example, but cache vehicles at 1000 and aircraft at 2000. alternatively maybe there could be a variable assigned to each unit that would overwrite the default cache range.

Share this post


Link to post
Share on other sites
not sure if this has been suggested yet, but it'd be nice if there were multiple cache ranges for different vehicle types. something to cache infantry at 500m, for example, but cache vehicles at 1000 and aircraft at 2000. alternatively maybe there could be a variable assigned to each unit that would overwrite the default cache range.

It is already included.

Share this post


Link to post
Share on other sites
It is already included.

aren't those parameters for empty vehicles? i was referring to caching AI within occupied vehicles

Share this post


Link to post
Share on other sites
aren't those parameters for empty vehicles? i was referring to caching AI within occupied vehicles

You are right, those params are for empty vehicle caching distance. As if now, there is no param for manned vehicles and relies on the generic AI caching distance variable. Great suggestion though!

**NEWS**

I've successfully setGroupOwner'd an AI group to a client machine and the group maintained waypoints :yay:

AI Load balancing has been moved to this thread to keep this one clean and focused on caching.

Edited by zorrobyte

Share this post


Link to post
Share on other sites
You are right, those params are for empty vehicle caching distance. As if now, there is no param for manned vehicles and relies on the generic AI caching distance variable. Great suggestion though!

**NEWS**

I've successfully setGroupOwner'd an AI group to a client machine and the group maintained waypoints :yay:

AI Load balancing has been moved to this thread to keep this one clean and focused on caching.

I don't see a benefit in including this option. Why would you like to have AI cached in different distances depending on the vehicle they are mounted?

Share this post


Link to post
Share on other sites
I don't see a benefit in including this option. Why would you like to have AI cached in different distances depending on the vehicle they are mounted?

because vehicles have have significantly longer engagement ranges than infantry. tank combat can happen from well outside 2000m in this game, so vehicle crews need to uncache then whereas most infantry engagements happen within 500 meters.

currently you either set everything to uncache at vehicle distance(bad for performance), or remove vehicle groups from caching(still bad for performance but not as much)

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

×