Advertisement

Author Topic: Invading AI ("one" script to rule them all..)  (Read 2806 times)

0 Members and 1 Guest are viewing this topic.

Offline granQ

  • Contributing Member
  • **
    • Anrop.se
Invading AI ("one" script to rule them all..)
« on: 28 Jul 2009, 15:50:00 »
Warning long post

The idea is just as simple as it is complex, make an ai that invades the gameworld and then you have to kick its ass?

Ok, so it start something like this:

1) ai group paradrop and secure airport.
2) A "neverending loop" of c130 airplanes comes in with supplies.
3) supplies are flown from airport to forward operation bases (FOB)
4) from the airport and FOB's patrol start securing towns, keypoints
5) The player make contact with the ai, fires and kill some.
6) The ai respondes to the threat and send out units to kill the player.
7) Goes on until either side lost or timelimit reached.

Now this could be made with just throwing in a lot a lot of units in the editor, or it could be done in a silly way like evolution, or like in a stupid way of warfare.

BUT, I had a vision since KP CTI (for who ever heard about it) about the ai that respons to the player actions and that have limited resources without adding a Warfare/cti style to it.

Also I wanted different type of personalities, so you can tweak the mission to be an ai using mainly airborne units, mixed, a brutal that doesn't blink before sending a MRLS barrage towards a neutral city.

I am now looking for help by people.. with ideas and suggestions and code, it already does the job to kill the player very nicely and the newest version (leaving sqs for sqf) isn't uploaded.. so dont judge the code in this mission.

The great thing with this is that it for each task use its own script which makes it easy for people that feel they want to help out and design that part. Right now its me and Kungtotte mostly working on this while Ugga is working on not the AI itself but a mission that use our ai.

For more information:

http://wiki.anrop.se/index.php?title=MMAI:_Design
« Last Edit: 30 Jul 2009, 12:34:35 by Planck »
Cura Posterior

Offline Trexian

  • Members
  • *
Re: Invading AI ("one" script to rule them all..)
« Reply #1 on: 28 Jul 2009, 16:33:53 »
Sounds very exciting!

My skills at scripting are low, but I'm willing to help!
« Last Edit: 30 Jul 2009, 12:35:53 by Planck »
Sic semper tyrannosauro.

Offline Kremator

  • Members
  • *
Re: Invading AI ("one" script to rule them all..)
« Reply #2 on: 28 Jul 2009, 19:56:16 »
Liking the sound of this!  Good luck.

If you need a beta tester then ask me.
« Last Edit: 30 Jul 2009, 12:35:44 by Planck »

Offline CrashDome

  • Members
  • *
    • Sinews of War
Re: Invading AI ("one" script to rule them all..)
« Reply #3 on: 29 Jul 2009, 17:44:44 »
Reminds me of CoC's set of scripts for OFP that handled respawning of groups. I used that in conjunction with a transport manager script to do something very similar to this as a proof of concept mission.

It actually is fairly simple, but the code will be long to get it right.

I'm still brushing up on new commands so I can help with some suggestions only right now.

First, I want to say your CTI was reall fun to play for Arma!

Second, is it important the AI "capture" the airport in the beginning? From the sounds of it, you almost want the mission to start with it already captured. If it is critical the AI hold the airport to the rest of the mission why make it complex and prone to problems by having them take it by force.

For respawning, you can make it fairly simple. A loop with C-130s flying in is not hard. Every time they land, you can spawn a script for AI/Vehicles to depart and "report in" to some AI manager. You can make it fixed or random units.

For managing where to send AI units, I would suggest game logics or other denotations of "priority" targets. Run a script that repeatedly checks which areas would be best to cover or hold. Have the AI assign units to the area. With some of the new commands, you can assign a whole AI group to a target and have it check the # of remaining units in that group and if it is strong enough, create waypoints for them dynamically.
To make it REALLY dynamic, have the AI manager assess it's force size on a regular basis instead of just acquiring location by location. Maybe the AI falls back to reinforce an already captured location because it is spread out too thin? Also, instead of simply sending them to a location directly, have them sent to secondary game logics which surround a held area which are placed at key points (choke points, etc..).

I could really go on and on about how to improve the AI tactically with methods I have proven to work since OFP/Arma - including the use of FSMs as the "management" part, but the post would be 100+ pages long :D

I would also LOVE to help code something like this, but alas I am working my butt off just to keep a roof over my head right now.

