Jump to content
Sign in to follow this  
almanzo

AI and forests, a couple of suggestions

Recommended Posts

If there is one thing my community has experienced, it's that the AI is way too good in forested areas. We spend a lot of time tweaking our AI to find the sweet spot between them being too good and too terrible, and I am pretty satisfied in how we have achieved this. However, all of our tweaking goes out the window once we take contact in heavily forested areas. Therefore, I have given some thought into how to solve this relatively easy.
 

I can't seem to find it now, but I did find references to "forest" in the wiki, and if you look at the map there are defined areas where there are forests and where there are not. In addition, there is also own areas of towns and so on. I don't know if this is a feature of the engine itself, but one example would be ALIVE, that in some way defines areas as different things in order to make objectives for both AI and players.
 

So, my suggestion is simply that you have an engineside check that checks if the AI (or the target of the AI, I don't know wich method works the best) is within a forest, and if it is, the spotting and aiming skill values are lowered as long as the requirements is present. This would make the AI way more fun than they currently are in forests. And yes, I am aware that the AI can't see through trees, however, they see perfectly between trees, while players do not. Camoflauge has an impact on us, but not so much on the AI. They will see us if we are between trees while we might not.

I think this is quite high priority, especially given the setting for Tanoa. Fighting the current AI in a jungle scenario sounds like a nightmare.


 

Share this post


Link to post
Share on other sites

I think it would be good if your "spottability" is decreased while you're in a forest. I'm not entirely sure, but I think it's the spotter that can be adjusted only (the AI seeing) and not the spotee (AI/player visibility). I think I looked into it a long time ago, because I think the same thing. I wanted to be less visible the closer to a tree (or collection of trees) I was, but didn't find anything useful.

Share this post


Link to post
Share on other sites

 I use the new setUnitAbility Camoflage to adjust player visability when his gun is down or undrawn and enemies walk right pass him. As soon as he raises weapon, I have the value jump and they draw on him immediately. Im sure this could be used for map areas as well.

Share this post


Link to post
Share on other sites

new setUnitAbility Camoflage

Can you tell me more about this? setUnitAbility wiki doesn't have any info about this.

Share this post


Link to post
Share on other sites

Sorry they changed it to setUnitTrait.

 

 I use:PLAYER setUnitTrait ["camouflageCoef",0.00010]; as weapon is lowered

 

 and then :PLAYER setUnitTrait["camouflageCoef",0.0835]; upon raising weapon

 

 these values have been a pretty good sweet spot for not being totally blind to enemy tho that is not always the case. If the hidden unit opens up the enemies do return fire nicely.

Share this post


Link to post
Share on other sites

OK thanks that sounds pretty interesting. Anyone remember my old Hide addon? It basically spawned a doughnut-shaped viewblock item (invisible to players) around the prone player that rose up over time & fell as shots were fired, (Doughnut-shaped so AI could see down into it when they got close.) This new command will make it better :)

 

And, more interestingly, the possibility exists to become harder to spot when in forests etc. Type of nearby objects, stance, and movement speed can all factor in.

Share this post


Link to post
Share on other sites

 Sure I remember Hide, cool concept and hope to see it updated for Arma3. Welcome back btw :)

 

 As to original post, yep agree wholeheartedly that aimingAccuracy should be adjusted as per area ie Woodland, Open Plains, Jungle,City etc.. as it does have a drastic impact of enjoyability infirefights. Ive done this somewhat just via Triggers in proximity to those mentioned and it does play out better. Lowered aimingAccuracy in CQB Urban leads to  longer, more destructive firefights wile reUpping it in Open Plains brings back the believability that 'these guys can shoot'.

 

Alive does have this indexing but we'd either have to piggyback ride their code (which i dont think they'd appreciate) or have BI give it to us engine-wise.

Share this post


Link to post
Share on other sites

^ yup used to use it with DAC as the AI tended to hunt you down far too efficiently lol... curious to see what you come up with

Share this post


Link to post
Share on other sites

This is a great great thread.

