Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: WMCoolmon on December 19, 2005, 04:43:13 am

Title: shiptypes.tbl
Post by: WMCoolmon on December 19, 2005, 04:43:13 am
Newest build:   http://fs2source.warpcore.org/exes/latest/shiptypes3.zip

I have the basic framework & changes done for this, so it should really be an at-will dealie to add more fields.

Edit: Oh I added new animation type "afterburner", didn't test it tho.

http://fs2source.warpcore.org/exes/latest/shiptypes.zip

For now shiptypes.tbl is required (included in zip). I need to make sure that this is compatible with stuff, especially SEXPs like kills by ship type. Behavior should be exactly the same as retail FS2 with this table.

Here's an entry near and dear to my heart:
Quote
$Name:         Fighter
$EMP Multiplier:   4.0
$Fog:
   +Start dist:   10.0
   +Compl dist:   500.0
$AI:
   +Valid goals:   ("fly to ship" "attack ship" "waypoints" "waypoints once" "depart" "attack subsys" "attack wing" "guard ship" "disable ship" "disarm ship" "attack any" "ignore ship" "guard wing" "evade ship" "stay still" "play dead" "stay near ship" "keep safe dist" "attack besides")

EMP multiplier makes EMP take longer to go away (from weapons). Start dist should be when fogging starts. Compl dist should be when ship is totally obscured. Valid goals are goals that the ship will accept. It would be interesting to know if capships support "Attack subsys" type orders if this is added to their valid goals list.

The full list of goal names (in code form, tough, not typing these out by hand yet another time):
Code: [Select]
ai_goal_list Ai_goal_names[] = {
{"Attack ship", AI_GOAL_CHASE},
{"Dock", AI_GOAL_DOCK},
{"Waypoints", AI_GOAL_WAYPOINTS},
{"Waypoints once", AI_GOAL_WAYPOINTS_ONCE},
{"Depart", AI_GOAL_WARP},
{"Attack subsys", AI_GOAL_DESTROY_SUBSYSTEM},
{"Form on wing", AI_GOAL_FORM_ON_WING},
{"Undock", AI_GOAL_UNDOCK},
{"Attack wing", AI_GOAL_CHASE_WING},
{"Guard ship", AI_GOAL_GUARD},
{"Disable ship", AI_GOAL_DISABLE_SHIP},
{"Disarm ship", AI_GOAL_DISARM_SHIP},
{"Attack any", AI_GOAL_CHASE_ANY},
{"Ignore ship", AI_GOAL_IGNORE},
{"Guard wing", AI_GOAL_GUARD_WING},
{"Evade ship", AI_GOAL_EVADE_SHIP},
{"Stay near ship", AI_GOAL_STAY_NEAR_SHIP},
{"keep safe dist", AI_GOAL_KEEP_SAFE_DISTANCE},
{"Rearm ship", AI_GOAL_REARM_REPAIR},
{"Stay still", AI_GOAL_STAY_STILL},
{"Play dead", AI_GOAL_PLAY_DEAD},
{"Attack weapon", AI_GOAL_CHASE_WEAPON},
{"Attack besides", AI_GOAL_CHASE_ANY_EXCEPT},
{"Fly to ship", AI_GOAL_FLY_TO_SHIP},
};
Title: Re: shiptypes.tbl
Post by: Wanderer on December 19, 2005, 05:09:02 am
Cool!  :yes:

Would this table perhaps in some foreseeable future enable new ship types, bring the ability to define which ships are big (valid targets for huge weapons) and which are not, and the ability to define AI behaviour for these to enable true 'gunboats' and stuff like that?
Title: Re: shiptypes.tbl
Post by: Trivial Psychic on December 19, 2005, 05:21:25 am
I agree.  We'd need an ability to define which AI format to use as well.  For example, if I make the described Gunship AI, I want it to use the same attack method of a fighter or bomber, but there's no way to define that... yet.  Also, I'd like to request that an entry determine whether or not a ship can carry cargo, and also a list of which player orders may be accepted by a class.
Title: Re: shiptypes.tbl
Post by: Flaser on December 19, 2005, 07:15:07 am
AFAIK Ai.tbl and Diffucult.tbl were already merged since they were pretty much connected and inseperable.
What's your take on shiptypes.tbl in this regard?
Title: Re: shiptypes.tbl
Post by: WMCoolmon on December 19, 2005, 02:24:15 pm
Wanderer: Maybe, it depends on if there are differences between the ship types in the code. You can define as many new types as you like now. see feature description in the Wiki for my 'mission statement' on this.

