Jump to content
zorrobyte

ZBE_Cache AI & Vehicle caching script/addon

Recommended Posts

Well we use over 20GB of tested addons, but today's mission was first that was using ZBE Cache. Addon I used in this mission from all this pack were: RH M4/M16, PMC, AGM, BWMod, CBA_A3, LHD. Our enemy was vanilla CSAT units. Mission was built on UPSMON - even when testing offline UPSMON was loading very long (it tends to load very quickly without ZBE). Looks like ZBE Cache delays scripts execution time.

I'm afraid to say that ZBE may be the "straw that broke the camel's back" for your config. The script scheduler is linear and once a queue forms that takes longer to process then the time that has been budgeted, CPS dives.

I've been trying to make a one size fit all with both modules, it takes compromise and not everyone is certain to be happy. This may end up making Empty Vehicle caching optional, this will immediately reduce processing required by half and as AI is the most important area to optimize it would be worth doing so. Next version will have the proper userconfig and init options :)

Share this post


Link to post
Share on other sites

So I have been playing with triggers:

https://i.imgur.com/ENbBvdp.jpg (750 kB)

They check about twice a second, have virtually no CPS/FPS impact and can also use attachTo to "follow" units. They have magic variables such as thislist and list that only return alive/nondestroyed objects. I have been calculating distance for every player on the map, evaluating if near, building arrays and so on leading to load and CPS drop in some situations.

Yes, there is the pesky issue with ondeactivation not firing unless the trigger is triggered once first but I have a workaround for it. Yes, triggers do not have the ability to account for independent automagically, two triggers will be required per group. I'll need to do some deep thought on how to account for all eventualities but the work should be well worth it.

Share this post


Link to post
Share on other sites

Hey Mate this is great, Wondering if you could add this to items as well, like dropped objects such as weapons or mines.

thanks

Share this post


Link to post
Share on other sites

Wondering if you could add this to items as well, like dropped objects such as weapons or mines.

thanks

Not sure this would have much effect, as GroundWeaponHolder's and mines are not PhysX objects.

Share this post


Link to post
Share on other sites

Shouldn't the vehicles be cached when outside the set distance? or is it only the crew?

does this work for MP?

Edited by Coolfact
MP?

Share this post


Link to post
Share on other sites

It is thought for MP.

Empty vehicles are "enabledSimulation false", so engine ingnores them and consume less resource.

Manned vehicles have load cached, all but driver and leader of the group inside.

Share this post


Link to post
Share on other sites
Does this work together with ALiVE?

Most likely not - and what would be the point? Alive already has a caching system?

Share this post


Link to post
Share on other sites

How's it going with the triggers so far? Have you found that workaround yet?

Share this post


Link to post
Share on other sites

Hey bud just wanted to say I really appreciate this mod. I'm currently playing Takistan BECTI (RHS) mission / campaign and love it. I did have a quick question tho, I looked through this thread and searched for hide, minimize...didn't get anything. I just need to know how to hide or minimize the Debug data window on the top right? Is there a way to do that? Anyway, awesome mod, getting a MANW vote for sure!

Share this post


Link to post
Share on other sites

Using the addon version, in the userconfig file "zbe_cache.hpp":

zbe_cache_debug = 1; //Debug hint/RPT? 1 on 0 off

set it to 0

Share this post


Link to post
Share on other sites

Hey zorrobyte,

I want to use this mod in one of my multiplayer missions, and I would like to know, whether this script needs to be executed on every client, or server only ,or both? In addition, do you know proper values for the script execute, which work well in multiplayer?

Share this post


Link to post
Share on other sites
Hey zorrobyte,

I want to use this mod in one of my multiplayer missions, and I would like to know, whether this script needs to be executed on every client, or server only ,or both? In addition, do you know proper values for the script execute, which work well in multiplayer?

Only in server.

The init.sqf included already has the check condition.

Share this post


Link to post
Share on other sites
Only in server.

The init.sqf included already has the check condition.

Thank you!

Share this post


Link to post
Share on other sites

Are there any more updates coming? There haven't been any changes posted to bitbucket!

Share this post


Link to post
Share on other sites

