Home   Help Search Login Register  

Author Topic: AI Airstrip  (Read 7996 times)

0 Members and 1 Guest are viewing this topic.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:AI Airstrip
« Reply #15 on: 25 Apr 2004, 20:33:07 »
Just a thought, but could you not disable the AI 'move'.

It would mean that you would have to control their every move, instead of letting them do it.


Planck
I know a little about a lot, and a lot about a little.

PsyWarrior

  • Guest
Re:AI Airstrip
« Reply #16 on: 25 Apr 2004, 21:45:33 »
Quote
Just a thought, but could you not disable the AI 'move'

Aaaaaaaaagh!
*thinks of 2000+ page script to control a plane in the air with dogfighting, etc.*

If you did that, Planck, the AI would be completely incapable of doing anything once they got into the air! Unnamed would launch them, and as soon as the script cut out, the plane would plummet right out of the sky as the AI has not idea how to move or anything.

It would be possible to do that for planes on the ground, but as there's no way of re-enabling the AI after launch, it sort of makes the command more trouble than it's worth.

-Psy|W

Unnamed

  • Guest
Re:AI Airstrip
« Reply #17 on: 25 Apr 2004, 21:45:39 »
Quote
This is so basic it's probably going to insult you but: have you tried the "stop" command?

You would think that would work, but no. The AI ignores every order you give it, while trying to take off :(

Quote
Does this only happen if you put it on the main runway? what happens if you put it on the second runway on Malden/ Nogova? Or on a flat part of Kolgujev?

I think the AI is programmed to try and take off ASAP, so it will do it anywhere including the desert island.

Quote
What about placing it on the top of a carrier?

I will have to download a carrier (any suggestions on the best one to try?) But it would probably just drive off the side, left to its own devices :)

Quote
What about landing? That's going to be the difficult part.

Yeah I see it as two parts, the first getting it to a spot say 1000m away and 500m high, facing the runway, so we can take control of it. The second, getting it to touch down at a sensible speed without bashing itself to bits. I need to create some graphs based on how BIS do it, then just try and copy it.

Quote
Noticed that. Look at the carrier takeoff script for the HMS Hermes BETA - it has the same problem. I think we can live with it.

At a push you could use the say command and a generic sample for take off.

Quote
Just a thought, but could you not disable the AI 'move'.

I hate doing this if I plan on using the guy in game. But kind of on the same lines, cam creating a temporary pilot (with no AI) for take off and landing should work. Although you have to mess around swapping them, when they get in and out or there about to land.

Cheers
« Last Edit: 25 Apr 2004, 21:51:48 by Unnamed »

PsyWarrior

  • Guest
Re:AI Airstrip
« Reply #18 on: 25 Apr 2004, 21:57:39 »
Quote
I will have to download a carrier (any suggestions on the best one to try?) But it would probably just drive off the side, left to its own devices
How about the HMS Hermes BETA (I believe it is from the Falklands mod people). It's only a BETA release, but it should suit your needs. And you will be able to see what I was talking about with the carrier top launch scripts.

Actually, I think it won't drive off the side - it will just sit there...refusing to move at all (as most units will when placed on a structure over water). Or maybe it will just drive off the side. ;D

Quote
Yeah I see it as two parts, the first getting it to a spot say 1000m away and 500m high, facing the runway, so we can take control of it. The second, getting it to touch down at a sensible speed without bashing itself to bits. I need to create some graphs based on how BIS do it, then just try and copy it.
*Shudder* :noo:

Quote
cam creating a temporary pilot (with no AI) for take off and landing should work. Although you have to mess around swapping them, when they get in and out or there about to land.
Now that's a good idea... It should be workable too. You could setpos the original pilot somewhere where he won't be seen (10,000 M up in the air, perhaps?), and use createUnit (and then remove the movement AI), or camCreate (to create a pilot with no AI at all). So the disableAI command could be useful, in the end... ::)