Making an ALiVE mission on N'Ziwasogo right now (African map. Super thick dense jungle) and it's borderline not too playable in those areas. I'm just absolute dead meat. I can't see crap and just get slaughtered. I actually wasn't aware they couldn't see through trees. They must be 20/20 in the spaces in between them then. This should definitely be looked at, especially with Tanoa on the horizon.

Share this post


Link to post
Share on other sites

 Anyone remember my old Hide addon? It basically spawned a doughnut-shaped viewblock item (invisible to players) around the prone player that rose up over time & fell as shots were fired, (Doughnut-shaped so AI could see down into it when they got close.)

 

Sure do :)

 

I have played around with the new setUnitTrait and it's great! Now we can change the visibility among other things dynamicly which open up lots of new possibilities, ex effective ghillies when prone and still, effective sniper nests/camo nets, sneaky spec op's missions where low, slow and time of day makes a real difference etc...

 

Decreasing visibility in tall grass/forests/in bushes is easier than ever, also see the SurfaceType command.

 

/KC

Share this post


Link to post
Share on other sites

OK well I had some good results last night, I had a script that would monitor the player and look for tree density and bush density around the unit, look at his stance and his speed, and make some coefficient to apply to the camouflage setting. It seemed to work pretty well.

 

I chose a tree density of 10 trees within 20 meters of the unit as a minimum trigger level, from there the camo setting is altered. I chose that number because it seemed to be reasonably catch-all, edge of forests will not trigger it (mostly) but a small way in will. It does mean that you can stand on the north edge of a forest and not be camouflaged from beyond the south edge, but the likelihood of this being a problem is small I'd say, your normal camo should work plus distance & trees.. I don't want to have more searches per second than I need to for "edge" situations (haha).

 

After the tree limit is triggered, a second search per cycle looks for bushes within 5m and applies bonus coefficient for that. Speed is monitored with running effectively jumping your coefficient to useless (I think this is reasonable) and slow movements improving it drastically. And stance is added to this also, so prone is very high in value, and standing the least high in value.

 

So the highest value coefficient you can achieve is, as you would expect, lying still and prone among bushes in a dense forest :) A reasonable coefficient can be achieved crouched, walking from bush to bush in a forest, away from the edge. Higher stance, speed and lower distance to edge will all decrease your coefficient value.

 

Even in the middle of a dense forest there are sudden low densities of trees per meter I found, and so when the tree density trigger limit is suddenly lost, the camo does NOT immediately jump back up to normal, there is a timed increase back to normal. So you can have 2 or 3 seconds' grace before starting to get worried :)

 

Now, the numbers and relationships will need tweaking, and I tested my script within a modded environment, which almost certainly includes AI setting adjustment, so I'm a long way from releasing anything yet, but the idea definitely works.

 

*edit*

Oh, and one quite-serious limitiation - when I tried it on Chernarus (probably the map this will be most useful & welcomed in) the nearestTerrainObjects command didn't return all trees. In fact I think a lot (most) tree types are not even regarded as trees by this command. I have to assume there's some list somewhere (perhaps in some config) of objects that constitute trees (and bushes, buildings etc) but I don't know where that is. Any info here would be welcome, I can add in tree model names to catch all these.

  • Like 2

Share this post


Link to post
Share on other sites

OMG :D

https://community.bistudio.com/wiki/nearestTerrainObjects

I wish I had this way back when. :D

 

I was sure there was a way to return the terrain type.... maybe I'm thinking of something else.

 

Some of these are really interesting though, such as "FOREST BORDER", "FOREST TRIANGLE" and "FOREST SQUARE". But I'm not sure how they are defined.

 

 
Still, I am sure this can be modded with rather good results, but being such a crucial part of gameplay, this is one simple feature that should be in the base game. This impacts EVERYONE who plays against AI, including official content.
 
I actually wasn't aware they couldn't see through trees. They must be 20/20 in the spaces in between them then. This should definitely be looked at, especially with Tanoa on the horizon.

They can't, but they are not effected in the same way as us humans are. There has been a debate about wether or not the AI can see through objects a long time, but they can't. But they are pretty effective at anticipating where you might be based on direction of travel and speed of travel the last time they saw you. I good indication of how this works can be had if you play any single player mission against infantry in towns or where ever as a subordinate in a squad with an AI squad lead, with difficulty set to easy. You will then get targets with a red square around them, and this square moves relating to the prediction method the AI uses to predict your movements. So if you ever have been assigned a target, seeing a target marker but no actual target, you have been seing the prediction system in action without realizing it :P