I MAY have found an issue with zbe_cache, but putting it up here for people to confirm and check. Playing with the new F16 standalone and latest MCC I have zbe_cache running (always!) I spawn an F16 and it gets shot down and pilot ejects. The burning aircraft obviously goes outside the despawn range and the HANGS IN THE AIR ! It does not despawn!

Anyone seen anything like this ?

Share this post


Link to post
Share on other sites

The caching system uses enableSimulation, so if a vehicle is hit while it's beyond the cache distance, it'll freeze.

Share this post


Link to post
Share on other sites

I used this script very successfully about two weeks ago, but today for some reason I have units caching but not un-caching. I didn't notice at first because all of my testing was within the cache distance of 1000 that I'd set. However, when I start outside this distance and the units cache, they seem reluctant to un-cache. It's only 98 groups, roughly 319 units, with 190? perhaps? cached according to the debug window. Has anyone else run into this? Unfortunately, I discovered this the day before I'm supposed to present it to my community.

There are about 60-65 mods in use, including the popular ones like AGM, RHS, HLC, RH, etc. This is what the file looks like (if I'm able to link): https://www.dropbox.com/s/wok7lwf42xthawd/opDecisiveStrike.Sara.zip?dl=0

I'd be immensely grateful for any wisdom, advice, or insight the community can offer. Thanks in advance!

Share this post


Link to post
Share on other sites

The uncaching COULD be to do with a very low FPS which ZBE_cache detects and then stops uncaching to make the system worse.

Share this post


Link to post
Share on other sites
The uncaching COULD be to do with a very low FPS which ZBE_cache detects and then stops uncaching to make the system worse.

Thanks for the feedback, Kremator. I considered this as a possibility and set the FPS Limiter to -1 for automatic. I thought this meant it wouldn't limit caching/uncaching, but do you think it might be setting its own threshold? I'll have to either test other values or see if there's a way to remove or comment that out.

Share this post


Link to post
Share on other sites

Yes, it turns out it was the FPS Limiter. There's a note in Zorro's readMe saying that it can sometimes break missions, in which case it should be set to 0 (zero). Out of curiosity, what settings do you guys tend to use? What sort of unit counts do you work with? Any tips or warnings? I love the script and want to make better use of it, especially for vehicles, which I currently have cacheDisabled for. Thanks to Zorro and friends for the awesome coding work!

Share this post


Link to post
Share on other sites

Just been playing with genesis92x AI addon here and liking it so far, however I noticed that a squad leader was injured (following an arty attack) and the medic was trying to heal him. During the heal the medic cached and it didn't look like the SL got healed. Is there a way to not cache if animations (like healing, or setting up a squad weapon etc) are being played?

Share this post


Link to post
Share on other sites
Ahhh I hope zb can then hide it first :)

Problem here is that vehicle is tripulated, hit, AI gets out, and then vehicle is considered empety and thus applied the "empty vehicles" caching logic.

A solution was made separating the land,air and sea vehicle and applying different distances to them. You could change the config and increase the caching distance for Air vehicles.

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

Just been playing with genesis92x AI addon here and liking it so far, however I noticed that a squad leader was injured (following an arty attack) and the medic was trying to heal him. During the heal the medic cached and it didn't look like the SL got healed. Is there a way to not cache if animations (like healing, or setting up a squad weapon etc) are being played?

Don't think so, and if the group is cached, means no player is near, so it does not really matter if he is healed or not. When uncached, the leader will ask for heal and will be healed succesfully.

Also, static weapons count as vehicles, and since only one AI can man a static weapon (the driver of the weapon) it means it will not be cached, so there should be no issues with static weapons. Once the AI unit dismounts from it, it will be cached and will "virtually" follow the leader".

---------- Post added at 03:07 ---------- Previous post was at 03:06 ----------

Yes, it turns out it was the FPS Limiter. There's a note in Zorro's readMe saying that it can sometimes break missions, in which case it should be set to 0 (zero). Out of curiosity, what settings do you guys tend to use? What sort of unit counts do you work with? Any tips or warnings? I love the script and want to make better use of it, especially for vehicles, which I currently have cacheDisabled for. Thanks to Zorro and friends for the awesome coding work!

I would recommend to add and use ASM (arma server monitor) into your server, and use it to check and monitor FPS/CPS in the server and under stress loads, mision making or debugging.

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

×