-Psy|W

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:AI Airstrip
« Reply #19 on: 25 Apr 2004, 22:08:30 »
Well, I didn't actually expect the disabled Ai to fly the plane, I naturally assumed you would give it a proper pilot at the appropriate time.

It's a workaround anyway.


Planck
I know a little about a lot, and a lot about a little.

Black and White

  • Guest
Re:AI Airstrip
« Reply #20 on: 26 Apr 2004, 05:53:38 »
hey a quick comment:

if you disable the AI for a particular unit... ie: AI movement
well can't you always just enable it again...?

never tried it, buts that what i just thought...
so mayhaps you can disable his AI for takeoff and re-enable it for flight...

PsyWarrior

  • Guest
Re:AI Airstrip
« Reply #21 on: 26 Apr 2004, 11:50:25 »
@Planck - sorry, misunderstanding. Of course, it would be impossible to simply disable the AI of a unit altogether and expect it to fly, but it would certainly be possible to replace the real pilot with one without the "Move" AI.
[EDIT: Made no sense. Corrected]

It may be the best workaround there is - After all, many things in OFP are workaronds - The CoC torpedoes and Project MCAR, for instance...

@Black and White: BIS seem to have missed out the enableAI command... Which means that using disableAI on a unit will permanently remove the specified section of it's AI.
It cannot, to the best of my knowledge, be re-enabled.

Progress, Unnamed? Is swapping the real pilot out with a 'stupid' pilot a viable option?

If so, the 'stupid' AI could be brought in as soon as the plane is at a dead stop (when landing). However: another complication: If you wanted the pilot to jump out and move somewhere on foot (barracks, ready room, medical facilities, ATC tower etc.), you would have to swap the AI's again when you want the pilot to disembark!

How can obvious AI changing be avoided if the player is watching? You could use setFace to get the features the same, but I don't think there's a getFace command (correct me if I'm wrong) that could be used to tell which face the pilot has. Matters would also be complicated if the pilot is not wearing the 'standard' BIS pilot uniform.

In another matter: Will the takeoff/ landing scripts work with all planes? I have noticed that the takeoff/ landing system on the HMS Hermes will work with most planes, but will not work with the Sea Harrier (another Flashpoint in the Falklands vehicle).

-Psy|W

P.S. - did some more research - HMS Hermes carrier and sea harrier are available Here.

[EDIT 3:] Corrected horrific grammer and random comma placement.
« Last Edit: 26 Apr 2004, 18:15:00 by PsyWarrior »

Unnamed

  • Guest
Re:AI Airstrip
« Reply #22 on: 26 Apr 2004, 23:01:09 »
Quote
Progress, Unnamed? Is swapping the real pilot out with a 'stupid' pilot a viable option?

I did some more messing with AI in planes, to try and work out whats going on.

If you put anything as a pilot into a plane with fuel, placed on the ground. It will try and take off. If its a gamelogic, it will get so far then realizes it cant fly and stop dead.

One way to stop this is the SetFuel command. If you use SetFuel 0 in the vehicles init event, you get a few seconds after the AI has moved in, to setFuel 1. This way he will not report missing fuel and he wont start the engine until you give him an action command. So sorry for dismissing Setfuel before, without giving it a better go.

I had a go at getting the AI to land, not very elegant but it survives :) You have to cut the engine before touchdown, otherwise the AI tries to take off again.

You can use FlyInHeight and Setvelocity to get it down to 20 meters at a reasonable speed. After that you have to fight against the 20 meter altitude limit OFP puts on aircraft travelling at a certain speed.

The other is landing gear, I can't get the AI to lower the landing gear. The Action ["land gear"] only works with the player or empty planes. I think you might be able to lower them using animations, but that would require most addons to be changed :(

Quote
If so, the 'stupid' AI could be brought in as soon as the plane is at a dead stop (when landing). However: another complication: If you wanted the pilot to jump out and move somewhere on foot (barracks, ready room, medical facilities, ATC tower etc.), you would have to swap the AI's again when you want the pilot to disembark!

