Jump to content
Sign in to follow this  
Madin

Forcing AI controlled Aircraft to land?

Recommended Posts

I am looking to slightly improve the skirmish AI's chances when it comes to its usage of aircraft that require reloading at an airfield (i.e. GDI Orca and Firehawk).

There are 3 behaviours that the skirmish AI has that I believe could be improved if I could somehow force them to return to base.

  1. An AI controlled aircraft will use all of its ammo in an attack, but instead of returning to reload, will continue moving forward (sometimes to the back of an opponents base!), this frequently causes the aircraft to get destroyed.
  2. The AI controlled aircraft while having no ammunition, will constantly move to attack an enemy unit that is near its base. Sometimes it will go towards its airfield as if it is going to land, and then go back to the enemy unit. It can repeat this behaviour until either it or the enemy unit (or units) are destroyed. To make things worse, this can happen to groups of AI controlled aircraft.
  3. The AI controlled aircraft will load a single round of ammunition, take off and fire that single round, then and load another round, then repeat the behaviour.

This means that the skirmish AI can be very wasteful when it comes to using aircraft with limited ammo. And obviously GDI are the AI that is effected the most.

I would like a way of forcing the AI aircraft to land when they are out of ammo. And once they have landed I want them to at least stay on the airfield for a few seconds (to limit behaviour #3).


Because of behaviour #2, I think that having a command (i.e. LUA), that only is played once when the aircraft's ammo first runs out will not do.

Any ideas would be most welcome, thanks!

Share this post


Link to post

1. Keeping them grounded: Trigger a status like IMMOBILE or so once landed from the TAXI conditionstate maybe? Remove that status when exiting -RELOADING?

2. Map wise you can tell a aircraft to garrison its airfield and that makes it land (have a look at any of the sp maps that use that like the gdi first mission or the gdi mission with the battlebase /empy nod vehicles mission, see what script that is precisely and work from that), so maybe use lua to trigger that script on the Onclip empty condition?

2b. ive been experimenting with a remnant of the ZH aurora code to simulate aircraft fuel. It works pretty well so far but needs more work for my use but you might be able to use it to force AI aircraft home on clip empty aswell. Altho AI control might override it?

<JetAIUpdate
				id="ModuleTag_JetAIUpdate"
				AutoAcquireEnemiesWhenIdle="YES"
				NeedsRunway="false"
				KeepsParkingSpaceWhenAirborne="true"
				OutOfAmmoDamagePerSecond="1.5"
				MinHeight="5"
				CirclesForAttack="true"
				ReturnForAmmoLocomotorType="SUPERSONIC"
				UseForOutOfAmmoCheck="SIGMA_DummyFuelWeapon"
				OutOfAmmoEvaEvent="AircraftOutOfAmmoDamage"
				ReturnToBaseWhenVictimDead="true"
				AILuaEventsList="GDIFirehawkFunctions">
				<UnitAITargetChooserData
					SympathyRange="100.0" />
				<LockonInfo />
			</JetAIUpdate>

<LocomotorSet 
			Locomotor="FirehawkLocomotor"
			Condition="NORMAL"
			Speed="200.0" />
		<LocomotorSet 
			Locomotor="FirehawkLocomotor"
			Condition="SUPERSONIC"
			Speed="200.0" />
		<LocomotorSet
			Locomotor="BasicHelicopterTaxiLocomotor"
			Condition="TAXIING"
			Speed="10" />

i just use the same locomotor for the supersonic condition as the aimodule needs that conition to work iirc.

I use a dummy weapon for fuel count, my actual weapons on the aircraft autoreload, but you can use the normal  weapon for Useforaotofammoceck=

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×