Home   Help Search Login Register  

Author Topic: AI cover & trench warfare--here ya go  (Read 3213 times)

0 Members and 1 Guest are viewing this topic.

Offline Zayfod

  • ECP Team
  • *
  • Llama, softest natural fibre in the world.
AI cover & trench warfare--here ya go
« on: 03 Feb 2003, 05:11:01 »
--------------------------------------------------------------------------------
Hi all ;)

I reckon if we can solve this one we will have sum kick butt good AI to deal with. But so far this issue is driving me nuts! :joystick:

OK I made a wee script (two actually one calls the other) that has one group form a line behind a sealed off area of sandbags--in the editor they are called "wood fence".

Once the line is formed they go prone behind the sandbags and pop up randomly , have a quick peek ( crouch to combat) to see if there are any baddies then pop back down again. Each unit in the group does this independantly.

Anyways the script works perfectly and,unless asked to, I wont bore u with it cause the script aint the issue here. Actually it works soooo well that it may as well be a scene outta "SAving Pvt Ryan"--u know when the Germans pop up outta the trenches take a shot then pop down again?

So heres the rub.

It would appear OFP AI recognise the "wood fence" or sandbags as some kinda barrier that dis-allows them to shoot over. They seem to think its IN THE WAY when in actual fact there is plenty of view above it to shoot the enemy.

I have tryed this with and without the use of the script.

I have lowered the sandbags into the ground untill they are almost not there so they  are only like one foot high and still the ai seems to think they need to get to the side or infront of the barrier before they can shoot.

How do I know that this issue is not due to the script I wrote?

Because when I simply remove the barrier they happily fire away at the enemy from a great distance and waste them very quickly.

How do I know that the AI can actually see the enemy with the sandbags there?

Because I played a prvt in the group and the officer indentified the enemy and told us all to engage but all the AI in the group said "negative" even tho there was a clear view to the enemy over the sandbags --even in crouched position.

Finally--they will only engage the enemy with grenades at close range because the seem to think they need to lob over an osticle --that being the sandbags.  :-X :thumbsup: PHEW.

Try it. Place an AI group in a sealed off sandbag enclosure( so they cant get out make them crouch or stand up, so they can see the coming enemy) youll have to order them or theyll go prone and they wont see squat. Youll be lucky if a few shots are fired at all then remove the sandbags from one side and theyll prob take out the enemy real quick.

So HELP :help:

I sadly think this is a hardcoding issue that may not be able to be resolved. If anyone can solve this then i will happily eat my words (eagerly) and we will then have some REAL smart and wily AI to deal with that'll better the gameplay immensely.

PS if u want that script just PM me and Ill send it ya-- but not much good unless we can get the AI to fire over sandbags.  

Zay  :hmm:
« Last Edit: 03 Feb 2003, 05:17:27 by Zayfod »
"I have come here to kick ass and chew bubble gum......an I'm all outta bubble gum!"

Ace

  • Guest
Re:AI cover & trench warfare--here ya go
« Reply #1 on: 03 Feb 2003, 10:29:08 »
sounds like a great script.

But maybe you shouldn't use the woodfence as the cover.

Offline Zayfod

  • ECP Team
  • *
  • Llama, softest natural fibre in the world.
Re:AI cover & trench warfare--here ya go
« Reply #2 on: 03 Feb 2003, 10:41:52 »
Yer Ive tried concrete blocks too and same result regardless of whether i lower 'em into the ground also.

Anyways concrete blocks crumble under fire so not much good as cover.
sigh :-\

Cheers fer the input tho.

Anyone else? Another guy at   www.flashpoint1985.com

has same problem. :gunman:
« Last Edit: 03 Feb 2003, 10:44:22 by Zayfod »
"I have come here to kick ass and chew bubble gum......an I'm all outta bubble gum!"

GeneralCoder

  • Guest
Re:AI cover & trench warfare--here ya go
« Reply #3 on: 03 Feb 2003, 11:04:56 »
Yer Ive tried concrete blocks too and same result regardless of whether i lower 'em into the ground also.

Anyways concrete blocks crumble under fire so not much good as cover.
sigh :-\

Cheers fer the input tho.

Anyone else? Another guy at   www.flashpoint1985.com

has same problem. :gunman:

Only thing I can say is that its not ur scripts fault, I belive its bug in resistance. And if I remember right they used to shoot over the trecnhes in earlier OFP's. Many buildings have this bug, that AI cant 'see' inside them :(
Well minor solution is to move the soldiers back from the trecnhes then they can shoot over.

Offline Zayfod

  • ECP Team
  • *
  • Llama, softest natural fibre in the world.
Re:AI cover & trench warfare--here ya go
« Reply #4 on: 03 Feb 2003, 11:27:16 »
Thanks fer the input. I am sure its a bug as u say

Quote
Many buildings have this bug, that AI cant 'see' inside them

However, the officer COULD see the enemy over the sandbags and even tell the group to engage. Its just that the AI all said "negative" :o

Its weird aint it. Hell Ive even tried disableai "autotarget" dotarget and dofire blah blah blah still no luck.

Someone else musta encountered this issue, cause its no small issue.
"I have come here to kick ass and chew bubble gum......an I'm all outta bubble gum!"

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:AI cover & trench warfare--here ya go
« Reply #5 on: 03 Feb 2003, 11:48:20 »
I had a similar problem, though I didn't go into it in much detail.    I had dudes behind a sandbag wall (not an enclosure) with the vain and optimistic hope they would use it for cover.     They just came in front of it, unless I put them so far back the sandbags were pointless.   It wasn't a big deal in that mission so I just rearranged the sandbags just so they looked good, added a couple more morons to the defending group and left it at that.

In another misson I arranged two sandbags in a V shape with a gap at the apex.   Put a dude prone looking through the gap.  which made him quite hard to shoot though he could fire out ok.   Bit like battlements, but on the ground.     Some kind of jagged W arrangement might help with your problem.  

The whole thing is a little odd since the AI can deal with windows in buildings ok.    I say that with some bitterness as being shot through a window while inside a building is annoyingly common for me.  I think we may just have to accept that they can't shoot over sandbags.   Does the same thing happen with other fence types?
Plenty of reviewed ArmA missions for you to play

GeneralCoder

  • Guest
Re:AI cover & trench warfare--here ya go
« Reply #6 on: 03 Feb 2003, 21:01:29 »
Do u remember the city where was the office in campaings wery first missions when the soviets invaded? The building where was the office (about 4floors and clock front of it) is such a bug!
I made i mission where there was soldiers looking outside the windows but only few managed to shoot out and no one of the AI soldiers could shoot inside the building.
I mean i just walked the stairs up and shooted everybody and they just stand there.  :-\  
And my friend sayd that the factory buildings have the same problem.

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:AI cover & trench warfare--here ya go
« Reply #7 on: 03 Feb 2003, 22:21:19 »
i think it goes like dat ;D

da prob is from 2 parts 2 of em based on OFP AI  :-\

1) Da AI have 2 aim b4 shotin - so u have 2 give em enough time 2 aim b4 u let em drop again

2) da sandbag model is buged (in OFP:R and in OFP:CWC) and da AI thinks dat its higher dan it is. but if dey r entirly standing up dey should shot 1ce in som mins  :-\

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline Zayfod

  • ECP Team
  • *
  • Llama, softest natural fibre in the world.
Re:AI cover & trench warfare--here ya go
« Reply #8 on: 04 Feb 2003, 02:23:36 »
Thanks fer the input guys.However I aint giving up yet.

LCD I already tried making it so that the guys stay permanently in crouched position and then i did it again with them permanently standing, so they all had plenty of time to aim, lol i think only one shot was fired and that only happened after the enemy was right on top of them.

However, like I said I havent given up yet.  :P

I have reworked the "taking cover script" and now I made it so they do fire as soon as they pop up but its using the:

unitname fire "M16" command.

