Jump to content
Sign in to follow this  
Törni

Tank behavior

Recommended Posts

Has anyone taken a good look at the game's AI behaviors?

Would it be possible to make tanks behave more like their real world counter parts and stop the stupid wheeling around in combat? It almost seems as if infantry and AFV's would be using the same kind of moves.

They should rotate the turret and try to keep front towards the threat and back up away fron the enemy in case of emergency.

Share this post


Link to post
Share on other sites

Hehe, well there might be some truth in your words. But that's not all.

I know one thing the AI does not do a good job with the tanks. I tried to place a BMP into a nice position, a bit hidden between a building and a tree. The idea was that enemy troops will not see the tank from the road coming to the building, and also that the tank would be covered from other direction by the tree. Well the result in the mission was that right after the waypoint triggered for the tank crew, they rammed the tank into the building, and the tank was stuck in their for quite a long time. After I tried this many times and seeing the tank crew do that almost everytime, I finally gave up and placed the tank in another position where there were more space to other objects. If only the tank crew would have driven forwards right from the start, they would have gotten out of their hiding place without hitting anything. But no, they instead decided to turn the tank right into the building, and got stuck there... it looks bad as the AI algorithm obviously lets the tank be stuck for some time before giving it an order to try another route. A tank shaking against a building doesn't look too good I think.

I have to say in infantry AI there are certainly improvements over Operation Flashpoint (more flanking, better use of cover, AI infantry can surprise me more in ArmA than in OFP with the default functionalities). About the vehicle AI I am not sure, I have to play more to make a judgement.

It's the problem of not having human brains, eyes and all else that you know, those that make you better than a machine. Rise of the Robots will in my opinion never happen as I think a machine will never be able to be as smart or smarter than its creator.

Share this post


Link to post
Share on other sites

You are right Törni, the Ai uses the same algo for infantry and tank.

I tried to have a look at the AI's FSM and must admit that it is very difficult to edit it. The main problem is that the driver, gunner and commander can turn independently and not act as a whole.

If you look at an AI squad, all men will from time to time check their flanks and rear, either by turning their head or their whole body. It's the same thing in a tank : all units inside will try to constantly check flanks and rear, independently. As the driver cannot turn his head (or peri/episcope), well, he turns the whole tank. Showing his soft rear armor to the enemy !

Maybe we can find a way to disable that behaviour. The main problem is the driver, as gunner and commander can turn freely in turrets. If the driver keeps looking at unknown objects, that may do the trick :

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">driver disableAI "AUTOTARGET"

I'll try...

EDIT : errr, well, no, it doesn't work. It was too easy a solution tounge2.gif

Malick

Share this post


Link to post
Share on other sites

One way to go with new modded vehicles would be perhaps to define a new view type for the driver and name it periscope view or something. I'll try if it will fix anything.

I started to suspect that infantry AI was used for the tanks too after I took a careful look how different AI units behave during the game.

With the new view the problem will be the BIS original tanks, which will not have this feature. And in the end it does not necessarily even cure the problem.

Share this post


Link to post
Share on other sites

I fear that adding episcope to tanks won't change anything. The problem lies in the animation of the driver unit (the animation for M1/T72 driver have a static head) and the AI hardcoded behaviour.

The only workaround I now see is FSM coding, prioritizing the "front to the enemy" as compared to "check flanks" and "keep formation". That wont be something easy to do confused_o.gif

Good night !

Malick

PS/ OT : how is your T55 going ? wink_o.gif With the newly released tools, it should be quite easier now. Anyway, looking forward to it !

Share this post


Link to post
Share on other sites

Not a correct thread for it. But working on them (T-55s) in the evenings when I have free time.

Share this post


Link to post
Share on other sites
Not a correct thread for it. But working on them (T-55s) in the evenings when I have free time.

Yep, I know that wink_o.gif

Regarding the turning tank driver issue, do you know if ArmA AI uses included FSM ? If so, where and what are they ?

I have found some FSM (formation.fsm, formationC.fsm etc..) in a pbo (was it character.pbo or Ca.pbo, I'm not on my computer right now...), but I can't tell if ArmA calls them at all.

With some coding and eventhandlers, this issue can be solved, in my opinion smile_o.gif

Malick

Share this post


Link to post
Share on other sites

Have not taken a look at AI stuff yet. But judging from what I have seen they all propably use the same file, which must be wherever the infantry AI stuff is located.

Share this post


Link to post
Share on other sites

any vehicle use its crew FSM file - try to man the tank with civils - they get ot in every encounter.

Anyway from my addon experience tank in arma behave much better the in ofp - i have never seen this annoying "wheeling around" from ofp in arma. Tanks move straight with quite minor turns.

Anyway there're things i want to edit for vehicle's ai (like firing from the stops for tanks), but at the moment i don't how to disable ingame ai completely and rewrite it with custon FSM

Share this post


Link to post
Share on other sites

There is wheeling and lots of it in urban areas and if there is cover which causes some blind spots. As the target disappears for a moment the tank starts spinning around. The next time enemy shows up a few seconds later the poor thing has it's side or back turned towards the threat.

Tanks seem to sometimes also get stuck and just keep pushing against the wall instead of simply backing up a bit and driving away.

Share this post


Link to post
Share on other sites
any vehicle use its crew FSM file

Do you know where is that crew FSM located ? Or when/how it is loaded by the engine ?

Malick

Share this post


Link to post
Share on other sites
Tanks seem to sometimes also get stuck and just keep pushing against the wall instead of simply backing up a bit and driving away.

That's what they do yes.

If you read about artificial intelligence, pathfinding and such subjects you'll notice it's a problem not only in ArmA, but in the algorithms used generally. The algorithm lets the AI unit "try" for some time, before deciding that a failier happened. Then a new course is set for the unit and a new "try" starts, hopefully with better results.

What could be done could be to reduce the time the algorithm lets the AI unit be stuck so the player has less chance of noticing it.

Or create a way to let the AI unit "see" better its surroundings (add CPU load and memory consumption).

Share this post


Link to post
Share on other sites

I'm not a master programmer, but what could be easily implemented is to give buildings an universal variable which could be used to determine if the vehicle should continue or not trying to move in the given direction. If the check would return a value that equals non-passable, the vehicle would almost immediately be able to try another route.

Share this post


Link to post
Share on other sites

A nice thing would be if the tanks retreated useing a reverse gear and not turning their backs on the enemy. The trouble is that AFAIK there's no scripting command allowing us to order AI driven tank to go reverse (I hoped that sendSimpleCommand could be usefull but it works only with vehicles crewed by a player)...

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  

×