Jump to content
Sign in to follow this  
fabrizio_t

FlexiAI (WIP) discussion

Recommended Posts

Isn't something like this the perfect change to get a new module in the game?

Having this as a module which you only have to sync to group leaders so they use the script.

I thought that's where the module system was created for. Just my 2ct

Looks great

Sounds good, very good.

Is there any documentation on the WIKI on how to set up such a module ?

Sorry, i so am so lazy and need some more info ;)

Share this post


Link to post
Share on other sites

OHH SQL INIT :( 2 versions pls addon affect all units and vercion scrip SQL =))))))))

version addon

version SQL

PLS

I am Play with editor no campaing :D!

Share this post


Link to post
Share on other sites

You can check the folder : ArmA 2\AddOns\modules\AIS\

Ther you can see how to set up such a modul.

Well currently i do play around with this idea too. :)

Config.cpp

class CfgVehicles
{
class Logic;

class GL4_System : Logic
{
	displayName = "Group Link 4";
	icon="\ca\ui\data\icon_famisc_ca.paa";
	picture="\ca\ui\data\icon_famisc_ca.paa";
	vehicleClass = "Modules";

	class Eventhandlers
	{
		init = "if (isNil ""GL4_Path"") then {GL4_Path = ""\@GL4\AddOns\GL4_System\""; _this execVM (GL4_Path+""GL4_System.sqf"") } else { _this execVM (GL4_Path+""GL4_System.sqf"") } ";
	};
};
};

GL4_System.sqf

// ////////////////////////////////////////////////////////////////////////////
// GL4 v.1.0
// ////////////////////////////////////////////////////////////////////////////
// System Initialize
// By =\SNKMAN/=
// ////////////////////////////////////////////////////////////////////////////
private ["_a","_b","_c"];

_a = _this select 0;

_b = (synchronizedObjects _a);

if (count _b > 0) then
{
_c = (_b select 0);

[side _c] execVM (GL4_Path+"GL4\GL4_Database\GL4_Initialize.sqf");

GL4_Debug = [False, True];
}
else
{
hint "Error: You need to synchronizise a enemy A.I. unit with the Group Link 4 modul.";
};

The variable _b contains all units/groups which was synced with the logic.

In my case i only need the enemy A.I. side but you can use forEach to get all units/groups synced with it.

It's not that hard. Just give it a go.

@Extreing

No don't worry you can set up the AddOn that only units/groups which was synced with the logic get initialized.

Share this post


Link to post
Share on other sites
You can check the folder : ArmA 2\AddOns\modules\AIS\

Ther you can see how to set up such a modul.

Well currently i do play around with this idea too. :)

Config.cpp

class CfgVehicles
{
class Logic;

class GL4_System : Logic
{
	displayName = "Group Link 4";
	icon="\ca\ui\data\icon_famisc_ca.paa";
	picture="\ca\ui\data\icon_famisc_ca.paa";
	vehicleClass = "Modules";

	class Eventhandlers
	{
		init = "if (isNil ""GL4_Path"") then {GL4_Path = ""\@GL4\AddOns\GL4_System\""; _this execVM (GL4_Path+""GL4_System.sqf"") } else { _this execVM (GL4_Path+""GL4_System.sqf"") } ";
	};
};
};

GL4_System.sqf

// ////////////////////////////////////////////////////////////////////////////
// GL4 v.1.0
// ////////////////////////////////////////////////////////////////////////////
// System Initialize
// By =\SNKMAN/=
// ////////////////////////////////////////////////////////////////////////////
private ["_a","_b","_c"];

_a = _this select 0;

_b = (synchronizedObjects _a);

if (count _b > 0) then
{
_c = (_b select 0);

[side _c] execVM (GL4_Path+"GL4\GL4_Database\GL4_Initialize.sqf");

GL4_Debug = [False, True];
}
else
{
hint "Error: You need to synchronizise a enemy A.I. unit with the Group Link 4 modul.";
};

The variable _b contains all units/groups which was synced with the logic.

In my case i only need the enemy A.I. side but you can use forEach to get all units/groups synced with it.

It's not that hard. Just give it a go.

@Extreing

No don't worry you can set up the AddOn that only units/groups which was synced with the logic get initialized.

Very useful, thx.

The only drawback of this module approach is i won't be able to directly pass group-specific variables (eg. ROE) script, since it's executed for all the synched groups. Oh well, i'll probably use setVariable and store the value into the group itself, so you can still set config directly into the editor INIT field, eg:

(group this) setVariable ["_grp_engage_ratio", 0.6]; (group this) setVariable ["_grp_retreat_ratio", 0.1];

Will this be simple/handy enough ?

Share this post


Link to post
Share on other sites
The only drawback of this module approach is i won't be able to directly pass group-specific variables (eg. ROE) script, since it's executed for all the synched groups.

What about a dual implementation? Or an optional variable in the unit's init field pointing to such a ROE script?

