Jump to content
Sign in to follow this  
Cathrynn

How complex is Arma 3's scripting language?

Recommended Posts

I'm really enjoying Arma 3, so much so that I'd maybe like to start scripting at some point in the not so distant future.

But before I get started down the mission scripting road, if I get started down that road, I was wondering just how complex the language is? Not because I think the language would be to complex for a grunt like me but because I don't want to get so far down the rabbit hole only to find out the language is limited in acheiving, what I would consider, advanced AI thinking if you will.

For example with the right sort of knowledge and time would I be able to program the AI's behaviour so that, say, a group of four AI enemy would inteligently use shoot and scoot tactic's to try and harass a much larger group of humans? And by shoot and scoot I mean the AI would have spotted their human targets first before engaging them for only a very short period of time, disengaging and breaking contact to a safe location so that the humans would be left without much of a clue as to what just hit them.

Share this post


Link to post
Share on other sites

Take a look at the ASR AI, Zeus AI and GroupLink style mods from ArmA2/3 to see the kinds of control you have over AI.

Share this post


Link to post
Share on other sites

There is little doubt that you could exert the kind of control that you are describing, but the issue is how far are you going to take that? If you micromanage the AI for specially scripted events, then the problem is much less complex. If you are talking about a dynamic mission, then there are so many variables to do what you are describing that you will be generating a lot of complex code to handle all of the possible scenarios.

Share this post


Link to post
Share on other sites

Maybe you should just start by doing little things first and don't get to AI-manipulating right away. (The AI in Arma can be a pain in the ass, especially if you want them to do something very specific...)

Anyway, try to write or adapt simple scripts by yourself, like artillery support or unit spawning and see if it's fun for you.

Share this post


Link to post
Share on other sites

The AI are mainly driven by FSM's.

http://community.bistudio.com/wiki/FSM

I don't know how much experience you have with programming and AI, but the harassing behavior that you describe would not be simple to implement. As is stands, the AI sometimes struggle to take cover properly or apply any simple military tactic, and other times they can flank, take cover, and advance with suppressing fire very well. AI is one of the hardest parts of game development; making a computer imitate human behavior is extremely difficult. Why BIS has not borrowed some features from some of the good ArmA 2 AI mods is a mystery though. People who criticize the AI as stupid and helpless do not understand what an FSM is or why procedural AI is so difficult, nor do they see how much good AI code is already there.

As to sqf itself, it is dependent upon the command API offered by the engine. If a command does not exist, for example 'unitVest' (which needs to be added), then accessing a unit's vest (as a container, not the classname) directly is impossible. Luckily there are a lot of very useful commands, and what you can do often comes down to your logic in looking at data from the game world. It would definitely be possible to make a function that forced the AI to take cover behind rocks, but there are many factors that you must consider for it to look remotely realistic. As kylania said, the proof of what can be done is out there.

Scripts that control the AI are running parallel to AI FSM's, and often the AI will simply chose to obey the FSM over your script. Often a lot of time and effort is required to get the script working without issues and without 'fighting' the AI. The amount of micromanagement and level of awareness that you want also plays a large part. It is easy to order an AI group to flank, but harder to determine if and where they should throw a smoke grenade.

Share this post


Link to post
Share on other sites

Thankyou for all the constructive feedback guys, it's sincerely appreciated!

I'll definitely have a look at all the AI mods Kylania suggested although IndeedPete is right, it doesn't make much sense to be programming AI code right from the get go as I need to be much more comfortable with the language as a whole first. But I would, eventually, like to explore dynamic mission building as was alluded to by Jacmac. Zenophon, I've programmed AI code in the past using FSM's and I'm very encouraged by what you said. I do beleive this rabbit has lots of digging to do. Thanks again!

Share this post


Link to post
Share on other sites

The thought of rabbit named "Bear" digging holes under our feet somehow troubles me.

The AI is far from stupid, its just limited in certain situations and depending on the settings (and hardware).

Anyway, good luck with whatever you're trying to achieve there. :cool:

Share this post


Link to post
Share on other sites

As said it really depends how much you want to micromanage the AI. The more freedom you give to the AI, the easier it will be to make it work. And of course, some things you simply won't be able to change as far as I'm aware. For me, I just use UPSMON if I want AI, so that's another thing you should be looking at if AI control is what you're interested in, but again you'll have to be quite knowledgeable about ArmA scripting before you can understand anything done there.

Share this post


Link to post
Share on other sites

Come to think of it the very first FSM I ever wrote was part of a Pong clone, now that takes me back, I'd just read the most excellent 'Tricks of the Windows Game Programming Gurus' by Andre LaMothe. I must've read that book more times than I'd care to mention too, lol.

Tajin, just the ramblings of a rabid bear. ;)

Galzohar, thanks for the advice, I've marked UPSMON down in my notebook along side the other mods mentioned.

I'll probably start my journey by reading the community wiki pages about Armas scripting language and see where that leads.

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  

×