In a missions with this many scripts going on, I will suggest that you break apart scripts. For example, it might be obvious that you only need to run an AI assessment every few mins. What is not obvious is that if you have it execute the whole assessment in one spurt you will get sudden drops in perf those every few mins. Instead, have it run the count of it's forces first... wait a bit... take those numbers and assess locations... wait a bit... have it assign groups and create waypoints. Rinse and repeat!
« Last Edit: 30 Jul 2009, 12:35:34 by Planck »
Sinews of War | JadeGear | My Site
Skype Name: CrashDome
Best method of contact: ICQ or MSN

Offline granQ

  • Contributing Member
  • **
    • Anrop.se
Re: Invading AI ("one" script to rule them all..)
« Reply #4 on: 29 Jul 2009, 20:52:38 »
thanks for your reply CrashDome, I hope you can pay for your roof and get some time over to help me out.

In order to keep it short I will reply with as few words as possible.

1) The paradrop (capture airport) is just eyecandy so far, no resistance and got no point.. just eyecandy. Probably will drop it later.

2) the c130 respawn loop and stuff is already working. Infact most of the offensive stuff is working, not tweaked correctly but so far it really kick the players ass :)

3) really liked your ideas about units falling back and stuff..

4) thanks for likning and trying the CTI..

unlike many others projects that posts requests for help, i do know I will and can do it myself.. it just that I know if I make some scripts for basic medevac, offensive operations and so on. Someone can just take it, add one more function to it (medevac performing some animation, offensive operation with more style).

So you are more then welcomed to help out a later stage. Can see this being work on until at least winter.

Right now it will spawn new stuff for each tasks, but the goal is to try reuse vehicles. Lets say the uh60 that transport supplies to a base is later used to attack an enemy stronghold. Using a "forcepool"... but that at a later stage. There is less fcuk ups with spawn stuff :)
« Last Edit: 30 Jul 2009, 12:35:20 by Planck »
Cura Posterior

Offline CrashDome

  • Members
  • *
    • Sinews of War
Re: Invading AI ("one" script to rule them all..)
« Reply #5 on: 30 Jul 2009, 04:21:38 »
Glad to here it's working out for you so far.

My old OFP transport scripts used to reuse vehicles based on a "state" they were in (i.e. waiting, assigned as pick-up vehicle, picking up, and finally drop-off units - then back to waiting) but they just stopped working about 30 mins into a mission in OFP. When Arma announced FSMs I was happy as it would cut code down tremendously, but then I was disappointed in their fragility.

Maybe now with the additional FSM commands, they will be more useful? more reliable?

I digress. Either way (FSM or Script) tracking a vehicle's state should be much easier now. Controlling via waypoint seems easier now (to me). For example, SAFE mode on a helo still allows the door gunner to fire at enemies during an extraction when in OFP you were lucky if they landed at all let alone fire back at enemies!  ::) lol
« Last Edit: 30 Jul 2009, 12:35:09 by Planck »
Sinews of War | JadeGear | My Site
Skype Name: CrashDome
Best method of contact: ICQ or MSN

Offline granQ

  • Contributing Member
  • **
    • Anrop.se
Re: Invading AI ("one" script to rule them all..)
« Reply #6 on: 03 Aug 2009, 20:59:37 »
oki, expect a release within 2-3 weeks. Rewritten the code (with help from killswitch, snakeman, ktotte), also added the CSAR function.

My hope is that after a lot of irl stuff take some time, kill all errors, warnings. Make a smaller release, then add some more cool functions and proper release it.

I still looking into functions, ideas of stuff to do.
Cura Posterior

Offline CaptainBravo

  • Members
  • *
Re: Invading AI ("one" script to rule them all..)
« Reply #7 on: 06 Aug 2009, 17:32:04 »
This sounds like an impressive project!

Is this stricly for MP? Or can SP take on enemy AI utilizing High Command Module?

Offline granQ

  • Contributing Member
  • **
    • Anrop.se
Re: Invading AI ("one" script to rule them all..)
« Reply #8 on: 07 Aug 2009, 10:11:34 »
it is made for multiplayer but I like your idea so i will make it possible, shouldn't be any problems at all. Except maybe for players that won't be able to respawn? How did you want to design the mission, I mean respawn and so?

Want to try the MMAI against "warfare" mission, "guerilla coop style" and the high command sounds nice.


EDIT. One of my friends asked me today when next version of MMAI will get released (1 week, 10 days probably btw) and said he been playing it a lot with high command module, apparently its working even if he said he gets his ass kicked all the time :)
« Last Edit: 07 Aug 2009, 12:28:25 by granQ »
Cura Posterior

Offline CaptainBravo

  • Members
  • *
Re: Invading AI ("one" script to rule them all..)
« Reply #9 on: 10 Aug 2009, 11:31:22 »
What High Command needs is a solid AI who control units on large scale (fight and take towns) and send supplied and reinforcments. This way you have a human vs AI commander fighting company size battles to control different sectors/towns.