The problem with forests is that the AI sees perfectly between trees, and as long as they have a direct line of sight it doesn't really matter how much concealment there is around you. They can just as easily see you between trees in a forest (as long as they have a direct line of sight to you) as they can see you standing in the middle of an open field. As long as you are not behind something, they see you just fine.

Share this post


Link to post
Share on other sites

OK well I had some good results last night, I had a script that would monitor the player and look for tree density and bush density around the unit, look at his stance and his speed, and make some coefficient to apply to the camouflage setting. It seemed to work pretty well.

 

Sounds great!  Maybe also give some penalty when firing your weapon without silencer.

 

When playing around with setUnitTrait I got the feeling that the scale wasn't really linear but I have not spend time enough to conclude. As you say it will require some tweaking to find the sweet spot.

 

BTW: Truly misses your fire/smoke addon you made for A2 ;)

 

/KC

Share this post


Link to post
Share on other sites

Sounds great!  Maybe also give some penalty when firing your weapon without silencer.

 

When playing around with setUnitTrait I got the feeling that the scale wasn't really linear but I have not spend time enough to conclude. As you say it will require some tweaking to find the sweet spot.

 

BTW: Truly misses your fire/smoke addon you made for A2 ;)

 

/KC

I found that once I fired, the enemy found me easily in any case. I think maybe camo helps most when no-one is looking for you :)

 

RE fire & smoke.... I got some low-key plans ;) if I ain't burning them down, I'm lurking in them :D

Share this post


Link to post
Share on other sites

Great thread. I feel that this mechanic is what ruins most stealth missions in the Arma.

Which is really frustrating because so many other mechanics are already present.

 

Here are set of basic rules that could create a credible, challenging and simple situations.

So basically the chance of an AI (mark) spotting another unit (hunter) should depend on a wide variety factors:

 

1. The mark's alertness (Ease < Aware < Combat < Stealth)

2. The mark's level of training (Civilian < Recruit < Soldier < Experienced < Veteran)

3. The mark's visual aids, e.g. scope < binoculars < NVGs (at night only)

4. The level of light (moonless night/underground < fog, sandstorm < nighttime, heavy rain < twilight, dawn, dusk, light rain < daytime)

5. The distance between the mark and the hunter (the greater the distance between the mark and the sneak, the less chance), this may even be exponential

6. The hunter's appearance (dressed as a hostile < dressed in unknown clothes < dressed as a civilian < dressed as an ally)

7. The hunter's visibility (in direct line of sight < behind partial cover < behind total cover)
8. The hunter's stance (lying down, kneeling, standing)

9. The hunter's noise (silence < very quiet (whispering, slow crawl) < quiet (reloading, priming a bomb, opening a door, crawling quickly) < average (talking, walking) < loud (shouting, running) < very loud (suppressed weapons) < deafening (un-suppressed weapons, explosives)

10. The hunter's movement (still > slow > walk > jog > run > sprint)

11. The hunter's exposure (the longer he's exposed the greater the chance of being detected, so perhaps AI test to detect every 2 seconds?)

12. The hunter's training  (Civilian < Recruit < Soldier < Experienced < Veteran)

 

Also, Arma's immersiveness would be greatly increased if the mark had more than the 2 states they have today: idle and hunting, i.e. it would be amazing if AI actually had other states, e.g. wary (alerts his comrades by radio/shouting), curious (seeks confirmation so seeks the sneaker), scared (runs away or surrenders).

 

I hope that this helps somebody write a light (in terms of CPU cycles) and MP-compatible pbo that can be easily dropped into existing missions.

Better still, BI integrate these mechanics natively!

Share this post


Link to post
Share on other sites

There is a great way to solve this, lets grow the PVP community, really its astonishing to me why you guys still play against AI so much, sure it can be enjoyable for a couple of minutes, but nothing will ever beat the trill of shooting and getting shot at by human players, don't get me wrong here, not flaming whomever loves to play against bots, but I could never understand why the PVP community in arma is almost non existent(milsim Arma, not that life RPG or other mods that deviate from that concept).

 

