Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: Amon_Re on June 07, 2006, 02:53:50 pm

Title: Silly AI
Post by: Amon_Re on June 07, 2006, 02:53:50 pm
Hi,

I just noticed while testplaying this here mission i'm writing that my wingmen stay waaaay to close to an "about to explode" PVT Aten. Is there a way to make sure they'll fall back to a safer distance instead of blowing up along with the Aten in the blast?

Keep in mind that my mission takes places pre-FS2, it takes place in a time when there were no shields...
Title: Re: Silly AI
Post by: Mars on June 07, 2006, 03:08:27 pm
From a players or a mission designers prespective?

As a player, you order them to form on your wing <Shift-W>

As a mission designer, you could have a small wing of weak fighters (Anubis for example) jump in and have the wing attack them, preferabley with a message like "Alpha 1, you finish the job, we'll deal with these bogies."
Title: Re: Silly AI
Post by: Cobra on June 07, 2006, 03:37:03 pm
the codemonkeys need to put in an AI code that has the other fighters get the **** away from an exploding cruiser or higher when it's going up. :nervous:
Title: Re: Silly AI
Post by: SadisticSid on June 07, 2006, 03:39:52 pm
Or you could just give them a waypoint order when the cruiser reaches 0 hull. Asking the coders for something so trivially solved by adept mission design is silly.
Title: Re: Silly AI
Post by: Amon_Re on June 07, 2006, 03:47:21 pm
Hmm... i was thinking more of a command from the Fenris, but it seems you can't create an event that has to start once the hull of a ship goes below a certain %?
Title: Re: Silly AI
Post by: CP5670 on June 07, 2006, 03:50:09 pm
They don't use the afterburners when following waypoints though. One way to do this is to have a disabled Pegasus or something jump in far away and send them after it, so they use the afterburners. Or a simpler solution is to just make them all invulnerable while it's blowing up. The player won't notice what's going on either way.
Title: Re: Silly AI
Post by: Amon_Re on June 07, 2006, 03:52:19 pm
They don't use the afterburners when following waypoints though. One way to do this is to have a disabled Pegasus or something jump in far away and send them after it, so they use the afterburners. Or a simpler solution is to just make them all invulnerable while it's blowing up. The player won't notice what's going on either way.

It's the detection of when it's about to go boom that eludes me  :nervous:
Title: Re: Silly AI
Post by: Axem on June 07, 2006, 04:08:13 pm
The AI may not use afterburners, but I've noticed them travelling waypoints way above normal speeds.

Detecting the ship exploding could be done with is-ship-destroyed-delay. Though there won't be much time between the death roll and the explosion. Or to give them a bit more time, when the ship has a low hull, send the fighters away and self-destruct the ship.
Title: Re: Silly AI
Post by: Mars on June 07, 2006, 04:11:01 pm
They don't use the afterburners when following waypoints though. One way to do this is to have a disabled Pegasus or something jump in far away and send them after it, so they use the afterburners. Or a simpler solution is to just make them all invulnerable while it's blowing up. The player won't notice what's going on either way.

That's why I suggested he use weak fighters and ai_chase instead.
Title: Re: Silly AI
Post by: Shade on June 07, 2006, 04:14:06 pm
Quote
but it seems you can't create an event that has to start once the hull of a ship goes below a certain %?
You can. The "hits-left" status sexp gives the hull %, so it's a simple matter of checking when that drops below your desired number.
Title: Re: Silly AI
Post by: Amon_Re on June 07, 2006, 05:02:44 pm
Cheers guys, that's what i needed to know  ;)

Edit: Erm, why is 'hits-left' greyed out in fred?
Title: Re: Silly AI
Post by: Axem on June 07, 2006, 05:22:56 pm
Hits-left is a number, not a condition. You have to use some of the logic sexps to use it. In this case, you'd probably want to go something like...

Code: [Select]
- <
-- hits-left
--- Ship A
-- 1

That is when Ship A has less than 1% hull, some event gets triggered.
Title: Re: Silly AI
Post by: Shade on June 07, 2006, 06:22:58 pm
Yep. Simplifying a bit (well... a lot), you can say there are basically three types of SEXPs: Those that carry out actions, those that can take arguments, and those that exclusively are arguments, with SEXPs that take arguments also in turn being usable as arguments themselves. For the purposes of this, the action SEXPs are irrelevant.

Only the ones that take arguments can be used to carry out evaluations, such as here when you need to evaluate whether the hull is below a certain percentage. And so any that can only be used as arguments are greyed out, as those can only be used to supply values for an already existing evaluation. Hope that clears up why this happens :)
Title: Re: Silly AI
Post by: Colonol Dekker on June 08, 2006, 05:57:26 am
Isnt there a ship> stay-away-from (or similar) under Ai ?
Surely that would look better than a uniformed retreat. :D

AI-SHIP-AVOID I'm certain thats the one !!
Any help, saves all that flippin "invisible target stuff".
Title: Re: Silly AI
Post by: Amon_Re on June 08, 2006, 01:34:10 pm
I opted to make the wings invulnuble (spelling?) for the last few remaining seconds of the Aten's life, works great
Title: Re: Silly AI
Post by: Trivial Psychic on June 08, 2006, 02:05:01 pm
Isnt there a ship> stay-away-from (or similar) under Ai ?
Surely that would look better than a uniformed retreat. :D