You have to have someone in there, otherwise the plane veers off course. At worst it would be a Game Logic that looks like a pilot, but I think you could keep the original pilot without disabling his AI.

Quote
In another matter: Will the takeoff/ landing scripts work with all planes? I have noticed that the takeoff/ landing system on the HMS Hermes will work with most planes, but will not work with the Sea Harrier (another Flashpoint in the Falklands vehicle)

I had a look at the Hermes, I liked the way they setup its direction in the example mission to exploit the AI's desire to take off straight away.

If you don't define an airport in the config, the AI heads straight for position [0,0,0]. If it can get enough speed up it will take off, so you could make sure the airstrip is pointing towards the position defined in the config, then the AI will quite happily take off all day. You might need the aircrafts top speed if you want to handle taking off using scripts, but not for landing.

I tried the above with the Sopwith, C17 and a Tornado.

The landing gear is the main problem, short of animating it into position I don't know how to land the planes. I will take a look for an Airstrip addon, something that you can just place in the editor and will allow the planes to reach there take off speed.

Cheers

PsyWarrior

  • Guest
Re:AI Airstrip
« Reply #23 on: 27 Apr 2004, 09:34:43 »
Quote
If you put anything as a pilot into a plane with fuel, placed on the ground. It will try and take off. If its a gamelogic, it will get so far then realizes it cant fly and stop dead.
??? ::)
A gamelogic tries to take off, and OFP has to think before it realises it's not alive?
Read above comments about BIS plane AI...

Quote
One way to stop this is the SetFuel command.
Good! I didn't know that you had to issue the AI a command to get it to recover from a lack of fuel. Does this stop it heading for 0,0,0 or taxing south altogether?

The ["Land Gear"] action probably does work - but the instant the gear starts to deploy, the pilot pulls it back up again.
If you animated a set of 'gear' down, wouldn't OFP just regard it as another bit of the plane that was sticking out, not actually landing gear? So if you tried to land on them, it would just explode, as if you had clipped the wing on the ground. When the 'gear down' action is selected, does it just perform an animation, or does it do some kind of technical...stuff...that tells OFP not to simply blow the plane up when it touches the ground?
I hope someone understands the above enough to comprehend what I'm going on about ::)

There is one plane addon that can land without gear (i.e. crash landing). I believe it's the F/A 18. Unfortunately, none of the other planes can do it, so that isn't really helpful.

I'm sorry I can't be more help with this at the moment... There must be some way to get the AI to lower his gear!

Moving on:
How far away/ what height does the plane have to be at to begin landing?

Quote
I tried the above with the Sopwith, C17 and a Tornado.
Good variety. Which tornado? the ITA and the RAF version are quite different.

Here's another idea for you: while you are testing, instead of looking for/ creating an airstrip, you could
-Use the taxiway sections from an editorUpgrade to create a fairly long runway
-Sink the Hermes carrier into the ground, using setPos commands, so that the 'Boat' part is not visable, and the runway and tower are level with the ground. You could use the length of the carrier then, as a runway.

-Psy|W

Unnamed

  • Guest
Re:AI Airstrip
« Reply #24 on: 28 Apr 2004, 16:17:32 »
Quote
A gamelogic tries to take off, and OFP has to think before it realises it's not alive?

Hmm I dont know why this happend, I cant get it to do the same again. Might have been some stray code I had kicking about  ???

Quote
Good! I didn't know that you had to issue the AI a command to get it to recover from a lack of fuel.

Me neither, I read about it over at the "Time For Action" thread.

Quote
Does this stop it heading for 0,0,0 or taxing south altogether?

But aircraft only work that way on Islands that have no taxi way defined (Desert Island), otherwise they startup as soon as the fuel is in the plane.

Quote
If you animated a set of 'gear' down, wouldn't OFP just regard it as another bit of the plane that was sticking out, not actually landing gear?

Yep apparently it has to be selected from the action menu, and that option is defined in the config. I dont think you can include the Land Contact Points in a regular animation, I think they are just linked to the Landing gear.