Share this post


Link to post
Share on other sites
What about a dual implementation? Or an optional variable in the unit's init field pointing to such a ROE script?

Yes i was suggesting (optional) variables in the init field, set on group through "setVariable".

---------- Post added at 08:36 PM ---------- Previous post was at 08:24 PM ----------

Thx again, SNKMAN, with your help setting up the module was a breeze.

Now i have to bridge the module with my scripts ... a bit of adaptation needed.

Share this post


Link to post
Share on other sites
I think addons are the better solution, as I simply don't save all my missions, and if I don't save it, how can I use the AI scripts? If, for example, I wish to test an AI feature, I can't do that unless I fiddle around putting scripts into mission folders and running them from init lines. It's far easier and more convenient to use an addon that runs the scripts at the start of each mission, just like GroupLink 3 was.

You can make put any script in X:\Documents and Settings\Username\My Documents\ArmA 2\scripts (where X: is your windows drive) and execute it from any, even unsaved mission.

Share this post


Link to post
Share on other sites

Just saw

video. Due to lack of echelons and vees, I suspect there is more to it than just randomly selecting formations from a list? But I have problems seing how many of the formations used could be useful in this situation. And I really didn't like the frequency of formation changes, but I suspect that will eventually just be a matter of tweaking. Seems to me they were made kind of combat ineffective due to trying to change their position constantly.

However, I'm not an expert on formations by any means, so feel free to educate me on the subject :)

I loved how tight they operated in the city though.

Share this post


Link to post
Share on other sites

Honestly even though all of this work is great don't you think it's a bit boring just having the AI script for special forces while everyone else have the default script? We all know that using this script here makes the AI smarter but what about the default soldiers?

Share this post


Link to post
Share on other sites
Just saw
video. Due to lack of echelons and vees, I suspect there is more to it than just randomly selecting formations from a list? But I have problems seing how many of the formations used could be useful in this situation. And I really didn't like the frequency of formation changes, but I suspect that will eventually just be a matter of tweaking. Seems to me they were made kind of combat ineffective due to trying to change their position constantly.

However, I'm not an expert on formations by any means, so feel free to educate me on the subject :)

I loved how tight they operated in the city though.

Formation handling is just a little part of the features.

FlexiAI is actually using FILE, STAGGERED COLUMN, WEDGE, LINE and DIAMOND formations.

The choice is definitely not random, it depends on group state, environment or/and threatened sector angle.

On first enemy contact group defaults to LINE formation.

If group is facing a far and limited extension frontal threat it will choose LINE formation.

If enemy closes by then group may switch to WEDGE to better protect himself from flanking.

If flanking is already in progress group will choose DIAMOND formation.

When houses are nearby, but not very close, group will default to STAGGERED COLUMN (so units normally use road sides and group keeps cohesion).

If very close to houses it will move in FILE formation for tighter bounding overwatch.

I planned to use ECHELON formation for flanking, but group was spreading too much on terrain giving enemy a better spotting chance.

So groups are now flanking in FILE formation.

VEE formation is never used at the moment, i think it's a very specialized formation, maybe good for planes.

Probably it's just me ;)

I always wondered why vanilla AI does not dynamically change formation, so i injected into AI these simple formation change rules.

I agree formation switch can be sometimes too frequent, this has to be fine-tuned, like many other features.

---------- Post added at 09:08 AM ---------- Previous post was at 09:02 AM ----------

Honestly even though all of this work is great don't you think it's a bit boring just having the AI script for special forces while everyone else have the default script? We all know that using this script here makes the AI smarter but what about the default soldiers?

It's a matter of preference, personally i'm fine with that.

However FlexiAI can be applied to any (infantry) groups you wish, even all, opponents included.

What now i am finding very rewarding is playing as a member (not leader) of a FlexiAI group ;)

Also i am eagerly waiting for v1.05 patch and the spotting, detection and skill fixes that are deserved.

Edited by fabrizio_T

Share this post


Link to post
Share on other sites

This evening i tried to find some better way to command units into cover.

So far no luck, it seems we actually lack the tools to do it properly.

Also i tried running the default "find cover" (\-1-8) command as group leader to check whether it's working.

In my opinion it still does not work at all :(

Patch where are you ?

Edited by fabrizio_T

Share this post


Link to post
Share on other sites

Small update

Little time to spend, but project keeps shaping up.

Yesterday i made a few tests to try improving AT soldiers effectiveness, with mixed results.

Also added some basic target assigning routines for soldiers.

More important i finally managed to rewrite most part of the code so it's now using group-related variables instead of plain local variables, so it will be possible to easily tune-up any of these group variables at runtime, hence dynamically changing group behaviour at will.

Since these variables are set through "setVariable", this will hopefully assure some better MP reliability (if broadcasted as public variables - hope we will be able to broadcast "Group" type vars, currently not possible yet).

EDIT:

Beta patch 59857 out, but looking into the changelog it seems none of the assigned AI issues is fixed.

Well, at least we'll get some performance improvements and the awaited grass layer ;).

ftp://downloads.bistudio.com/arma2.com/update/beta/ARMA2_Build_59857.log

Edited by fabrizio_T

Share this post


Link to post
Share on other sites

just a guess

may be find cover' error in arma' log occurs cause wrong some command' params but is not not itself error??? need more testing???

mmmm// ma bad bad engliz))

do you read me??))

