Jump to content
naught

AI Caching and Distribution System

Recommended Posts

- cB AI Unit Caching from Wolffy i will get 145 fps

Hey all - I'm seeing my name get thrown around a bit in this thread, so just some quick clarifications.

http://forums.bistudio.com/showthread.php?97372-Cached-Units-with-Vehicle-Support-v2-0

Date: April 3, 2010

That code hasn't been maintained for almost 4 years.

To be very clear, the above script is not the same mechanism used by ALiVE to avoid the AI count limit, so please do not confuse the two projects.

Share this post


Link to post
Share on other sites
Hey all - I'm seeing my name get thrown around a bit in this thread, so just some quick clarifications.

http://forums.bistudio.com/showthread.php?97372-Cached-Units-with-Vehicle-Support-v2-0

Date: April 3, 2010

That code hasn't been maintained for almost 4 years.

To be very clear, the above script is not the same mechanism used by ALiVE to avoid the AI count limit, so please do not confuse the two projects.

I did not mean to bash you or anything! I was only talking about your "script" not you, because Naught script is similar on having the leader not being cached but the rest of the squad!

Naught big thanks for the fix! gonna try it now!

Happy new year for you guys! ;)

Edit: 1017 still has the same problem as before.

Edited by Grillob3

Share this post


Link to post
Share on other sites

Nice work Naught, been waiting for an A3 compatible version. Cheers!

Share this post


Link to post
Share on other sites

Random question. The CBA requirement, is that just for server/headless client, or for everyone connecting/playing?

And when you say 'drag and drop' is it simply a matter of dropping the whole "Unit Caching" folder in my root folder or do I need to add any lines to my root init/description/etc files.

Edited by Meatball

Share this post


Link to post
Share on other sites
Random question. The CBA requirement, is that just for server/headless client, or for everyone connecting/playing?

And when you say 'drag and drop' is it simply a matter of dropping the whole "Unit Caching" folder in my root folder or do I need to add any lines to my root init/description/etc files.

If CBA isn't on the machine, then none of the code will run, so it's only really necessary on any machine which will be hosting the AI (servers/HC).

And drop the contents of the "Unit Caching" folder to your mission (the scripts folder should be in your root mission directory), and append the lines of the description.ext if it asks to overwrite, and that's it.

Share this post


Link to post
Share on other sites

Updated to 1.0.1.8 - v1.0 Beta 8

This is a pre-release version of the software, so expect some bugs or otherwise broken features.

This is an incremental release, so it can be seen as a "hotfix" of sorts. It won't add anything major, but it does fix bugs which evaded the bug-testing phase.

Note: Unfortunately my previous untested release broke the caching mechanism of this script, so updating to 1.0.1.8 from 1.0.1.7 is mandatory. But if things do go well this should be the last beta update.

+Note: A release-candidate should be done soon, so, if you can, hold-off on putting this into a major release mission, or be prepared for a quick update, hopefully fixing many of the issues.

Download Unit Caching and Distribution System v1.0 Beta 8.


Changelog

1.0.1.8

  • [FIXED] 1.0.1.7 regression which caused caching checks to spin infinitely.

1.0.1.7

  • [FIXED] Units' volatile shifts to leadership are now accounted for while caching.
  • [NOTE] SSD crashed, proceeding without testing (for now).

1.0.1.6

  • [FIXED] Possible error in config.sqf with wrong types.
  • [FIXED] Enabled CBA caching of static files for release version.

1.0.1.5

  • [NEW] Initial public release.

Edited by Naught

Share this post


Link to post
Share on other sites

I'm sorry if this is a stupid question, but...

I don't understand what a "headless client" is...I host my missions on my pc, and my friends join for coop. Will your system benifit me?

Share this post


Link to post
Share on other sites

The HC compatibility is probably just a great perk of this caching system. I'm sure it would work on your hosted maps. No better way to find out than to try it out though.

Share this post


Link to post
Share on other sites
I'm sorry if this is a stupid question, but...

I don't understand what a "headless client" is...I host my missions on my pc, and my friends join for coop. Will your system benifit me?

Yes, the caching aspect would still increase performance, especially if you host it and play it on the same PC.

Also, so everyone knows, I'm currently finished with and testing a new version which should fix a few issues with the script (ie. magazine message, AI leaders fleeing, etc.) and it should be out soon.

---------- Post added at 14:59 ---------- Previous post was at 13:03 ----------

Updated to 1.0.2.2 - v1.0 RC 2

I told you that this one was coming really soon! Thank you all for your patience on a stable release (especially Foxhound). :)

This is a full-release, but does not contain a guarantee of any type of support.

Bugs and other issues should have been found and patched through testing, but are still possible in the RC. If you find one, report it back in this thread or on the Github issues page.

This release candidate has been deemed stable enough to be used in production environments. Proceeding v1.0 updates should be sparse, should contain nothing major, and should not be mandatory.

Download Unit Caching and Distribution System v1.0 RC 2.


Changelog

1.0.2.2

  • [FIXED] AI no longer flee when their group is cached (work-around).
  • [FIXED] Library linkages now correctly handle others' exceptions.
  • [FIXED] 'No entry in CfgMagazines ...' error has been fixed (due to currentMagazine command).
  • [FIXED] Rewrote the caching functions to check for all exceptions at the correct points.