TP: tehe. err, the AI probably has these toggles built in as depending on ship types, so again, yeah, that is a definite possibility.

Flaser: I think that shiptypes.tbl will not be moved, because it makes more sense to keep ship-type specific stuff in one spot. However as you can see I've tried to divide up some sections, so if at some point someone wants to add support for different AI behavior for a given ship type, they can by just changing the "$AI:" field.
Title: Re: shiptypes.tbl
Post by: Cobra on December 19, 2005, 02:51:05 pm
awesome! will this specify what weapons attack which type of ship? because during my free time, i was trying to update Omni's star trek tables, but i kept getting conflicts between the phaser duplicates (one for fighters and one for capships).
Title: Re: shiptypes.tbl
Post by: WMCoolmon on December 19, 2005, 03:01:04 pm
Assuming there is a difference between types, I will try to get to it. Has anyone tried the table yet though? At this point I am assuming everything's working fine.
Title: Re: shiptypes.tbl
Post by: Taristin on December 19, 2005, 03:12:33 pm
Meh. Every month a new table. This is getting more and more complicated and confusing for those of us who have stopped keeping track of all the new features (me).
Title: Re: shiptypes.tbl
Post by: Nuke on December 19, 2005, 05:24:46 pm
il test that animation eventually. with the christmas rush (Bah Humbug!!!), work, and the new g/f, it seems i have very little time/energy to test features and work on the mod.
Title: Re: shiptypes.tbl
Post by: WMCoolmon on December 19, 2005, 05:49:43 pm
Sorry, I wanted to put it in ships.tbl, but that would've got unwieldy.

Also, FRED can die in a ****ing fire.  :blah: Guess what I get to fix now.
Title: Update
Post by: WMCoolmon on December 19, 2005, 06:54:02 pm
FRED is pretty much fixed, there are three spots relating to briefing icons, freighters, and cargo that have me puzzled, which may force me to do some kind of icon.tbl.

I've updated the build and am taking a break from this for now.

There is a missing field in the included table, not too big a deal
Quote
$Name:         Fighter
$Counts for Alone:   YES
$On Hotkey List:   YES
$Target as Threat:   YES
$Show Attack Direction:   YES
$Scannable:      NO
$Warp Pushable:      YES
$Max Debris Speed:   200
$FF Multiplier:      1.0
$EMP Multiplier:   4.0
$Beams Easily Hit:   NO
$Fog:
   +Start dist:   10.0
   +Compl dist:   500.0
$AI:
   +Valid goals:      ("fly to ship" "attack ship" "waypoints" "waypoints once" "depart" "attack subsys" "attack wing" "guard ship" "disable ship" "disarm ship" "attack any" "ignore ship" "guard wing" "evade ship" "stay still" "play dead" "stay near ship" "keep safe dist" "attack besides")
   +Accept Player Orders:   YES
   +Player Orders:      ("attack ship" "disable ship" "disarm ship" "guard ship" "ignore ship" "form on wing" "cover me" "attack any" "depart" "disable subsys")
   +Auto attacks:      YES
   +Guards attack this:   YES
   +Turrets attack this:   YES
   +Can Form Wing:      YES

Counts for alone - Toggles whether the "No reinforcements are available" message will play even if this ship is present
Praise destruction - I forgot to put this in the default table, but it is in the code. (TODO: Add this) What it does is it toggles whether your wingmen will ever compliment you for killing this ship ("Beautiful kill, sir!")
On Hotkey list - ie the thingy that comes up if you press F3.
Target as threat - Not sure what this does :p It has something to do with you targetting stuff.
Show attack direction - Toggles whether little red arrows are shown on the HUD to point to this ship when it attacks you.
Scannable - Guess.
Warp pushes - Ship will push warp-pushable ships when it moves really fast (ie jumps in or out of subspace)
Warp pushable - Ship can be pushed by ships with "warp pushes" turned on
Max debris speed - Seems to only take effect in debug builds. Guess again. :p
FF multiplier - Multiplies damage received from friendly fire by this amount.
Beams easily hit - You'll notice that anti-fighter beams can remain constant if they're shooting at bigger ships (ie instead of 3 small shots). A "Yes" here turns on the long beam when a beam is fired at this ship type.

