Author Topic: Weapon and AI Requests  (Read 6794 times)

0 Members and 1 Guest are viewing this topic.

Offline IceFire

  • GTVI Section 3
  • 212
    • http://www.3dap.com/hlp/hosted/ce
Quote
Originally posted by Righteous1
Unless someone is already working on it, I'll take a stab at the Gunship AI update.  I've looked at it a bit and I'm considering adding the following defines to ship.h:

#define SIF_GUNSHIP            (1 << 31)

#define SIF_MED_SHIP            (SIF_GUNSHIP)

#define SHIP_TYPE_GUNSHIP                   20

And will update the logic to allow the GUNSHIP fly like a bomber but support a fighter bay, turrets, etc.   If you prefer a different class name, let me know.

As for the AI gun control, would sexp control or automated by the AI be prefered?


Sounds great.  Gunship is what I've been refering to everyone else and I think its aptly named.

SEXP control for what exactly?  Maybe a short description of weapons on various Gunship styles would help.

You have the WhiteStar & SunHawk which have all their guns firing forward.  The best way to do that is to use the primary cannons rather than turrets with a limited FOV.  The reason being that primaries are linked while turrets fire independantly.  

You also have the Vorchan which has two turrets top and bottom and a main gun that fires in a small arc around the front.  All of those weapons basically point forward but the primary gun slot is not a good option.

Those are Babylon 5 examples...I've got FreeSpace ships that would use Gunship AI as well :)

And your effort is very much appreciated!!
- IceFire
BlackWater Ops, Cold Element
"Burn the land, boil the sea, you can't take the sky from me..."

 
I was refering to the AI weapon selection issue.  I think it could be automated somewhat based on the targeted ship type or a SEXP could be used to control when alternate weapons are selected.  If its automated, the mission designer has less control, if a sexp is used, he has more work.  So the question is, what's your preference?  [:)]

But this one is still on the back burner.  I'll finish the Gunship update first.

 
Quote
Originally posted by IceFire


You have the WhiteStar & SunHawk which have all their guns firing forward.  The best way to do that is to use the primary cannons rather than turrets with a limited FOV.  The reason being that primaries are linked while turrets fire independantly.  

You also have the Vorchan which has two turrets top and bottom and a main gun that fires in a small arc around the front.  All of those weapons basically point forward but the primary gun slot is not a good option.


Just for clarification, for the Vorchan, would you use a turret for those weapons?  i.e. will existing turret logic work for these?  Or are changes to the weapon logic needed as well.

Quote
Originally posted by IceFire

Those are Babylon 5 examples...I've got FreeSpace ships that would use Gunship AI as well :)



I'll be asking for those for testing purposes in a few days! :)

Other questions:

How large are these ships.  I'm assuming something between a bomber and a corvette.  The code uses several scaling factors for different effects based on ship size and I'm updating these for the new class.

As for the fighters and bombers spinning, I'm assuming this is probably due to the AI moving from the initial mission position to the 'formed on pilot' positioning.  That logic is pretty convoluted (at least to someone who's just learning it).  I'll probably just wave a dead chicken over it for now and hope its not too much of a problem!  :D  If you think its due to something else, let me know.

 

Offline Fury

  • The Curmudgeon
  • 213
Quote
Originally posted by Righteous1
I was refering to the AI weapon selection issue.  I think it could be automated somewhat based on the targeted ship type or a SEXP could be used to control when alternate weapons are selected.  If its automated, the mission designer has less control, if a sexp is used, he has more work.  So the question is, what's your preference?  [:)]

But this one is still on the back burner.  I'll finish the Gunship update first.


OK, how this sounds then?:

If mission designer likes AI to take care of weapons control, he/she can then equips turrets with whatever weapons he/she likes. AI will take care if from there.

But if mission designer likes to have more control, designer can unequip weapons if necessary and then use events to switch or equip weapons. And then AI will take care of it from there.

Of course this event needs also primary/secondary and slot number information. If mission designer wants to switch a primary weapon in slot 1, then current one is replaced. But if designer switches it to slot 2 and that particular slot is empty, then nothing else happens but now that turret has two weapons and will use both.

But I wonder how we could define if turret/weapon can be used with another weapon or not? Example:
-Turret 1 is equipped with heavy cap ship beam and heavy pulse gun. It will use only either, not both at same time.
-Turret 2 is equipped with light pulse gun and flak gun, it will use both at same time.

How we can define what we want turret by turret?
I hope it would be something we can change in FRED2.

Quote
Originally posted by Righteous1
How large are these ships.  I'm assuming something between a bomber and a corvette.  The code uses several scaling factors for different effects based on ship size and I'm updating these for the new class.

Drazi FireHawk is ~350 meters long and almost 300 meters wide.
Centauri Vorchan is ~605 meters long and little over 800 meters wide.
Can't confirm WhiteStar size because I don't have it currently in my tables. But it should be around 250 meters long, don't remember how wide tho...

So basically lenght of gunships is 100-800 meters...
« Last Edit: November 05, 2002, 10:52:45 am by 173 »

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
we should work on giveing turrets orders, then that would make such things easier
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline EdrickV

  • Valued
  • 29
    • http://members.aol.com/HunterComputers
Non-beam turrets lack a Turret-Fire SEXP, but there are Turret-Free/Turret-Free-All, Turret-Lock, Turret-Lock-All SEXPs. SEXPs for changing a turret's current weapon (whether that means changing the weapon selected for that weapon slot or just changing weapon slots) would be useful. (An ideal case would allow changing from say Gun Slot 1 (0 according to the code) to Gun Slot 2, (1 to the code) or even to Missile Slot 1, Missile Slot 2, etc. FRED2 currently allows 3 gun slots max, and 4 missile slots max. (The 4th gun slot space is used for the AI drop down list box.)