Quote
When the 'gear down' action is selected, does it just perform an animation, or does it do some kind of technical...stuff...that tells OFP not to simply blow the plane up when it touches the ground?

Both, as above.

I tried a C130 that already had animations defined for the gears. What you can do, is set retractgear=false in a config, so the landing gear is down all the time for the AI. Then use animations to retract\extract the landing gear geometry, so you can at least fool someone watching the AI land and take off. You could add a script to destroy AI planes if they touch the ground without the gears displayed.

But this means creating your own tiny addons to inherit from each type of aircraft you want to include.

Quote
How far away/ what height does the plane have to be at to begin landing?

OFP approaches from about 100 meters high, I'm not sure about the distance, but it takes it's time. It will depend on the speed of the plane during level flight, and how quickly you want to slow it down, what might be in the way e.t.c

I'm using the ITA Tornado, just to see how the speeds pan out across different types. Getting all types to land is easy, when you fix the landing gear down. Making it accurate enough for small runways like the Hermes will be the hardest part.

Quote
Use the taxiway sections from an editorUpgrade to create a fairly long runway

The Taxi Way will do fine for now, thanks. Although it's quite a narrow target to hit  :o

PsyWarrior

  • Guest
Re:AI Airstrip
« Reply #25 on: 29 Apr 2004, 11:47:06 »
Quote
But this means creating your own tiny addons to inherit from each type of aircraft you want to include.
Awwww whaaat?! I don't want to create a new addon for every single OFP plane... I doubt you will either, since you'd have to mod every new plane that was released!
As a mission editor, I really don't want to have a list with
Unnamed's slightly modified A10
Unnamed's slightly modified F/A 18c Blue AT
...
Unnamed's slightly modified F/A 18d grey AA
...
Unnamed's slightly modified RAF Tornado AA

and so on...

There must be another way around this.

Quote
Hmm I dont know why this happend, I cant get it to do the same again. Might have been some stray code I had kicking about  
So we could use a gamelogic pilot to stop movement?

Quote
Yep apparently it has to be selected from the action menu, and that option is defined in the config.
How annoying. Accursed BIS' AI.

So: If you empty the plane, you can put the gear down, but the plane veers off to the side and plummets to the ground. If you keep the pilot in the plane, you can't put the gear down. What happens if you swap the pilot out for a gamelogic? What about removing the pilot, issuing the 'Gear Down' command, and then put the pilot back in? What about using a loop to re-issue the 'gear down' command every 0.01s?

I'm going to find some workaround for this if it kills me... >:( ::)

Quote
Although it's quite a narrow target to hit
Just wait till we start placing carrier length runways at random angles... ;D

-Psy|W

Unnamed

  • Guest
Re:AI Airstrip
« Reply #26 on: 30 Apr 2004, 13:20:09 »
Quote
Awwww whaaat?! I don't want to create a new addon for every single OFP plane... I doubt you will either, since you'd have to mod every new plane that was released!

It would be a pain I know, although it would not bother me so much, but I would only do it for planes I wanted to use myself. You would have to organise them in the editor, it's only a tiny config rather than the entire addon. But a script based solution would be ideal.

If there compatable with Sefe's landing gears (Just spotted this) http://www.ofpec.com/editors/resource_view.php?id=81 The additional config will only contain a couple of lines.

Quote
There must be another way around this.

This is the only thing thats preventing it from being a viable option ATM.

Quote
So we could use a gamelogic pilot to stop movement?

No, but I need to mess round with SetFuel more.

Quote
How annoying. Accursed BIS' AI.

Yeah, it has a knack of throwing a spanner into the works. But thats probably down to the imensity of what BIS are trying to do.

Quote
What happens if you swap the pilot out for a gamelogic? What about removing the pilot, issuing the 'Gear Down' command, and then put the pilot back in? What about using a loop to re-issue the 'gear down' command every 0.01s?

It might work, if you get the timing right. The action command for landing gear does work with AI, but only when its on the ground ::)

Quote
I'm going to find some workaround for this if it kills me...