Accept player orders: Will the ship type accept orders from the player
Player orders: Yay, the first really useful field. Seems to toggle what orders the player can give to a ship type from the comm menu
Auto attacks: Toggles whether ship can go after nearby enemy ships
Guards attack this: Toggles whether ships that are guarding another ship will ever attack this ship type
Turrets attack this: Toggles whether turrets will attack this ship type
Can form wing: Mostly for FRED at this point, toggles whether ship can be in a wing.


Here's the list of player orders (stuff on the left, in quotation marks).
Code: [Select]
comm_order Comm_orders[] = {
{ "Attack ship", ATTACK_TARGET_ITEM },
{ "Disable ship", DISABLE_TARGET_ITEM },
{ "Disarm ship", DISARM_TARGET_ITEM },
{ "Attack subsys", DISABLE_SUBSYSTEM_ITEM },
{ "Guard ship", PROTECT_TARGET_ITEM },
{ "Ignore ship", IGNORE_TARGET_ITEM },
{ "Form on wing", FORMATION_ITEM },
{ "Guard me", COVER_ME_ITEM },
{ "Attack any", ENGAGE_ENEMY_ITEM },
{ "Dock", CAPTURE_TARGET_ITEM },
{ "Rearm me", REARM_REPAIR_ME_ITEM },
{ "Abort rearm", ABORT_REARM_REPAIR_ITEM },
{ "Depart", DEPART_ITEM },
//WMC - These don't appear for some reason
//support-ship-only
{ "stay near me", STAY_NEAR_ME_ITEM},
{ "stay near ship", STAY_NEAR_TARGET_ITEM},
{ "keep safe dist", KEEP_SAFE_DIST_ITEM},
//All ships
{ "Disable subsys", DISABLE_SUBSYSTEM_ITEM},
};

EDIT: I should also note that both builds are/were fully XMT-compliant. Use "*-stp.tbm" (seemed better than "*-sht.tbm" :p)
Title: Re: shiptypes.tbl
Post by: WMCoolmon on December 20, 2005, 04:23:52 am
Okay, TBP, eat your heart out.

http://fs2source.warpcore.org/exes/latest/shiptypes3.zip

This build fixes a few little errors (OpenGL being totally whacked, comm system screwed up, "H" and "F" keys broken) in the other build.


BIG FAT WARNING ALERT[/i][/u] - I made a slight change to the code. Basically when a capship is supposed to be attacking a small ship, its mode of behavior changes..somehow. Since I'm trying to get rid of these hardcoded defines, it'd be very nice if someone competent with FRED could test this eventually and tell me if this needs a workaround, if the broadside problem is ever fixed.
Title: Re: shiptypes.tbl
Post by: Col. Fishguts on December 20, 2005, 04:59:56 am
attempts broadside - specifies whether ship tries to broadside when attacking. However in testing I had an odd problem...ships always chase each other. I tried the build from the 18th, and ships would broadside, but for some reason they aren't in this build - even though I can confirm that the option is working in the code via debugger, and turning it on and off has different effects. This even happens when I remove the toggle and put the original one back in, so I'm guessing this is either broken in CVS (and not just my codebase) or one of the subsidiary functions used by the broadside function has been changed by my changes somewhere down the line.


Triv, are you reading this ?
Title: Re: shiptypes.tbl
Post by: Trivial Psychic on December 20, 2005, 05:22:24 am
An interesting feature, but there aren't THAT many TBP ships that attack with broadsides.  For ships like the Omega, sure its got alot of broadside weapons, but they're intended for fighter-defence rather tha cap-ship slug-fests.  Now, the opposite of this feature is something that's been a requested SCP feature for a couple of years.  Many have suggested a "big guns in front" flag, and it seems like a shiptypes.tbl option is the closest thing we'll come to that.