AI-SHIP-AVOID I'm certain thats the one !!
Any help, saves all that flippin "invisible target stuff".
There's ai-keep-safe-distance, and ai-evade, which may do the trick.  Personally, I'd much rather an antomatic AI behaviour be added into the advanced AI stuff was added about 6-8 months ago.  If a fighter or bomber is within a certain distance of a cruiser or larger class which has just hit 0% hull strength, then regardless of whether that fighter/bomber is hostile, friendly, neutral, or whatever, it'll drop whatever its doing and make a run for it away from the dying ship.  Granted, it can't be that simple, as objecttypes.tbl can add in classes which may not fall under the default class distinctions between large and small ships.  Perhaps it would necessitate fields in the objecttypes.tbl, such as $evades big explosions: true/false, for the fighter, bomber, or whatever class you want to run from explosions, and then a $evade this when dying: true/false, on the large ships.  You'll need both as there are classes in between fighters and cap-ships that can't run from exposions and won't generate big explosions that need to be run from... transports for example.
Title: Re: Silly AI
Post by: Nuclear1 on June 08, 2006, 03:54:16 pm
IIRC, fighters and bombers did this in FS1 when a destroyer was breaking up, but it also allowed fighters to pick them off easily while they were still running.
Title: Re: Silly AI
Post by: Trivial Psychic on June 08, 2006, 08:49:05 pm
In my view, it would be coded so all "small craft" regardless of which side their on, would run from the explosion.  This would prevent any side from taking the advantage.
Title: Re: Silly AI
Post by: Scooby_Doo on June 08, 2006, 10:12:40 pm
Sorta off topic, yet dealing with capital ship explosions....

I managed to find and reinstall WC Prophecy a while ago.  Would it be possible to have that style of cap ship destruction?  You get a death cry (no biggie scripting can handle that), followed by a massive shockwave (built in, although would like to create a big shockwave that just throws you around without taking much damage).  But whats missing is the secondary detonations, while keeping the ship mostly intact or at least in big pieces, but have explosions keep going off at least a few minutes after it's death. (sorta like batteries, fuel and ammunation baking off)  You get to see the devistation after it's all done, instead of just a few big chunks floating around.
Title: Re: Silly AI
Post by: Colonol Dekker on June 09, 2006, 04:10:33 am
I gotta say the best cap-ship deaths IMO are starlancer through and through, Freelancer cap-deaths are awful...
Title: Re: Silly AI
Post by: Nuclear1 on June 09, 2006, 09:05:22 am
In my view, it would be coded so all "small craft" regardless of which side their on, would run from the explosion.  This would prevent any side from taking the advantage.

Well, substitute "fighters" with "me" and you probably get what I mean actually.
Title: Re: Silly AI
Post by: CP5670 on June 09, 2006, 09:22:29 am
Quote
I managed to find and reinstall WC Prophecy a while ago.  Would it be possible to have that style of cap ship destruction?  You get a death cry (no biggie scripting can handle that), followed by a massive shockwave (built in, although would like to create a big shockwave that just throws you around without taking much damage).  But whats missing is the secondary detonations, while keeping the ship mostly intact or at least in big pieces, but have explosions keep going off at least a few minutes after it's death. (sorta like batteries, fuel and ammunation baking off)  You get to see the devistation after it's all done, instead of just a few big chunks floating around.

You get some of the small explosions around the ship before the main shockwave goes off. Although I agree that in general, the capital ship explosions could use a lot of improvement. I think that's the only aspect of the graphics that is still more or less unchanged from the original game.
Title: Re: Silly AI
Post by: Colonol Dekker on June 09, 2006, 09:46:54 am
Well If the coding slowed down debris  to a few KPS, the Devbris lods could be made to resemble a "burnt husk" and add the FS equivalent of "persistant corpses" so the debris doest "pop" after a few minutes.
Title: Re: Silly AI
Post by: IPAndrews on June 09, 2006, 10:53:28 am
If a fighter or bomber is within a certain distance of a cruiser or larger class which has just hit 0% hull strength, then regardless of whether that fighter/bomber is hostile, friendly, neutral, or whatever, it'll drop whatever its doing and make a run for it away from the dying ship.  Granted, it can't be that simple,

Have the game engine automatically give high priority evade or keep-safe-distance orders to any small ship when a large ship is destroyed. If you have a garbage collecting routine that removes such orders once the big ship has finished exploding, then you have a solution which makes use mainly of existing code. I think.  :nervous:
Title: Re: Silly AI
Post by: CP5670 on June 09, 2006, 10:57:48 am
What does ai-evade actually do? I never found it to have any noticeable effect when I tried using it.
Title: Re: Silly AI
Post by: IPAndrews on June 09, 2006, 11:01:03 am
I'm guessing it's supposed to make the ship run in the opposite direction (indefinitely?) as opposed to keep safe distance where they only run so far from the ship. 100% guessing of course. So this reply is in fact pretty worthless.
Title: Re: Silly AI
Post by: CP5670 on June 09, 2006, 11:14:49 am
That's what you would think, but the AIs don't seem to behave any differently at all when given that order. They don't hesitate to attack the thing they are supposed to be evading.
Title: Re: Silly AI
Post by: IPAndrews on June 09, 2006, 11:20:28 am
Sounds fishy. I'd be tempted to Mantis that.