Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: esarai on October 12, 2008, 07:19:35 pm

Title: Altering AI
Post by: esarai on October 12, 2008, 07:19:35 pm
I was wondering,
say you have a ship that doesn't have many powerful beams, but has one helluva powerful main cannon riding in the front. How do you alter the capital ship AI so that at the right range it uses the cannon instead of attempting a broadside of its target?

I think the best way for this ship to function would be something like
     If range to target => 10000, AI attempts to line up the main gun for a strike.
     If range to target < 10000, AI changes course to attempt a new attack.

Do realize that this ship is not supposed to be a Destroyer or a Juggernaut, it's something sizing in between a cruiser and a corvette, and would be meant as a small ship intended to effectively (and cheaply) counter larger ships.

Also, coming to think about it, is there any way to make beams punch through a ship without destroying it?

Any ideas on how to pull this off?

P.S. for those of you who are waiting for the Fenris MkII (AKA GTC Garm), I haven't forgotten about it. I'm being crushed under a pile of textbooks. Really heavy textbooks. Don't take this post as a sign I'm working on something different--I was just curious.

I guess while we're on the topic of the Garm, does anybody know how to stop mipmapping? Its something I've noticed that all my models that use jpg-based dds textures do. Perhaps I need to export as a bitmap and then make dds's? Any help here greatly appreciated.
Title: Re: Altering AI
Post by: redsniper on October 12, 2008, 07:26:13 pm
Waypoints. Just fake it.
Title: Re: Altering AI
Post by: Droid803 on October 12, 2008, 07:41:13 pm
AI coding is hard.
Waypoints are much easier :P
Title: Re: Altering AI
Post by: esarai on October 12, 2008, 10:48:43 pm
Will a ship still fire a hardpoint weapon while following paths?

Can Capital ships even fire hardpoint-based weapons?

Could you tell a really large ship that it's a fighter, so that it will do the fighter things that it does, but set it to ignore all the other fighters in the mission so it won't try to dogfight with something 100 times smaller?

Or wait... ships like to charge each other before they engage... so just use a normal turret that's scripted to turn off when the ship gets too close.
Title: Re: Altering AI
Post by: Hellstryker on October 12, 2008, 10:52:21 pm
Could you tell a really large ship that it's a fighter, so that it will do the fighter things that it does, but set it to ignore all the other fighters in the mission so it won't try to dogfight with something 100 times smaller?

Try it and see what happens.  :p
Title: Re: Altering AI
Post by: Droid803 on October 12, 2008, 10:57:22 pm
You can tell a large ship its a bomber, and it'll fire its turrets at other ships, AND its hardpoint-based weapons.
It'd try to dogfight (and fail) due to its slow speed and turning, or, in the case of the Colossus, kill swaths of fighters by smashing into them.
Title: Re: Altering AI
Post by: TrashMan on October 13, 2008, 06:23:26 am
Hardpoint?
How come it doesn't have a turret?
Title: Re: Altering AI
Post by: BengalTiger on October 13, 2008, 07:19:19 am
If you tell a ship it's a bomber, the enemy also sees a bomber and figures out using bombs against it doesn't make sens, so you'd have to fake bombing runs if you do that.
Title: Re: Altering AI
Post by: Droid803 on October 13, 2008, 11:36:58 am
That's rather unfortunate.

On a slightly different topic, has anyone tried mixing typse (like "bomber" "cruiser") to see what hapens? Or doest hat break the AI even more?
Title: Re: Altering AI
Post by: Aardwolf on October 13, 2008, 05:39:05 pm
That breaks damage. I once had a freighter/fighter and as soon as it got shot the game CTDs. Explanation at the time was a divide by zero error caused by doing something stupid.
Title: Re: Altering AI
Post by: Snail on October 14, 2008, 03:16:54 pm
The best solution is making the weapon a turret and giving the ship waypoints. Capships with hardpoints is a bad idea...
Title: Re: Altering AI
Post by: Retsof on October 14, 2008, 07:31:10 pm
Could one make a turret with a firing arc of 0?
Title: Re: Altering AI
Post by: Droid803 on October 14, 2008, 07:31:48 pm
That might break something. Try 1.
Title: Re: Altering AI
Post by: esarai on October 14, 2008, 10:47:47 pm
Sweet. Thanks for all the suggestions.

Hardpoint?
How come it doesn't have a turret?

The purpose for using a hardpoint instead of a turret was to prevent the ship from saying, "Whoo hoo hoo I'm gonna defy the laws of just about everything and fire some lasers out my arse." I've seen some ships do that... and it annoys the hell out of me.

It seems like this would be remedied with a firing arc of 1. How exactly does one set the firing arc?
Title: Re: Altering AI
Post by: Flaming_Sword on October 14, 2008, 10:56:59 pm
You have to mess with the pof, specifically, the field of view ($fov) on the turret submodel.