I'd comment further, but I've got to get to work.
Title: Re: shiptypes.tbl
Post by: Wanderer on December 20, 2005, 05:24:24 am
Ahemm, http://fs2source.warpcore.org/exes/latest/shiptypes3.zip might work better...
Title: Re: shiptypes.tbl
Post by: WMCoolmon on December 20, 2005, 05:34:05 am
Ahemm, http://fs2source.warpcore.org/exes/latest/shiptypes3.zip might work better...

Yay!! Somebody tried to download it!! :D

(Link fixed btw)
Title: Re: shiptypes.tbl
Post by: Spicious on December 20, 2005, 05:36:35 am
Are capital ship turrets shooting at anything for anyone with this build?
Title: Re: shiptypes.tbl
Post by: IPAndrews on December 20, 2005, 05:47:32 am
Yay!! Somebody tried to download it!! :D

I'm very interested in this too and I'll be giving it a go. Just a bit tied up at the moment. Incidentally I was wondering. By default most FS2 AI classes (cruiser etc...) try to broadside when they get close to an enemy. What does a fighter do? Just keep flying at it till collision avoidance code kicks in? Starts bombing runs? Slows to stop facing it?
Title: Re: shiptypes.tbl
Post by: MetalDestroyer on December 20, 2005, 05:52:42 am
Those AI, are they linked to FRED2 (initial order) or directly to Fs2 Open and FRED2 ?
And, could we see a new feature like the way Ships are jumping, instead of using a vortex like Fs2/Babylon 5, could we have some sort of Lightspeed Jump like XWA ??
Title: Re: shiptypes.tbl
Post by: karajorma on December 20, 2005, 07:08:34 am
The second half of that is completely off-topic here. Lets stick to the discussion at hand please.
Title: Re: shiptypes.tbl
Post by: Nuke on December 20, 2005, 06:35:22 pm
cant get far enough in game to test that afterburner trigger. says it cant find a model or something.
Title: Re: shiptypes.tbl
Post by: Trivial Psychic on December 22, 2005, 11:19:19 am
Are the fog distance entries the same as those you incorporated into the nebula.tbl in that test build you released some time back.  I assume that this makes said previous build obsoliete.
Title: Re: shiptypes.tbl
Post by: WMCoolmon on December 22, 2005, 03:23:12 pm
cant get far enough in game to test that afterburner trigger. says it cant find a model or something.

Was that the exact error message...?

Are the fog distance entries the same as those you incorporated into the nebula.tbl in that test build you released some time back.  I assume that this makes said previous build obsoliete.

Yes. :nod: That section is going to be removed from nebula.tbl.

Yay!! Somebody tried to download it!! :D

I'm very interested in this too and I'll be giving it a go. Just a bit tied up at the moment. Incidentally I was wondering. By default most FS2 AI classes (cruiser etc...) try to broadside when they get close to an enemy. What does a fighter do? Just keep flying at it till collision avoidance code kicks in? Starts bombing runs? Slows to stop facing it?

It seems to depend on the ship type, which is going to be very interesting to try and implement in table form. Basically it looks like if the ship is big, the AI starts trying to strafe it. Haven't really gotten into those functions yet though, so what exactly "strafe" means I'm not 100% sure.

Edit @ MetalDestroyer: I'm not sure. Part of the problem with FRED2 is that it uses a lot of arrays that are separate from fs2_open. I think valid orders will cause stuff that's only in that list to appear in initial orders, but some stuff in the list may just not be supported as an initial order.
Title: Re: shiptypes.tbl
Post by: WMCoolmon on December 22, 2005, 04:35:24 pm
Are capital ship turrets shooting at anything for anyone with this build?

OK, fixed this in next build. This also fixed the problem with always not trying to attempt a broadside. Most excellent. :nod: :yes:

Edit: This has nothing but bugfixes (I think), so here's another build (no shiptypes.tbl):