Lol..I know what you mean.

Quote
Just wait till we start placing carrier length runways at random angles

Yeah, if it can land on that Taxi way, Carrier's should be easy. It would be nice to get to the point where you can set a crash probability, just to spice things up :)

PsyWarrior

  • Guest
Re:AI Airstrip
« Reply #27 on: 30 Apr 2004, 20:34:22 »
Quote
The action command for landing gear does work with AI, but only when its on the ground
ROFL!
Oh, Right, so if you're in the air and you hit the gear, nothing happens, and you have to eject. If you're on the ground and you hit the gear, they go up, and you total your multi-million pound/ dollar/ euro fighter.
Makes sense. ::)

Quote
It would be nice to get to the point where you can set a crash probability, just to spice things up
LOL...
Reminds me of a HALO script I did (I think everyone creates a HALO script at some point during their scripting 'career'). It had a built in Chute-faliure-and-plummeting-to-death 'feature' ( ::) ), and a 50% chance of being saved by a secondary chute.
Unfortunately, I set the defaults a little high - out of 3 squads, about 6 people were killed each time... ;D

Hence, the randomCrash factor should be able to be set by the mission designer.

But, yes, a very small chance of crash would be a nice (in a way) feature, especially if the system is to be used in RTS mods. It would add a touch of realism to a genre that is often associated with unrealism.

I haven't come up with any other gear ideas yet... Have a play with the other stuff, and see if there's any possiblity in them. If not, we'll just have to keep thinking...

...or modify all the addons :noo:

-Psy|W
« Last Edit: 30 Apr 2004, 20:35:17 by PsyWarrior »

Unnamed

  • Guest
Re:AI Airstrip
« Reply #28 on: 03 May 2004, 09:33:58 »
Quote
HALO scripts

Lol..Some of the funniest moments online where with Halo scripts  ;D

Quote
I haven't come up with any other gear ideas yet... Have a play with the other stuff, and see if there's any possiblity in them. If not, we'll just have to keep thinking...

I still think addons are the way to go, it makes life so much simpler. After they land it would be ideal if you could see them taxi into hangers e.t.c With the AI fighting you all the way, this would be almost impossible using regular planes. Im messing around with a version of the Sopwith defined as a car, to see how that works.

I managed to get an AI plane to stay put on the ground, just used a quick loop that keeps seting the fuel from 0 to 1. It makes the AI's engine tick over at very low revs, without complaing about the fuel level.



PsyWarrior

  • Guest
Re:AI Airstrip
« Reply #29 on: 04 May 2004, 10:00:53 »
Quote
Lol..Some of the funniest moments online where with Halo scripts  
Bet they didn't have 'Random-sending-half-the-players-to-their-doom' though... ::)

Quote
I still think addons are the way to go, it makes life so much simpler.
Hmm... :-\
You may be right. If so, addon makers will have to be contacted, CPPs will need to be rewritten, addons organised,
Ignore=true; goto "New Info"
gear redesigned, and 50MB of stuff to download (Instead of just scripts and a demo mission). It's a lot of work to take on.

OK. If we did do this through addons, how much space would the addons take up? If they are roughly the same size as the existing addons, we're looking at a large download.

Basic question: Is it possible to use the textures and model in another addon? If so, our PBOs would only need the new CPP/ scripts, not all the model, textures and scripts that come with the full version of the addon.


#NEW INFO
Quote
I would only do it for planes I wanted to use myself. You would have to organise them in the editor, it's only a tiny config rather than the entire addon.
Verdammt, just noticed the above. Ignore the stuff I have written.
If you were going for a full release, you'd need to do this for as many planes as you could get permission to do so for. Or at least, all the most popular planes, anyway.

Quote
I managed to get an AI plane to stay put on the ground, just used a quick loop that keeps seting the fuel from 0 to 1.
Good. How is the AI going to be moved around on the ground? A setPos/ setDir loop? May look a little strange, though.

-Psy|W
« Last Edit: 04 May 2004, 10:03:53 by PsyWarrior »