Is it the lack of players?

is it how easy the game is to be hacked?

is it lack of balls by the milsim communities that just want to emulate being in a real army instead of the competitive aspect of a PVP fight?

 

Please don't take this post the wrong way, I just love Arma 3, but I find that we are wasting a game that has a lot of potential by not exploiting the PVP aspect enough, think of Project Reality like teamwork mixed with all the freedom we have in Arma 3, but against players and not dumb bots.

Share this post


Link to post
Share on other sites

There is a great way to solve this, lets grow the PVP community, really its astonishing to me why you guys still play against AI so much, sure it can be enjoyable for a couple of minutes, but nothing will ever beat the trill of shooting and getting shot at by human players, don't get me wrong here, not flaming whomever loves to play against bots, but I could never understand why the PVP community in arma is almost non existent(milsim Arma, not that life RPG or other mods that deviate from that concept).

 

Is it the lack of players?

is it how easy the game is to be hacked?

is it lack of balls by the milsim communities that just want to emulate being in a real army instead of the competitive aspect of a PVP fight?

 

Please don't take this post the wrong way, I just love Arma 3, but I find that we are wasting a game that has a lot of potential by not exploiting the PVP aspect enough, think of Project Reality like teamwork mixed with all the freedom we have in Arma 3, but against players and not dumb bots.

 

Just because you don't find battling against AI interesting other then first few minutes doesn't mean others do.

  • Like 1

Share this post


Link to post
Share on other sites
 Lack of PvP interest

 

 

 Personally it's just too vast out there with too many servers for me. I admit PvP can be awesome when it works and you have a full house but honestly havent had that experience since Arma 1 Beta -in which there was 1 or maybe 2 test servers. It was a basic CTF in Cayo, was full 24/7 and you saw and got to kill names you knew (and argued against) in here daily. Honestly it was a fuckin blast and had that 'hook' of "Cant wait to get off work and jump in a round". Havent experienced that feeling since -and I kinda hated Arma 1...

 

 Im sure the newer Launcher makes it 10x better but was also looking through this really dreary server list in which your inevitiably incongruent or locked out of 99% of the servers and the others were all Life/Zombies.

 

 Lastly SP has a feel you can never achieve with PvP -that of Thief or Swat 4 -catching the enemy off guard through righteous planning. Thats a gold standard feeling for tac minded gamers tho Im not saying the AI give a believably gold standard response...yet..

Share this post


Link to post
Share on other sites

There is a great way to solve this, lets grow the PVP community, really its astonishing to me why you guys still play against AI so much, sure it can be enjoyable for a couple of minutes, but nothing will ever beat the trill of shooting and getting shot at by human players, don't get me wrong here, not flaming whomever loves to play against bots, but I could never understand why the PVP community in arma is almost non existent(milsim Arma, not that life RPG or other mods that deviate from that concept).

 

Is it the lack of players?

is it how easy the game is to be hacked?

is it lack of balls by the milsim communities that just want to emulate being in a real army instead of the competitive aspect of a PVP fight?

 

Please don't take this post the wrong way, I just love Arma 3, but I find that we are wasting a game that has a lot of potential by not exploiting the PVP aspect enough, think of Project Reality like teamwork mixed with all the freedom we have in Arma 3, but against players and not dumb bots.

Since you approach this in such a civil manner, I would like to give you some insight into where I find coop to have it's strenghts over PvP.  As someone who has played Coop since basicly 2009 and who is at least somewhat regular as a Tactical Battlefield PvP player. This is how close you'll currently get to what you are requesting.

It is not due to the lack of players, or the ease of hacking. It's not due to any lack of "balls" either, I enjoy PvP for what it is, but it's far from the same as COOP for some obvious reasons. Most of the scenarios we play, involve attacking a town or a base where the attack comes as a surprise for the enemy. Doing guard duty in PvP doesn't really cut it, as you conciously know that someone is going to attack you and thus you would act differently than a unprepared soldier defending his base. Furthermore, doing guard duty is quite booring, especially if you are in the heart of the AO, having to wait for the opposition to clear out the surrounding area, do recon work and so forth. The main advantage of COOP is the ability to provide realistic and believable scenarios in a wide variety of ways where PvP simply can not compete.