http://fs2source.warpcore.org/exes/latest/shiptypes4.zip
Title: Re: shiptypes.tbl
Post by: Nuke on December 22, 2005, 07:09:49 pm
cant get far enough in game to test that afterburner trigger. says it cant find a model or something.

Was that the exact error message...?


i think its more because my mod tables have gone to **** lately. im gonna redo them from scratch at some point.
Title: Re: shiptypes.tbl
Post by: WMCoolmon on December 22, 2005, 09:32:48 pm
Ahh, alright. :nod:
Title: Re: shiptypes.tbl
Post by: Nuke on December 22, 2005, 10:04:56 pm
i l give it another try once i clean the mod directory up abit.
this is what i get for playing around with every new feature that comes out :D
Title: Re: shiptypes.tbl
Post by: Axem on December 23, 2005, 09:18:30 am
I just tried out the afterburner trigger but nothing seemed to happen. :(

If higher powers let me, I should be able to get you a model for testing.
Title: Re: shiptypes.tbl
Post by: Nuke on December 23, 2005, 11:22:38 am
i tried to make it so one of the chimera's little missle flaps would open up when the burners were fred, i couldnt get past the fact that my mod hates new builds lately. ive spent an entire day fixing some stuff up to where i should be able to test your build. but im dead and i gotta work tomorrow (which is today btw) :D
Title: Re: Update
Post by: Trivial Psychic on December 23, 2005, 12:02:07 pm
$Target as Threat:   YES

Target as threat - Not sure what this does :p It has something to do with you targetting stuff.

Might this have to do with whether the hostile targetting feature will skip over this?  Cargo for example, may be hostile or friendly, but won't be selected if you use the hostile/friendly targetting.  Might this control this feature?  Would objects classified as "no" atomatically appear as "grey" on the HUD?

Are you gonna be able to incorporate a toggle for whether huge weapons will target a class?

If its possible to toggle flank attacks, is it possible to designate other vectors to attack with?  With FS2 ships for example, the Mulloch has the highest number of anti-cap beams on its ventral.  Actually, with the diversity of ships, this would be better to have as a ships table entry rather than a class entry, so forget it.
Title: Re: shiptypes.tbl
Post by: WMCoolmon on December 23, 2005, 03:15:45 pm
TP - that's exactly what it does, actually. I should probably reword that since it affects "F" too. I'm not sure about the grey though. I think I saw that in another section of the code and though about trying to work out a special radar color for certain objects.

Huge weapons:
Probably. I haven't really gone in to turret code yet, because in terms of turret targetting order I wanted to do something special - set it up so that you could specify a list of what turrets would attack and what precedence they'd give it.

The underlying goal, though, is to remove all default type distinctions from the code to make it as flexible as possible. Specific requests are handy tho.

Attack vector:
Not rly, at least not as easily as I can make types duplicate the behavior of other types.
Title: Re: shiptypes.tbl
Post by: Trivial Psychic on December 23, 2005, 03:26:54 pm
While we're on the subject of huge weapons, it might do well to add the ability to designate whether a class may or may not carry huge weapons.  For example, you can't put a "terran huge turret", or a sentry gun class, even though it is technically a sentry gun.  FS got around this by designating such ships as "cruisers" (RBC is one good example).

Also, what is the limit for the number of classes, and may any pre-existing classes be deleted, or will the code auto-generate them if they're not in the table?
Title: Re: shiptypes.tbl
Post by: WMCoolmon on December 23, 2005, 03:32:47 pm
Once I get shiptypes.tbl set up in the actual codebase, rather than as an external file, it'll be used with modular tables. However if you make a file called shiptypes.tbl, it'll override the default file.

There's no limit to ship types, if you want to delete a pre-existing type you'll have to replace the main shiptypes.tbl file. Right now because shiptypes.tbl is incomplete you'll probably get errors if you add a class (easily fixable, I'll make a mental note to do that later) however, you need to use one of the default types in order for it to function correctly. It's a little confusing but if you specify "cruiser" and then "gunship" (assuming you have a table with the gunship entry) then all hardcoded defaults will act like a cruiser, while the stuff moved to shiptypes.tbl will act like whatever the gunship entry says.