Righteous1, be aware that the ship types are used in multiple places in the source code. (For instance they're also used to determine what can dock with what.) If you're adding ship types, it would be nice to have a ship type that could dock with just about anything, or a ship flag that would allow such docking. :) Right now the only ships that can dock with Fighter/Bomber/Stealth fighter ships are repair/rearm ships, which makes a universal tow truck idea kinda hard to do. :) The ship wouldn't need new AI, transport/freighter would work. (I really need to find a copy of VC6 I can afford.)

I think the AI code in general needs an overhaul, (especially collision prediction and avoidance code) and it would be nice if the acceptable orders for various ship types were expanded.
Ground - "Let me help you out, you're clear to taxi any way you can, to any runway you see."

Mesh Gallery/Downloads:
http://members.aol.com/ArisKalzar/Gallery.html
Turreting 101:
http://members.aol.com/EdrickV/FS2/Turreting.html

http://members.aol.com/HunterComputers

 
Yep, I've noticed that.  The ship class gets used by itself in places and is combined into the SMALL, BIG, and HUGE ship types as well.  It looks like the update will be a big one (a lot of modules) but the updates themselves seem to be pretty trivial.

I agree with the AI upgrade.  As near as I can tell, the AI does collision detection with its target, but with little else.  Which would explain why your wingmen love to bump into you and each other.  The trick will be upgrading the AI without affecting the way the original campaign plays.  I suspect a lot of the missions are designed with the AI intelligence (or lack thereof) in mind ;)

Your suggestion for a tow truck brings up a question I have.   The Ship flags use bits to identify each ship class ex.:

#define   SIF_CARGO               (1 << 6)      // is this ship a cargo type ship -- used for docking purposes
#define   SIF_FIGHTER               (1 << 7)      // this ship is a fighter

There are defines setup in ships.h using bits 1-29 and I'm getting ready to add bit 30.  Does this mean we have room for one or two more ship flags?  I'm assuming we're limited to 32 bits before we have to make changes to the way the flags are defined/used...or am I misunderstanding something?

 

Offline IceFire

  • GTVI Section 3
  • 212
    • http://www.3dap.com/hlp/hosted/ce
Vorchan's weaponry would all be in turrets...however its relatively fast and all that weaponry is facing forward so the broadsize AI mentality that FS2 has for cruisers and destroyers is a problem.  The WhiteStar behaves like a large fighter (250 - 450 meters depending on which season of B5 your watching).

I prefer to have things automated for the most part.  I love having fire-beam in FRED2 because then I can script beamfights, but I also tend to use alot of beam-free as well (for obvious reasons).  SO I prefer to have automation and potentially optional scripting control for specific circumstances.

My general feeling is that if there is too much scripting...the free flow exploratory nature of a mission is then lost because its based on specific player events determined by the creator of the mission rather than a sound tactical plan devised by the player.

I like it neither here nor there.  I'm a pain in the butt :)

Not sure if that helps you but it does give a general overview of my personal philosophy of mission and MOD design.
« Last Edit: November 05, 2002, 07:01:37 pm by 18 »
- IceFire
BlackWater Ops, Cold Element
"Burn the land, boil the sea, you can't take the sky from me..."

 

Offline EdrickV

  • Valued
  • 29
    • http://members.aol.com/HunterComputers
As is, the SIF_*'s are being treated as ints so I think 31 is the max. (0-31 = 32 bits.) If we could find all the occasions where they are specified as ints and change them to doubles/long doubles we would increase the amount of bits, or we could do a seperate extra flags thing. (Extra flags would be put after the regular ship flags, read using optional string, and that could increase the amount of possible flags a lot more, depending on exactly how the string is read. As a F_NAME type, it would have a max of 255 characters.)

Edit: Scratch the double/long stuff. Bitwise operators won't work on them because they are floating point types.
« Last Edit: November 05, 2002, 09:11:38 pm by 657 »
Ground - "Let me help you out, you're clear to taxi any way you can, to any runway you see."

Mesh Gallery/Downloads:
http://members.aol.com/ArisKalzar/Gallery.html
Turreting 101:
http://members.aol.com/EdrickV/FS2/Turreting.html

http://members.aol.com/HunterComputers

 

Offline EdrickV

  • Valued
  • 29
    • http://members.aol.com/HunterComputers
Ohh, I just found something people will like. :v: code to let weapons cut through shields like they weren't there!

Code: [Select]
// AL 1-14-97: "Puncture" doesn't mean penetrate shield anymore, it means that it punctures
// hull do inflict maximum subsystem damage
/*
if ( Weapon_info[Weapons[other_obj->instance].weapon_info_index].wi_flags & WIF_PUNCTURE ) {
// If this weapon punctures the shield, then do
// the hit effect, but act like a shield collision never occurred.
quadrant_num = -1; // ignore shield hit
add_shield_point(obj-Objects, mc.shield_hit_tri, &mc.hit_point);
} else {
*/


For backwards compatability, we'd have to change the WIF_PUNCTURE to something else, but that shouldn't be too big a problem.
Ground - "Let me help you out, you're clear to taxi any way you can, to any runway you see."

Mesh Gallery/Downloads:
http://members.aol.com/ArisKalzar/Gallery.html
Turreting 101:
http://members.aol.com/EdrickV/FS2/Turreting.html

http://members.aol.com/HunterComputers

  

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
we could change what it is evaluateing from a flag to some new wip value like "pucture_value" and do some checking against the shield streingth in that quadrant

and for the colision detection thing maybe wecould just add ships that are in there radius  * 3 and/or in there wing to the list ouf ships they are to check to see if they will plow into
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together