Share this post


Link to post
Share on other sites
just a guess

may be find cover' error in arma' log occurs cause wrong some command' params but is not not itself error??? need more testing???

mmmm// ma bad bad engliz))

do you read me??))

I guess it's a "design choice" that rendered the existing "findCover" & "setHideBehind" commands obsolete.

Read here the comment by Suma:

http://dev-heaven.net/issues/show/2016#note-21

A simple fix of "findCover" and "setHideBehind" is not possible, because a cover is no longer an object, it is a position instead (there are multiple cover points connected with one object)

I know no workaround for that.

Share this post


Link to post
Share on other sites

Since these variables are set through "setVariable", this will hopefully assure some better MP reliability (if broadcasted as public variables - hope we will be able to broadcast "Group" type vars, currently not possible yet).

Quoting myself :)

Documentation says otherwise, but broadcasting group variables through "setVariable" should already work, it seems.

Good for MP.

EDIT:

did anybody here noticed severe fps drop after latest beta patch?

I used to have a minimum frame rate fo about 12fps in one of my test mission, now sometimes it suddenly drops to about 5fps (!). That's a huge difference.

While having low FPS if i press ESC and CONTINUE frames suddenly jump to 25-30, then slowly degrade again.

[That's not a FlexiAI issue, since i tested this with vanilla AI].

Edited by fabrizio_T

Share this post


Link to post
Share on other sites
did anybody here noticed severe fps drop after latest beta patch?

While reading response of awesome fps gains ( in the beta feedback thread) i experience the same. It stayed the same but at some points drops like i never saw before.

Share this post


Link to post
Share on other sites
While reading response of awesome fps gains ( in the beta feedback thread) i experience the same. It stayed the same but at some points drops like i never saw before.

Are your FPS "spiking" on very low values (<10-15fps) ?

In that case, are you running a nVidia card?

If so, you may be interested in this:

On my lappy (Core 2 Duo T9600, Win 7 RC, nVidia FX3700M) the exact moment my GPU is reaching a certain temp (in my case 79°C) the OS is throttling down the CPU (multiplier goes down from 10.5x to 6.0x, clock from 2.8Ghz to 1.6Ghz, 40% less). Checked that by running many times ArmA2 in window, side by side with CPU-Z core clock readings and Speedfan temperature readings.

That's the incredible cause of the slowdowns for me (not BIS fault) :(

Edited by fabrizio_T

Share this post


Link to post
Share on other sites

some people did mention trouble with Nvidia drivers with the latest patch, so you might want to experiment with that.

Otherwise the patch itself gave me the smoothest ArmA2 experience yet.

Share this post


Link to post
Share on other sites
some people did mention trouble with Nvidia drivers with the latest patch, so you might want to experiment with that.

Otherwise the patch itself gave me the smoothest ArmA2 experience yet.

I'll try to rollback to 186.21 WHQL drivers, 191.07 seem to be too "hot" for my system.

---------- Post added at 10:17 AM ---------- Previous post was at 10:03 AM ----------

And hows the scripting coming along? Any new footage u want to show off :)

Despite performance problems and lack of time in last week-end, scripts are shaping well. I'm mostly doing some basic logics and features fine-tuning, plus code polishing.

I still need time to implement better tactical withdrawal logics and fix some known issues.

Next big step will be the addition of simplified AI support/logistic calls and handling (automated transport, CAS, artillery strikes).

Edited by fabrizio_T

Share this post


Link to post
Share on other sites

Hi i follow your progress and I am impressed.

I have a few questions for you if you would like to help :)

I write to you a message...

Share this post


Link to post
Share on other sites

My extreme performance problems in latest beta (when everyone else seems to be experience a boost), seems to occur only when I have grass turned on.

Share this post


Link to post
Share on other sites
Hi i follow your progress and I am impressed.

I have a few questions for you if you would like to help :)

I write to you a message...

Sorry warabiej, just answered to your message.

I think what you're interested in is quite different from what FlexiAI is supposed to do though.

Edited by fabrizio_T

Share this post


Link to post
Share on other sites

Seen the new supression command in the new beta patches!

Share this post


Link to post
Share on other sites
While reading response of awesome fps gains ( in the beta feedback thread) i experience the same. It stayed the same but at some points drops like i never saw before.

I can confirm this. Also experienced degrading FPS. The longer the mission goes the worse my FPS get.

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
Sign in to follow this  

×