Our sessions last from 30 minutes to around 2 hours and we play without respawn. To die doing a small patrol mission early on simply defending would not constitute fun gameplay, but it's quite essential for milsim to work. PvP is very, very different from coop. You can hardly compare them, as they fulfill different roles. As much as I really do enjoy Tactical Battlefield (by far the best FPS PvP I know of), I would never sacrifice coop over it. COOP allows simulation of a vast array of scenarios that PvP simlpy can not.

  • Like 2

Share this post


Link to post
Share on other sites

This debate seems rather sterile (rugby vs football?). PvP and Coop are 2 very different game modes. I think that everyone can agree that each offers different experiences, just as each requires different skills. Neither one is any better or worse than the other. This topic is about AI and therefore PvP by definition doesn't strike me as relevant here. So let's get back on topic and discuss AI spotting in forests...

Share this post


Link to post
Share on other sites

There is a great way to solve this, lets grow the PVP community, really its astonishing to me why you guys still play against AI so much, sure it can be enjoyable for a couple of minutes, but nothing will ever beat the trill of shooting and getting shot at by human players, don't get me wrong here, not flaming whomever loves to play against bots, but I could never understand why the PVP community in arma is almost non existent(milsim Arma, not that life RPG or other mods that deviate from that concept).

 

Is it the lack of players?

is it how easy the game is to be hacked?

is it lack of balls by the milsim communities that just want to emulate being in a real army instead of the competitive aspect of a PVP fight?

 

Please don't take this post the wrong way, I just love Arma 3, but I find that we are wasting a game that has a lot of potential by not exploiting the PVP aspect enough, think of Project Reality like teamwork mixed with all the freedom we have in Arma 3, but against players and not dumb bots.

 

Try getting into a mil-sim group. Many groups I know use their own ai mods. The ai there, are far from being dumb bots.

Plus @amanzo puts it correctly. Think to yourself, would you like to do the mundane, or any of the players you know... Not knowing if you'll even be needed.

 

Its a completely different game, when played within a good group.. or SP when played in an immersive way. Either of these ways are great, using a very good ai mod.

_

 

Regards the topic.. ai and trees. Just have them hug one, after that they'll be fine.

Vanilla ai could seem very tactical when there are lots of trees around. That's mainly because you can't see what they're upto.

  • Like 1

Share this post


Link to post
Share on other sites

Made some more improvements. Now the cycle looks for tree count and surface type, seeing as Chernarus doesn't return trees reliably, and Altis has some patchy surfaces in the middle of forests :) it's pretty decent at finding areas worth skulking in. Some tree lines will be unreliable, but that's reasonable I expect :)

 

I figure the unit speed is probably the most important element of camo, so running in deep forests will offer no camo boost at all (which I think is fair, I don't actually ever reduce the default camo) while very slow & still activities will offer a lot of boost, augmented heavily by what stance you're in. Firing at enemies seems to give them an immediate rough bearing on your position (with default normal AI) and will pepper your area with incoming fire but if you're patient and brave it can drop off as they realise they can't see anything. Sometimes they do see you though. I haven't quite figured out the pattern :)

I'd also like to monitor turn rate so keeping still is a viable tactic.

 

I've made no attempt to adjust for clothing, I rely on the default camo to be somewhat reasonable.

 

I might try to work in different surface types, but right now I just look for "forest" string in the surface name. But I do note that some forest type surfaces have lots of deep clutter while other have less so. So I rely somewhat on map makers to name their surfaces appropriately :) I'll try it tonight on some 3rd party maps like Podagorsk etc.

 

Note that it's only a camo boost, not a cloak of invisibility :) so it will improve your chances but not guarantee it.

  • Like 1

Share this post


Link to post
Share on other sites

This is great. I had something similar for my Scout/Sniper project. This scaling CamoflageCoef variable looks more promising. I saw this in the dev notes, but then forgot all about it. Looking forward to fixing and upgrading my mod. I'm also curious to see what you come up with.

Cheers.

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  

×