zorrobyte 30 Posted November 14, 2014 (edited) So this script works with MCC/Zeus and AI Script/mods like ASR_AI / Gaja / Upsmon? It should work with any script/mod as the units are "frozen" and hidden instead of deleted/respawned. Scripts/mods will still issue waypoints, commands and so on for the cached units. What sets this caching script apart from others is that one unit from the group (the TL) stays uncached and continues on his merry way so with HETMAN/Gaja/Upsmon,etc the group continues to follow waypoints leading to a seamless experience. Here is a (lower quality, sorry) video showing just how it works. http://youtu.be/ZF8RLjSl_tU Thanks zorrobyte for this script!Anything that can help performances is more than welcome. I gave it a try last night and it seems to be working flawlessly! EDIT : One small advice though, you could make your loops run even faster by using "pushback" whenever you need to add a new element to an array. According to the wiki, the speed gain is up to 11843% (!) ;D Thank you for the feedback, I'm happy you are enjoying the script! I've been away from Arma for some time, was waiting for HC and COOP performance to come back. I'm really impressed with the progress BIS has made over the past year and it's great they are/will be focusing on clientside/COOP performance. I didn't know about pushback command, I appreciate you mentioning it! Anything that can keep the script lightweight is awesome as I want it to be as quick as it can for those heavy load missions. Edited November 14, 2014 by zorrobyte Share this post Link to post Share on other sites
pulstar 55 Posted November 14, 2014 Thank you for continually improving this useful script, could we have an addon version in the future? Share this post Link to post Share on other sites
zorrobyte 30 Posted November 14, 2014 (edited) Eventually, yes. I want to be sure it's completely optimized and bug free before compiling another addon. A week or so? I'd like to migrate the SQF allGroups check to per group FSM for performance and so it will further avoid impact on SQF execution (not that it is an issue now). As for the next uncached TL teleporting around issue, I just figured it out. I believe what I'll do is force the group to uncache if the TL receives damage, this will put the group back in formation instead of uncaching the next TL (and group) wherever the group cached on last cycle. Although I think rare to occur, would be useful of a cached group's TL gets killed in an arbitrary manner such as artillery fire, sniper fire received from outside cache range, etc. EDIT Well that's sweet! FSMs is much snappier and with the TL damage check, the group uncaches (I set to 30 seconds) which is enough time for the group medic to heal the TL. Edited November 15, 2014 by zorrobyte Share this post Link to post Share on other sites
R3vo 2654 Posted November 15, 2014 (edited) Eventually, yes. I want to be sure it's completely optimized and bug free before compiling another addon. A week or so?I'd like to migrate the SQF allGroups check to per group FSM for performance and so it will further avoid impact on SQF execution (not that it is an issue now). As for the next uncached TL teleporting around issue, I just figured it out. I believe what I'll do is force the group to uncache if the TL receives damage, this will put the group back in formation instead of uncaching the next TL (and group) wherever the group cached on last cycle. Although I think rare to occur, would be useful of a cached group's TL gets killed in an arbitrary manner such as artillery fire, sniper fire received from outside cache range, etc. EDIT Well that's sweet! FSMs is much snappier and with the TL damage check, the group uncaches (I set to 30 seconds) which is enough time for the group medic to heal the TL. It's still not bugfree I'm afraid. It's still teleporting Ai units randomly. Edit: It seems to only teleport AI units which are using BIS_fnc_ambientAnimCombat & BIS_fnc_ambientAnim,although, I'm not 100% sure about that. Would it perhaps be possible to add an option,which allows us to choose, whether AI units or empty vehicles or both should be cached. Edited November 15, 2014 by R3vo Share this post Link to post Share on other sites
zorrobyte 30 Posted November 15, 2014 (edited) Please zip the mission you are using and Pm me a dropbox link or the like, this could be due to script load and delay. Unsure as of yet, would be very helpful! This goes for anyone who is experiencing the *random* unit teleport issue as I have been unable to duplicate. The codewhich moves the units back to the TL: _x setPosATL (formationPosition _x); Wow thanks R3vo! I saw that the animations were going nuts when one goes outside and back into cache range. While I'm working on the FSM port, replace the main.sqf with this for a fix: http://pastebin.com/U4qbrQjJ As for the "rubber banding" when the AI group members uncache and setPos back into formation (in certain behaviors it seems), I'm afraid there isn't a fix for that. As typical caching distance is 1000M and the rubber band effect is only for a few milliseconds (and the AI quickly get back into formation), it shouldn't be a huge deal. Aware behavior don't seem to rubber band as much or if at all. Edited November 16, 2014 by zorrobyte Share this post Link to post Share on other sites
kremator 1065 Posted November 16, 2014 Looking forward to an updated addon version ... looks like this may be a real winner. Good work ZB ! Share this post Link to post Share on other sites
redarmy 422 Posted November 16, 2014 is it normal that AI when meeting other ai in cache state,ONLY have squad leader at position,and the rest of squad still further away. Let me explain: A squad ran from molos town,to molos airport,cache distance 20meters for test.so when leaving molos town,the group except leader got cached,when the leader reached the airport,and engaged another cached enemy group,only squad leader was there.Rest of squad were still at molos townand then the next leader in the group started waypoint towards molos airport(airfield),he died,and process repeated untill all group members were dead. Is it meant to be like that?I was expecting the entire group to uncache when engaged with enemy. Share this post Link to post Share on other sites
zorrobyte 30 Posted November 16, 2014 No, the uncached group members are supposed to uncache in formation with the TL as seen in the video. I'm working on a FSM rewrite now that should address the problem. Share this post Link to post Share on other sites
kremator 1065 Posted November 16, 2014 I always like when FSMs are used. The update will be awesome. Share this post Link to post Share on other sites
zorrobyte 30 Posted November 16, 2014 (edited) It's working *zoinks* I'll have a configuration option for at what FPS the caching module starts working. Having everything uncached and working vanilla until FPS drops below X for zorrobyte to kick your PC in the pants sounds pretty awesome right? Also, only as many AI that are needed to be cached will at any given time. I could use this as a "performance metric" and spam it somewhere so if you see 100% of your AI getting cached at a 20FPS target on dedicated, you know your mission needs optimization. Edited November 16, 2014 by zorrobyte Share this post Link to post Share on other sites
whiztler 137 Posted November 16, 2014 I'll have a configuration option for at what FPS the caching module starts working. Having everything uncached and working vanilla until FPS drops below X for zorrobyte to kick your PC in the pants sounds pretty awesome right? Sounds fab! Share this post Link to post Share on other sites
zorrobyte 30 Posted November 17, 2014 (edited) v4 WIP showing that groups can be cached/uncached using setvariable and that cached units can still take damage (useful for arty in the AO, etc) This is running on FSM. http://youtu.be/kq-7tolEB3w Please PM me if you'd like to test the WIP v4. What's not in the WIP (currently working on): Optional clientside objectviewdistance based on client FPS with a max set to caching distance (so players don't see AI uncache) and to help client FPS Possible auto cache distance for AI depending on server FPS (maybe..) Edited November 17, 2014 by zorrobyte Share this post Link to post Share on other sites
redarmy 422 Posted November 17, 2014 excellent stuff!! Share this post Link to post Share on other sites
zorrobyte 30 Posted November 17, 2014 (edited) Currently working on: Optional clientside objectviewdistance based on client FPS with a max set to caching distance (so players don't see AI uncache) and to help client FPS (done - tweaking now and yes, FSM) Optional auto cache distance for AI depending on server FPS (if feasible.) - would need to PVAR zbe_aiCacheDist for clients to adjust auto objectviewdistance FSM. Maybe in a future version, would need tested. Done spamming updates for now, it's 2am and time to sleep. Edited November 17, 2014 by zorrobyte Share this post Link to post Share on other sites
zorrobyte 30 Posted November 18, 2014 ZBE_Cache V4 has been released, read the front page for changelog and details: Click me Share this post Link to post Share on other sites
LSD_Timewarp82 21 Posted November 18, 2014 Thanks dude, i will try it while playing WholeLottaAltis, should be a good indicator i think Share this post Link to post Share on other sites
LSD_Timewarp82 21 Posted November 18, 2014 My test failed, used: addon version Like mentioned i tried to use it in WholeLottaAltis, Enemy AI started to teleport after a couple of minutes, movement of them looked like hard desync. :( Share this post Link to post Share on other sites
sonsalt6 105 Posted November 18, 2014 Updated mod 0.4 available at withSIX. Download now by clicking: Share this post Link to post Share on other sites
Guest Posted November 18, 2014 Thank you very much for sending us the updated version :cool: New version frontpaged on the Armaholic homepage. ZBE Caching v4 ================================================ We have also "connected" these pages to your account on Armaholic. This means soon you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have. When you have any questions already feel free to PM or email me! Share this post Link to post Share on other sites
redarmy 422 Posted November 18, 2014 Zarrobyte cached groups which move,ignore full speed movement orders,walking with weapons up only,until uncached.If they re cache again,the resume weapons up slow slow pace. Tested using MCC,and viewing units through PIP via mcc console Share this post Link to post Share on other sites
zorrobyte 30 Posted November 18, 2014 My test failed, used: addon versionLike mentioned i tried to use it in WholeLottaAltis, Enemy AI started to teleport after a couple of minutes, movement of them looked like hard desync. I have failed to duplicate this behavior. What is your cache range? Does this happen on the edge of cache range or constantly? Was this on a dedicated server or running on your own PC? What was your PC's FPS when this happened? Are you using any other mods? What happens if you set your object draw distance to a bit lower than the cache distance? If possible, a video of the behavior would be great! Zarrobytecached groups which move,ignore full speed movement orders,walking with weapons up only,until uncached.If they re cache again,the resume weapons up slow slow pace. Tested using MCC,and viewing units through PIP via mcc console Ah yes, forgot about the _x setspeed full tweak. Will fix today. Share this post Link to post Share on other sites
SavageCDN 231 Posted November 18, 2014 Great work Zorro Share this post Link to post Share on other sites
redarmy 422 Posted November 18, 2014 thanks Zorrobyte.works really well otherwise.How about crewed veihicles?Are the crew cached? Share this post Link to post Share on other sites
zorrobyte 30 Posted November 18, 2014 (edited) Changelog: v4.1 ZBE_Cache no longer uses setSpeedMode, the AI in your missions will proceed as your waypoints intend. Changed setPos to setPos formationposition so group leaders move full speed (if speedMode "Normal"/"Full"). Changed zbe_setPos to zbe_setPosLight and zbe_SetPosFull. Light setPos formationPosition, Full setPos formationPosition with 3 second allowdamage false so units don't die on inclines when uncached. zbe_aiCachingDedicated.fsm now uses disableai commands for additional performance savings. Client/Listen server does not as disableai can break animations 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 Download thanks Zorrobyte.works really well otherwise.How about crewed veihicles?Are the crew cached? As of now, units in vehicles cannot be cached due to A3 bug: http://feedback.arma3.com/view.php?id=21702 Once this is fixed, all but the driver will be cached. When that time comes, I'll revisit to see if there would be benefit in the gunner(s) remaining uncached as well. Edited November 18, 2014 by zorrobyte Share this post Link to post Share on other sites
R3vo 2654 Posted November 18, 2014 Changelog:v4.1 ZBE_Cache no longer uses setSpeedMode, the AI in your missions will proceed as your waypoints intend. Changed setPos to setPos formationposition so group leaders move full speed (if speedMode "Normal"/"Full"). Changed zbe_setPos to zbe_setPosLight and zbe_SetPosFull. Light setPos formationPosition, Full setPos formationPosition with 3 second allowdamage false so units don't die on inclines when uncached. zbe_aiCachingDedicated.fsm now uses disableai commands for additional performance savings. Client/Listen server does not as disableai can break animations 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 Download As of now, units in vehicles cannot be cached due to A3 bug: http://feedback.arma3.com/view.php?id=21702 Once this is fixed, all but the driver will be cached. When that time comes, I'll revisit to see if there would be benefit in the gunner(s) remaining uncached as well. Well done, zorrobyte. The teleporting issue seems to be fixed. Share this post Link to post Share on other sites