1.0.1.8

  • [FIXED] 1.0.1.7 regression which caused caching checks to spin infinitely.

1.0.1.7

  • [FIXED] Units' volatile shifts to leadership are now accounted for while caching.
  • [NOTE] SSD crashed, proceeding without testing (for now).

1.0.1.6

  • [FIXED] Possible error in config.sqf with wrong types.
  • [FIXED] Enabled CBA caching of static files for release version.

1.0.1.5

  • [NEW] Initial public release.

Share this post


Link to post
Share on other sites

Hey Naught, is there any way to use your script strictly for AI distribution to HC's without any caching? Or is caching integral to the distribution process? Looking at the scripts, I think that's the case, but wanted to check.

Share this post


Link to post
Share on other sites

Excellent, I'll give that a shot. I assume that will break any pathing of pre placed units?

Share this post


Link to post
Share on other sites
Excellent, I'll give that a shot. I assume that will break any pathing of pre placed units?

It shouldn't interfere with pre-placed waypoints since those are global to the group, but any dynamic scripts like UPSMON may break.

Share this post


Link to post
Share on other sites
Yes, the caching aspect would still increase performance, especially if you host it and play it on the same PC.
Thanks, that's exactly what I do. Looks like I'll be using this from now on :)

Share this post


Link to post
Share on other sites
AI distribution may break scripts which modify AI behaviour (such as UPSMON). To fix this, an advanced user may use the "CACHE_UNIT_SPAWN_FNC" definition to define a function to load and process on every cached unit spawn, such as this (where "MY_fnc_unitSpawn" contains code with differentiates between vehicles and units and runs scripts accordingly)

Great script, and thanks for your hard work. Being a safe distance from advanced user status, could you please tell me exactly what I'd need to do and where I'd need to do it in order to make this script play nicely with Upsmon. And would doing this cause any problems with stability or performance?

Thanks again.

Share this post


Link to post
Share on other sites
Great script, and thanks for your hard work. Being a safe distance from advanced user status, could you please tell me exactly what I'd need to do and where I'd need to do it in order to make this script play nicely with Upsmon. And would doing this cause any problems with stability or performance?

Thanks again.

No it shouldn't cause any issues with performance or stability.

If you're not planning to use a headless client, then the script will work with UPSMON as-is.

Otherwise you'd have to define a function (#define CACHE_UNIT_SPAWN_FNC {func}) in the config.sqf to run when a group is transferred over to the HC, like this:

#define CACHE_UNIT_SPAWN_FNC {_this spawn UCD_fnc_newUnitSpawn} // Should remain small, will be sent to all clients on mission load

UCD_fnc_newUnitSpawn = {
uisleep 1; // Wait for group transfer and processing
if (isNil {(group _this) getVariable ["UPSMON_grpid", nil]}) then {
	[(leader _this), "dynamicPatrolArea", "spawned"] call compile preprocessFileLineNumbers "scripts\upsmon.sqf";
};
};

call compile preprocessFileLineNumbers "scripts\Init_UPSMON.sqf"; // Remember to load UPSMON in here too

To tell you the truth, I have no idea if the above code will work, or maybe UPSMON works with this script and headless client(s) out of the box - you'll have to test it out though. If the transfer works quick enough the UPSMON shouldn't detect that the group all died and respawned, but it may also have locality checks that would stop execution.

Edited by Naught

Share this post


Link to post
Share on other sites

Am I reading things wrong or is arma 2 a requirement? Why?

What if a missions is run on a dedicated server? Does the server need arma 2 installed?

Does every client need arma 2 installed?

>The caching system works by deleting all AI but the group leader

Is this still the case? If so that's pretty pathetic outside of very small missions and doesn't stand a hope at being useful in any major dynamic mission with potentially hundreds of ai groups.

Edited by Flens

Share this post


Link to post
Share on other sites

It's useable for both ArmA2 and A3, you need either of them, not both.

Share this post


Link to post
Share on other sites
Am I reading things wrong or is arma 2 a requirement? Why?

What if a missions is run on a dedicated server? Does the server need arma 2 installed?

Does every client need arma 2 installed?

>The caching system works by deleting all AI but the group leader

Is this still the case? If so that's pretty pathetic outside of very small missions and doesn't stand a hope at being useful in any major dynamic mission with potentially hundreds of ai groups.

Like tryteyker mentioned, the script works for any version of Arma after Arma 2 OA v1.62, which includes Arma 3.

And yes it still is the case, but I disagree on your opinion that it's "pathetic" - the caching portion can transform a mission with potentially 416 AI (on multiple headless clients of course) to about 32 AI. This is a reduction of over 92%, and since Arma performance scaling is largely non-linear after about 100+ AI on one machine, that could mean huge multiples of performance (think way over 24x greater performance on a previously unplayable mission).

I assume you're misinformed with how many units are typically in a group, which should usually be as high as possible without breaking the limitations of realism. Standard groups have anywhere from 4 AI to 21+ AI, and even on the lowest scale performance will drastically improve with caching.

Also I don't understand your assumption that it would work better on smaller missions instead of larger ones; the reality is actually the polar opposite, the more AI you have, the larger the performance gain.

Share this post


Link to post
Share on other sites
pretty pathetic

You're confusing this caching system with your attitude towards others free work.

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

×