Roll on next weekend when I should have some time to start playing again
Roll on next weekend when I should have some time to start playing again
Great job tpw. I just tried some fighting in shapur and the ai is much improved. No more do they run by you when you are clearly in their sight. A few observations/suggestions
The ai is very bad at looking around them and being aware of their surroundings. Your script works great, but if the ai doesn 't see you they will still run right by you. this is good but the problem is the ai is bad at checking there surroundings, so sometimes they would see you if they had human intellegence but don't. It happens less often but a couple times the ai continued right passed me because I was facing them from the side.
Basically I think either the ai looking behaviour must be improved, which probably isn't worth/ is to complex too be tinkering with... or their field of view could simply be increased to compensate for the fact thaye don't know how to scan areas of possible danger nearly as well as a human. I don't know if this is possible but its just my observation.
The other problem with the ai, as mentioned by many others, is that they are glacially slow to get on target at times. I have actually found that they can turn fast, but for some reason tehy don't always do it . I would say that its basically a fifty-fifty chance that they will turn quick and not slow. Anyways, I think this is a problem deep down in the ai code so there probably isn't a easy fix, but I did find this command...
And it instantly rotates a unit, so there is no slow turning. Maybe it could be used to set the direction of a unit towards the enemy as soon as that enemy comes into sight? This would make it so the unit instantly turns (I know not exactly realistic) to face the threat, meaning that all he really has to do is raise his weapon and fire. This is a quick test I did...object setDir heading
The problem is you can't set the direction towards another object but rather a direction on the map (0-360). So if it is even possible to setdir towards a unit it would require a fair bit of math...
I don't know if any of that is possible or reasonable, I'm just spitting out ideas as thy come. This is definitley an improvement over the vanilla ai though. Great work!
Last edited by -Coulum-; Jun 16 2012 at 16:46.
So the addon version works for EVERY unit or is it only onto group leaders ?
Yes I know what you mean, they shouldn't have super vision. But as a human player, you are constantly scanning around to check for enemies. The ai doesn't do that. In the example I showed, A human player would have quickly checked the corner of the compound I was hiding in, seen me and turned to engage me. The ai however was not scanning like a human however so they didn't do this. This is in my opinion one of the biggest problems that allow a player to just sit in a house or compound and watch the pile of dead ai at the door way pile up. But I do understand what you mean. The ai shouldn't be able to magically have eyes in the back of their head. But every-once and a while they should quickly glance behind themselves. or something like that.Originally Posted by Kremator
Ha! yeah I figured as much. Keep in mind that it wouldn't look quite so unnatural if the ai was already somewhat facing the player and only had to turn a small amount. But I can't imagine a lot of people would be open to it, although the slow aiming we have currently IMO is even more unnatural... But I am just kicking around ideas if you know what I mean.Originally Posted by Kremator
Last edited by -Coulum-; Jun 16 2012 at 17:54.
That top video in which you await in ambush - the AI didn't seem like he was in Combat mode - did he have any Knowsabout value on you? If not, I've played PvP where humans were equally oblivious if I got into their compound (behind their front). If he did have an awareness that an enemy was nearby - would be great if AI could 'detect' that they were passing thru a doorway/entryway and automatically do a quick scan if they have suspicion (Knowsabout) that enemy is nearby. At least for Arma 3 I hope
~The bearly literate pugilist~
Stop discrimination! Fight for bot rights for them to thrive indoors! http://feedback.arma3.com/view.php?id=8671 -Please revote this! Previous one was mistakenly directed to DevHeaven only!
Add Distance to Target/Gear Menus: http://feedback.arma3.com/view.php?id=8666
Personally, I'm not 100% convinced that setdir is the way to go. The idea of a script like this is to sharpen the AI a bit, not turn them into killbots. And because the script already forces the units to turn towards the spotted enemy (_unit lookat _near), the actual aiming seems to be reasonably quick the majority of the time. And with the script the average unit gets a bead on the enemy a damn site quicker than without.
Regarding unit awareness: the script at present gives the unit 120 degree field of view. Partly this is a limitation of the eyedirection / head model. And partly it's for realism. If you stick your arms straight out to the side at shoulder level and look dead ahead, you won't see your fingers wiggling. Neither should the AI. However you are right that their awareness is not the same as a human player, and I'm not sure how a script like this can compensate in a way that doesn't turn them into killbots again. A script that could force AI head movement would be nice for a start(don't know if it can be done though), because we could then script in things like rapid scanning, or force them to look at each buildingpos etc etc.
Anyway, the script is here to stimulate discussion and I'm very grateful for all your ideas even if I don't (or can't) implement them.
Kremator - the script and the addon both work for an OPFOR or BLUFOR on the map. I will shortly, thanks to Rydygier, make it work for independents too. I'll try forcing a unit with LOS to an enemy into combat mode too, to see if that sharpens up their aiming.
Yeah, I don't think setdir is the way to go. Anything that breaks native AI behaviour, or forces a player's units out of parameters that he or she has specified for them (i.e. stealth, stance, movement orders, etc) is a red flag in my book. Hence, I'm watching this thread carefully.Personally, I'm not 100% convinced that setdir is the way to go. The idea of a script like this is to sharpen the AI a bit, not turn them into killbots. And because the script already forces the units to turn towards the spotted enemy (_unit lookat _near), the actual aiming seems to be reasonably quick the majority of the time. And with the script the average unit gets a bead on the enemy a damn site quicker than without.
Everyone tempted to post another inane/useless/whogivesatoss topic in the A3 forum - here.
Fair enough. Can't really think of any other possible addition. Maybe making a slight delay for an ai to crouch and engage upon sight based on skill? Probably not that neceassary but I guess in SP it might be benificial so that your squad of special forces are able to easily eliminate insurgents in CQB... I don't know, just brainstorming...Originally Posted by CameronMcDonald
Is it possible to have a full script-only version that can be called from the init.sqf please? Addon is great but would love to be able to add it directly into my missions now that this has REALLY come on.
This would also make it 'tweakable' perhaps in an hpp or something in description.ext.
What we do need is a way to analyse just HOW CPU intensive this script is. Presently we just have hearsay and conjecture but no real evidence. Anyone got any ideas of how we would do that ?
Hi Kremator. I've been posting the code as well as the addon, so you can easily save the code into your mission directory as e.g lineofsight.sqf, tweak it, and then call it with nul =  execvm "lineofsight.sqf".
This page has some hints at the bottom regarding testing code speed: http://community.bistudio.com/wiki/C...on_yourself.3F. I've got a few ideas myself which I will test out too.
Latest addon: http://www.gamefront.com/files/21857852/TPW_LOS.zip
Latest script: Spoiler: