Home   Help Search Login Register  

Author Topic: AI cover and hold script  (Read 4653 times)

0 Members and 1 Guest are viewing this topic.

Offline Zayfod

  • ECP Team
  • *
  • Llama, softest natural fibre in the world.
AI cover and hold script
« on: 01 Aug 2003, 13:44:55 »



Previously known as smart AI trench cover completely redone.

Data about the evolution of this script can be obtained from here


http://www.ofpec.com/yabbse/index.php?board=8;action=display;threadid=5966

here

http://www.ofpec.com/yabbse/index.php?board=8;action=display;threadid=6944

and here

http://www.ofpec.com/yabbse/index.php?board=27;action=display;threadid=6123

Greets to General Barron for his input and code RE: the jiggle.sqs ;D

There are some VERY important notes about the types of cover you can use and how to prepare them included in the script so plz read.

So why did I make this script?


I wanted the AI to use cover more effectively as humans would. I wanted AI to be able to use sandbags, bunkers etc and not go prone as soon as an enemy was spotted, and not to leave their cover and move to the open in order to fire a shot.

I wanted AI to be more aware of their environment and look around, so they would be more prepared for attack from multiple angles. (Ever walk up to an enemy patrol and pull faces right behind their backs while they watch the sunset and never bother to look behind?--Many times methinks)

I wanted AI to assess what they can and cant kill and act accordingly. No point in the whole squad watching that tank unless they can do sumthing about it, so why not make the AI look for soldiers even if there was a tank prowling about.

I wanted AI to react to threats on an informed basis--no point in worrying about a tank if it CANT fire and you are in a bunker. It cant roll over you so stand up and fight.

I wanted AI to assess their squad. If over run by a tank that CAN fire --"Anyone with a LAW stand and fight all else -- HIT THE DIRT"

I wanted AI to act as perhaps humans would (if brave enuff) when they knew the game was up and there was no surrender, to hide from the tanks (if overrun by tanks) untill they were over run by soldiers that they could at least have a go at even if they had armour right on top of them. That way theyd at least take out one in their last fight to the death.


This script is 99% final.

MP testers welcome.

Greets to Bremmer for his inspiration from his mighty AI script.

ALL Improvements and bugs will be posted on this opening thread.

Current version 1.7--made on 04.08.03

Latest fixes:

1: AI scanning made to look much more natural, more pauses, more variance in looking left and right, sometimes they scan much slower, sometimes go prone during scan and sometimes dont go prone.



History

Version 1.6
fixes:
1: AI react better when overrun by soldiers

2: AI scan left and right when looking for tangos

3: Added--AA support

4: Added AA rearm and AT rearm ability at map makers choice

5: AI react better when overrun by armour

6: AI continue to look for infantry if they have no AT capability untill they consider themselves over run by armour

7: The script now can reckognise spawned units

8: complete recoding for efficiency

9: The script caters for all known orthordox AT and AA weapons

10: ALL 3 original scripts compiled to one for simple map maker integration

um I forget the rest   ;D   try the map.

Zay out
« Last Edit: 05 Aug 2003, 01:10:01 by Zayfod »
"I have come here to kick ass and chew bubble gum......an I'm all outta bubble gum!"

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:AI cover and hold script
« Reply #1 on: 01 Aug 2003, 17:41:10 »
Hey Zay,

will give it a try tonight when back home from work  :)

Have you thought about adding your "less hits more bullets"?

e.g: enemy tank is near, more dispersion etc.  ;)

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Gun_Nut

  • Guest
Re:AI cover and hold script
« Reply #2 on: 01 Aug 2003, 18:07:19 »
Hi Zay:

  Tried it, and it works perfect, the AI saved me, lol, it work just fine for me  ;)

                                                                                                                                                                                                                                    G8sniper

Offline Blanco

  • Former Staff
  • ****
Re:AI cover and hold script
« Reply #3 on: 03 Aug 2003, 23:43:29 »
Zayfod & General Baron , it's great, those guys are pure evil!

I tested it over 50 times now & no bugs found. Easy in use.

1 suggestion

When the units are scanning the area they are turning around like they'r sitting on a spinning wheel...
Can you make them watch random wind directions (counterclockwise & counterclockwise) and wait a short period like a real person should do?
The scanning is maybe less effective then, but more realistic imo...
I'm a scripting noob, so I dunno it's possible...


When I use the script in a bunker, I use the old version ,without the scanning, cos it a bit funny to see a unit scanning the walls of his bunker :)

anyways, GREAT WORK, MAN  :gunman:||

 






« Last Edit: 03 Aug 2003, 23:45:38 by Blanco »
Search or search or search before you ask.

Offline Zayfod

  • ECP Team
  • *
  • Llama, softest natural fibre in the world.
Re:AI cover and hold script
« Reply #4 on: 04 Aug 2003, 04:59:58 »
Cheers guys  :-*

Quote
When the units are scanning the area they are turning around like they'r sitting on a spinning wheel...
Can you make them watch random wind directions (counterclockwise & counterclockwise) and wait a short period like a real person should do?
The scanning is maybe less effective then, but more realistic imo...

U have a point Blanco and heres my angle on it  :)

(1) Ask your self this. If you were in a sandbag position in open country expecting multiple attacks from any and all angles--how often would you make yourself aware of your surrounding 360 degrees. Methinks perhaps your head would be spinning like the "Omens child" . The difference being that you (being human) would be able to do that without spinning your entire body. You would just use your eyes and head most of the time. AI have to be forced. So yes it looks a bit weird but this way they at least have a closer awareness of tangos around them similar to that of a real human expecting attack. Asthetics ARE important but even more so is the practical nature of the script.

(2) The AI do infact scan randomly clockwise and anticlockwise and they do break from the scan and go prone for a random period. So perhaps I will make this happen a bit more often.

(3) Due to the nature of the binocular playmove effect I cant make him scan any slower or he constantly puts the binoculars down and picks then up then puts them down again.  


(4)I have done many tests and discovered that the AIs ability to spot tangos decreases considerably when they scan at slower speeds so I will endeavour to make then scan look more natural by use of pauses and speed variance.

However--having said all that I still kinda agree with you Blanco  so I will look further into it and see what I can do to make it look better  ;)


Quote
When I use the script in a bunker, I use the old version ,without the scanning, cos it a bit funny to see a unit scanning the walls of his bunker


OK Blanco, Ill have to sort that out so map maker can tell the script if he wants the scanning or not. Ill do that asap coz the code in this new version is far superior to the old code. I recommend using this new code totally, Ill fix it so that it can be used by AI in enclosed "WALLED" bunkers also.




Chris Death --Gday mate  :)

Im gonna have a fresh new look at the bullet script and possibly redo it better. I think it may be better served remaining as a seperate script on its own and be implemented at map makers discretion. As it stands now the current spray.sqs  should work fine while running concurrently with this script.  ;D

Zay

« Last Edit: 04 Aug 2003, 05:03:53 by Zayfod »
"I have come here to kick ass and chew bubble gum......an I'm all outta bubble gum!"

Offline Zayfod

  • ECP Team
  • *
  • Llama, softest natural fibre in the world.
Re:AI cover and hold script
« Reply #5 on: 04 Aug 2003, 11:07:55 »
Quote
(3) Due to the nature of the binocular playmove effect I cant make him scan any slower or he constantly puts the binoculars down and picks then up then puts them down again.  


I tell a lie  ;D I could fix this.

Script has been updated to version 1.7--see 1st thread

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

Offline KeyCat

  • Members
  • *
Re:AI cover and hold script
« Reply #6 on: 04 Aug 2003, 15:15:32 »
Nice work Zayfod! Will try it in MP and let you know...

/Christer (a.k.a KeyCat)

- The journey is the reward!

Offline Zayfod

  • ECP Team
  • *
  • Llama, softest natural fibre in the world.
Re:AI cover and hold script
« Reply #7 on: 04 Aug 2003, 15:57:50 »
Will try it in MP and let you know...

/Christer (a.k.a KeyCat)



Yer that'd be great--havent been abe to do that yet  :-*

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

Offline Zayfod

  • ECP Team
  • *
  • Llama, softest natural fibre in the world.
Re:AI cover and hold script
« Reply #8 on: 19 Sep 2003, 03:28:17 »
Does anyone have any MP feedback?

KeyCat?

Im about to upgrade to version 1.8 which is designed to make AI fight better while within buildings (houses, high rises)--looks promising-- but need a MP bug report.

Cheers in advance.

Zay
« Last Edit: 19 Sep 2003, 03:37:49 by Zayfod »
"I have come here to kick ass and chew bubble gum......an I'm all outta bubble gum!"

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:AI cover and hold script
« Reply #9 on: 02 Oct 2003, 08:34:03 »
Wow, what can I say.... it works great! I haven't done very extensive testing on it yet, but I will try it in a mission of mine soon.

One suggestion I have is to also disableAI "target" on each of the soldiers. What this does is prevent the soldiers from running out and engaging the enemies, and thus leaving their cover, even though their "move" ai is disabled. I haven't noticed this happening in your demo mission, but I know I've had a problem with this in a mission I was making with your old version of this script. I think that because the men in the demo are so surrounded by objects, that they couldn't run even if they wanted to. But if you were to put them behind some sandbags, and have the enemies stay a ways back, I think you'd see what I'm talking about. Disabling "target" doesn't keep the AI from firing in any way; all it does is prevent them from running out to engage targets.

Another thing that would be nice is if there was a way to have the AI take cover when they are under fire, as opposed to just randomly taking cover, as in your script. I've been pondering ways to do this for some time, but as of yet, I still haven't come up with a good solution. One idea I was thinking about detecting enemy bullets using the "nearestobject" command (east bullets are different from west bullets); a simpler idea would be to have them take cover whenever they get hit. Problem with that idea is that they usually just die when they are hit.... I'll try to work something out and post it here.

Haven't tried this in MP yet, but I know nothing about MP editing, so that doesn't matter anyway.

Again, good script! I'm kinda tired as I write this, so sorry if its kinda scatter-brained.
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline Zayfod

  • ECP Team
  • *
  • Llama, softest natural fibre in the world.
Re:AI cover and hold script
« Reply #10 on: 02 Oct 2003, 11:11:27 »
Hi General Barron,

 ;D


Quote
I haven't noticed this happening in your demo mission, but I know I've had a problem with this in a mission I was making with your old version of this script. I think that because the men in the demo are so surrounded by objects, that they couldn't run even if they wanted to. But if you were to put them behind some sandbags, and have the enemies stay a ways back, I think you'd see what I'm talking about

Dont worry, they wont move mate. Once the script is executed they are nailed to the spot regardless of their surroundings--be it behind a single sandbag wall (remember guys a sandbag wall must be setdammage 1 for AI to fire over it--see script for details ) or what ever you place em behind.

Under normal circumstances the AI do easily escape from their enclosure so its the script holding them there. :)

Thanks for ya comments mate-- and I look forward too any MP feedback u have.

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

Manitou

  • Guest
Re:AI cover and hold script
« Reply #11 on: 22 Aug 2004, 17:50:13 »
Hello, Zayfod. I make missions for a co-op squad. Your script sounds very promising. I'm going to have a look at your Cover & Hold script and see if I can implement it into a couple of missions and see if it will increase the Ai's chances of survival. I'll post here and let you know how the scripts get on in MP. :)

Offline Zayfod

  • ECP Team
  • *
  • Llama, softest natural fibre in the world.
Re:AI cover and hold script
« Reply #12 on: 23 Aug 2004, 00:40:02 »
Hi Manitou,
just to let you know, this version has a couple of bugs. I have had a much improved version sitting on my hard drive for a while now (works much better) but I never got round to publishing it. :-\  I will post the new version soon and it will have been MP tested on my LAN.

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

Manitou

  • Guest
Re:AI cover and hold script
« Reply #13 on: 23 Aug 2004, 01:47:58 »
Had a look at the version 1.7 and I was realy impressed.  ;D I'll start putting a mission together with the version 1.7 as a teaser for the squad and add the updated version of your script as soon as you've finished it.

There are a fair few of us playing each night and we already beta test for a couple of Mod/addon teams, so if there are any bugs, we will root them out in no time and I'll report them back to you. :)