It can be also be played as coop as other humans can take over some of the squads.

Respawn: I  personally like the group respawn (play MP as SP game to enable respawn)
I think allowing some flexibilty with AI commander might be good for mission design. Use points system to make AI more offensive or defensive. AI with high points will expand out more while one with low points will focus on defending areas it has and blocking roads to areas held.
Not sure how easy to implment though.

Edit: I just downloaded MMAI (MasterMind AI) example mission I have tested and certainly it looks impressive. However, I was  bit lost on what was going on in mission and what to do. Perhaps a read me note will help explain how it works and how to edit it (adding HC).

Looking forward to your next release.
« Last Edit: 12 Aug 2009, 10:29:21 by CaptainBravo »

Offline granQ

  • Contributing Member
  • **
    • Anrop.se
Re: Invading AI ("one" script to rule them all..)
« Reply #10 on: 12 Aug 2009, 22:00:17 »
yeah, 0.3 release was sorta "internal", 0.4 was ugga conversion of the core stuff, actually 0.3 for arma1 has breifing, objectives and shit going on.

0.42 is a few days away... how to edit is under construction (the manual that is).

However the thing with mmai is that it can be tweaked for a number of addon, give him very limited with supplies, fight about one city in singelplayer with high command.

Play warfare fight against the MMAI that is smarter then any Warfare ai so far, or use it as primary intended, a coop where you fight as the guerillas.

Actually I am starting planing for one "skynet" version for the terminator addon that is being made.
Cura Posterior

Offline Kremator

  • Members
  • *
Re: Invading AI ("one" script to rule them all..)
« Reply #11 on: 13 Aug 2009, 21:45:59 »
GranQ,

Absolutely wonderful!  I downloaded the test mission and watched the whole thing take place UNTIL the C130s kept crashing into the buildings on the runway apron.  Spoiled it slightly.

That being said the supply looks to be working fine.  Would be good to see a collection of containers/ammo boxes/barrels etc to show that the supply has properly taken place, but I'm sure you have this in hand.

I didn't see any enemies being engaged by the cobras ... will have to check the mission to see if you spawned any!

Keep up the great work.  Looking forward to pitting my HC wits against the AI :)

Offline granQ

  • Contributing Member
  • **
    • Anrop.se
Re: Invading AI ("one" script to rule them all..)
« Reply #12 on: 14 Aug 2009, 06:41:28 »
thanks and its solved.. this worked fine in ArmA1 where I did the mission first, my friend that converted also found out the bugged c130 (it can't tax.. so that won't work).. instead you get a c130 that do an overflight and airdrop a container with the cargo chute.

I am just installing ArmA 2 now. (06.40 here) and then will head to school.. but hope tomorrow to put out the new "proper ArmA 2 version".. tomorrow or sunday, we see :)
Cura Posterior

Offline Kremator

  • Members
  • *
Re: Invading AI ("one" script to rule them all..)
« Reply #13 on: 14 Aug 2009, 09:05:19 »
Great stuff!  Can't wait to see the modified version.

Offline granQ

  • Contributing Member
  • **
    • Anrop.se
Re: Invading AI ("one" script to rule them all..)
« Reply #14 on: 14 Aug 2009, 22:24:45 »
ok, new version, "arma2:ifered" released.. fixed some bugs. This mission isn't very exciting, doesn't have a briefing. Basicly you jump as a russian, try get some kills. (MMAI is what i work on, not the mission)

=== 0.42 ===
Now its almost 100% in SQF instead of SQS.

Additions:
   MMAI now preform CSAR for its fighter pilots.
   All types of vehicles/soldiers is defined in its own file.

Fixes:
   Corrected names for Chernarus
   Airborne operation didn't work because bad path.
   Markers now local on server, lowering traffic.
   Due to bug, the c130 will drop supplies instead of flying over.

http://kpcti.granq.se/files/MasterMind_AI.Chernarus.zip

WANTED: Can you do dialogs for arma2? I need your help..  also, if you want to start making missions, let me know what stuff you want the MMAI to do and so.

edit: To Kremator, was fun you came on visit. Sadly the mission was fucked, out of 75 lines in the script i manage to delete just the one that adds the money from the supply. Thats why there was no ai.. second time we tried after you left, we got chased by two a10's and we got like 300 meters before we had to leave it. Then came an airborne invasion but a bug made them just hoover, we thought we made it, then came the LAV platoon :) need to find the balance.
« Last Edit: 15 Aug 2009, 00:31:32 by granQ »
Cura Posterior