With the flags-error-fix update I'll reverse the precedence order because it makes more sense (ie "gunship" then "cruiser" will use gunship shiptypes.tbl values)
Title: Re: shiptypes.tbl
Post by: Nuke on December 24, 2005, 05:27:19 am
k, i cleaned up my mod so that it can run newer builds.
i get this:

Code: [Select]
Error: ships.tbl(line 157:
Error: Required token = [#End], [$Subsystem:] or [$Name], found [$animation=triggered].

File:\Documents and Settings\Administrator\My Documents\My Source Code\fs2_open\code\parse\parselo.cpp
Line: 591
[This filename points to the location of a file on the computer that built this executable]

Call stack:
------------------------------------------------------------------
------------------------------------------------------------------

so i assumed you changed the old $animation=triggered and $type="afterburner" to $animation: triggered and $type: "afterburner". making that change i ran it again and it got me into a mission. none the less the animation did not work. nor did any ot the other animations. also it seems "show ship" is broken, in this and the latest cvs build.

i also have a question of an unrelated, off topic nature. is the spiecies_defs.tbl has been made modular yet?
Title: Re: shiptypes.tbl
Post by: Roanoke on December 24, 2005, 05:32:33 am
I'm very interested in this too and I'll be giving it a go. Just a bit tied up at the moment. Incidentally I was wondering. By default most FS2 AI classes (cruiser etc...) try to broadside when they get close to an enemy. What does a fighter do? Just keep flying at it till collision avoidance code kicks in? Starts bombing runs? Slows to stop facing it?


I remember watching Whitestars with Bomber AI and they just appeared to surround Cap Ships and pummel it, moving position occassionaly. Isn't that why Subsystems have paths BTW ?
Title: Re: shiptypes.tbl
Post by: Nuke on December 24, 2005, 06:10:25 am
checking some more i find that none of the builds sence the 1st have working animations. might want to look into that.

*edit*
after further review ive dkiscovered that animations do indeed work under recent cvs builds, just not this one. it seems it has problems parsing the animation code.
Title: Re: shiptypes.tbl
Post by: Grug on December 28, 2005, 09:33:10 pm
  • attempts broadside - specifies whether ship tries to broadside when attacking. However in testing I had an odd problem...ships always chase each other. I tried the build from the 18th, and ships would broadside, but for some reason they aren't in this build - even though I can confirm that the option is working in the code via debugger, and turning it on and off has different effects. This even happens when I remove the toggle and put the original one back in, so I'm guessing this is either broken in CVS (and not just my codebase) or one of the subsidiary functions used by the broadside function has been changed by my changes somewhere down the line.

Something like this will be very handy for TAP.
Will this work on any ship, even fighters (ie. Homeworld corvettes) ?
Title: Re: shiptypes.tbl
Post by: WMCoolmon on December 28, 2005, 10:37:24 pm
Yup.

Nuke: Use ":" instead of "=", I made the swap in my local codebase,it'll be going in CVS once I get things finalized (Mostly I need to edit the default table, make it look all pretty in he code.)
Title: Re: shiptypes.tbl
Post by: Grug on December 29, 2005, 10:18:48 pm
Awsome. Thankee. :)

Is there any developments with being able to use and switch between playable turrets?
Title: Re: shiptypes.tbl
Post by: WMCoolmon on December 29, 2005, 11:42:07 pm
(http://www.orlyowl.com/nonotrly.gif)
Title: Re: shiptypes.tbl
Post by: Goober5000 on January 01, 2006, 11:58:55 pm
Awsome. Thankee. :)

Is there any developments with being able to use and switch between playable turrets?

Actually, I think I know how to do that. :) But it'll be a while before it's implemented.
Title: Re: shiptypes.tbl
Post by: MetalDestroyer on January 02, 2006, 01:19:52 am
Awsome. Thankee. :)

Is there any developments with being able to use and switch between playable turrets?

Actually, I think I know how to do that. :) But it'll be a while before it's implemented.

Great news ^^
Title: Re: shiptypes.tbl
Post by: Nuke on January 02, 2006, 02:03:58 am
if that afterburner animation was in the latest cvs build then it doesnt work.