At this stage this is the only command Ive found that can force them to fire over the sandbags, and as they already are  targeting the enemy it should  work perfectly BUT they fire into the AIR!! >:(


So I need to know if there is any way I can freeze the AI and stop them from firing up into the air. Why does the

unitname fire "M16" command make them fire into the air?

Any thoughts?

 :-\
 
"I have come here to kick ass and chew bubble gum......an I'm all outta bubble gum!"

GeneralCoder

  • Guest
Re:AI cover & trench warfare--here ya go
« Reply #9 on: 04 Feb 2003, 13:00:00 »
Thanks fer the input guys.However I aint giving up yet.

LCD I already tried making it so that the guys stay permanently in crouched position and then i did it again with them permanently standing, so they all had plenty of time to aim, lol i think only one shot was fired and that only happened after the enemy was right on top of them.

However, like I said I havent given up yet.  :P

I have reworked the "taking cover script" and now I made it so they do fire as soon as they pop up but its using the:

unitname fire "M16" command.

At this stage this is the only command Ive found that can force them to fire over the sandbags, and as they already are  targeting the enemy it should  work perfectly BUT they fire into the AIR!! >:(


So I need to know if there is any way I can freeze the AI and stop them from firing up into the air. Why does the

unitname fire "M16" command make them fire into the air?

Any thoughts?

 :-\
 

Becose u havent give them target? u can do it like this:
UnitName DoTarget TargetName

Offline Zayfod

  • ECP Team
  • *
  • Llama, softest natural fibre in the world.
Re:AI cover & trench warfare--here ya go
« Reply #10 on: 04 Feb 2003, 14:07:28 »
Thanks Im aware of that. ::)

But under the described circumstances (poping up from cover and firing from a sandbag enclosure) the suggestion  of "UnitName DoTarget TargetName"
does not work.

As mentioned b4 I had already tried this. That is why I resorted to the unitname fire "m16" command.

Looks like its a no go at any rate. :-\
Well I tried

Ill let u guys know of any developments
 :noo:
"I have come here to kick ass and chew bubble gum......an I'm all outta bubble gum!"

Rubble_Maker

  • Guest
Re:AI cover & trench warfare--here ya go
« Reply #11 on: 05 Feb 2003, 12:36:55 »
Well not sure but I think its really the model that is flawed, not your scripts. Maybe there's some special LOD OFP uses to resolve visibility? Because often when I'm behind something like a tank or a car, I realize the engine clips plenty of the area behind it though it should be visible. This makes me think there's some sorta simplified geometry within the model, that is used to clip against, maybe its even the same LOD that is used for firing geometry. You should ask one of the modeling guys, they must know it. AI can shoot perfectly over other obstacles, and with bushes it doesn't even care about not having direct line of sight, so it MUST be the model. Once you know whats wrong you could fire up Oxygene and change that model file; I'm sure it'll work fine then.

Hope that helps

Offline Zayfod

  • ECP Team
  • *
  • Llama, softest natural fibre in the world.
Re:AI cover & trench warfare--here ya go
« Reply #12 on: 06 Feb 2003, 01:41:14 »
Hey thanks your commments and insight Rubble_maker. :)
Very good points about the model detail

However, we all know that we can see over the sandbags right? ok.

And, as mentioned b4 the leader of the group also could see over the sandbags while crouched because he told us all to engage the enemy--but 90% of the AI troops said "bugger off" ," cant do it"," negative".

So my hunch is that:
1: AI CAN see over these types of ostacles but perhaps their view is more limited than it would be in the open.

2: Although they CAN see over the sandbags their ability to fire over them is severly hindered. Maybe they think to themselves "I wanna hit HIT THE DIRT and take my shot prone but I cant so Ill hold fire" or " I wanna move forward and 5 feet to my right b4 I take the shot but I cant so Ill hold fire".

3:Or maybe when they look through their gunsight they follow a search pattern very slowly (ever notice that when they are looking for you?) and maybe part of that search pattern gets interupted when there eye meets the sandbags so they start the search pattern again and never actually acquire the designated target.

My bet is that its 3. ::)
Although, if you read up, I did at one stage LOWER the sandbags into the ground HEAPS. HMMM  so their search pattern shouldnt be interupted then should it? Maybe, unlike us, the AI still see the sandbags at normal height. Not sure. Its something Bis need to address in the next update. All they need to do is have a different pattern of AI responses when they are within a certain proximity to such objects. Shouldnt be that hard. :o

BUT dont despair!!!!!   :cheers:

 ;D I now have a working solution which I will post with example map today.
 
WE HAVE TRENCH WARFARE NOW!!

Then Ill ask all u map gurus out there to help me iron out the crinkles with the scripts.

Zay out


« Last Edit: 06 Feb 2003, 02:00:39 by Zayfod »
"I have come here to kick ass and chew bubble gum......an I'm all outta bubble gum!"

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:AI cover & trench warfare--here ya go
« Reply #13 on: 06 Feb 2003, 02:03:20 »
its kool u found a waqy 2 solve it ;D

and i can help u ironing watever u want ;)

:cheers:

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Fox2

  • Guest
Re:AI cover & trench warfare--here ya go
« Reply #14 on: 06 Feb 2003, 03:18:51 »
Quick question out of curiousity.

How are you making them crouch?

If you use switchmove "crouch", they can't move out of that position (turn, look, shoot, etc.) They can only shoot straight ahead and at the angle they start the animation at.

Try using switchmove on yourself (player unit) and you'll see what I mean.

Also, try destroying the sandbags. You know how people can walk through the sandbag? When it's destroyed, they can't. Try it. It doesn't deform all that much, and it also lowers the height of the sandbag. Perhaps that's just the thing to get these bastards to fire. :D