Jump to content
infinity_loop

I want to implement my AI as a Mod - where to start?

Recommended Posts

Hi guys,

 

I suspect this might have been asked in the past but a quick search did not give me the answer I was looking for:

 

I have developed a game AI that I would like to adapt and try out in ArmA 3. Despite having built missions and scripted .sqf's for ArmA 3 before, I have no idea where to start with regards to modding the game and to modify/replace the AI that comes shipped with it. I would prefer to use C++ and have full control over the AI's decision making... Can anyone point me in the right direction on where to start? (Also: What language(s) are other mods written in and how do they link to the game?) Thank you very much for your help in advance.

 

Best

Share this post


Link to post
Share on other sites

There is only very limited control/access to AI code in RV engine unfortunately.

One can do some micro managing with hooking into danger.FSM, and doing some event based system (ie eventhandlers).

See the traditional AI mods.

 

What is to some extent more feasible is higher level AI planning and management.

See: http://www.plannedassault.com/

Share this post


Link to post
Share on other sites

As kju said, you're probably going to encounter some severe limitations when it comes to the amount of tactical control that can be exercised through mods. A lot depends on the nature of the changes you hope to make. Probably a good overview of current issues and recent improvements might be this thread; 

 

Some information on the subset of FSM routines that may be scripted here; https://community.bistudio.com/wiki/Arma_2:_Operation_Arrowhead:_AI_FSM

 

If you like working in C++ and/or have a body of existing code you may well want to write an extension (a native DLL that can be called from SQF); https://community.bistudio.com/wiki/Extensions

 

As you probably know, Arma isn't terribly multi-threaded so if you do write an extension I'd suggest running complex decision making in separate threads. Maybe maintain a table of best-next-course outcomes, prioritized by proximity to action for all units in play, ready to be fetched by an in-game script as is required/expedient. One obvious problem with threading this though is you wouldn't have real-time access to game/map data for doing LOS checks or pathing.

 

You may also want to look into Intercept (https://github.com/intercept/intercept) which I believe would allow you to fetch aspects of game state directly from your C++ code (though I expect only within the thread of the calling SQF).

Share this post


Link to post
Share on other sites

Welcome to Bis forums infinity_loop!

Heres a link to my AI Compilation list, not sure if you have seen the thread yet, if not

idk if it can help you with anything, but it has alot of references/links for threads, scripts, and mods for AI

hope that helps. Cheers!

 

Share this post


Link to post
Share on other sites

Thanks guys, your responses are much appreciated. I will go through them now!

 

@Defunkt "As you probably know, Arma isn't terribly multi-threaded so if you do write an extension I'd suggest running complex decision making in separate threads. Maybe maintain a table of best-next-course outcomes, prioritized by proximity to action for all units in play, ready to be fetched by an in-game script as is required/expedient." <-- that is exactly what I had in mind 😉

Share this post


Link to post
Share on other sites
2 hours ago, infinity_loop said:

that is exactly what I had in mind

 

Excellent, was part of a solution I was day-dreaming about just a couple of weeks ago (there I further posit the possibility that one might hand off calculations that require map data to a separate instance of the dedicated server running a partner extension).

 

Look me up on the Arma Discord if you decide to proceed and want some direction on Arma's ways - lots of super helpful experts there; https://discord.gg/9KEgz3

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

×