Author Topic: Neat things I've coded in my own tree.  (Read 14502 times)

0 Members and 1 Guest are viewing this topic.

Neat things I've coded in my own tree.
Quote
Originally posted by Flipside
I'm inclined to agree about the CapShip thing. On one hand, once you have taken out all the Subsystems, a Capship is out of your frame of reference anyway, it is no longer a threat. On the other, it takes the joy of seeing big ships on your scoreboard (except of course, when you are flying a bomber, which is designed to take down a capship) :(


Yes, and that's why you fly bombers to take down capships. Of course, you could also cheese them to death with Trebuchets...

Quote
All in all, even in modern warfare, the tales of a fighter not carrying an anti-shipping missile taking out something the size of a Destroyer ( roughly equivalent to a Freespace Cruiser ), are few and far between.


That's because those fighters carry a few bombs. Sort of like a Myrmidon being able to carry a Cyclops or two. (Incidentally, in the Volition FS2 tables, the Myrmidon was able to carry the Helios! Probably doesn't have the payload capacity, though.) In FreeSpace, warheads with sufficient yield to hurt capships (ie, nuclear or antimatter warheads) are far too large for fighters to carry. Contemporary fighters can't carry warheads that size, either. Ever seen an F-117 dropping a Hiroshima sized nuke? Didn't think so.

There are backpack nukes, so called because they are small nukes that fit in a backpack or briefcase sized container, which an F-117 can obviously drop without breaking a sweat. However, these are very low yield (the radiation from them is nasty, but FreeSpace ships are unaffected by it), so a proportionately sized FreeSpace missile probably wouldn't pack enough punch to do serious damage to a big ship. Remember, FreeSpace capital ships are extremely tough -- they can take several antimatter warheads, and shrug off asteroid collisions.

New feature: Subsystem display names

This enables modders to control the name of a subsystem as displayed in the target view on the HUD. There are two versions of this: one specified in the ships table, and one specified in the weapons table.

The ship one is "$Display Name:" on a subsystem, immediately after the line with the name, hitpoints, and rot speed. Example:

Code: [Select]
$Subsystem: foo, 1, 1
$Display Name: "foo launcher"
...


The weapons one is "$Turret Display Name:" right after the weapon range. Example:

Code: [Select]
+Weapon Range: 1500
$Turret Display Name: "foo launcher"
...


In each case, this will set what is displayed in the HUD targeting box for the subsystem name, when the player targets that subsystem. For the weapon "Turret Display Name", it is what will show up when that weapon is the first weapon mounted on a turret. Note that the display name on the subsystem overrides the display name on the weapon, if both are present.
« Last Edit: September 03, 2003, 03:32:15 pm by 561 »

 

Offline Flipside

  • əp!sd!l£
  • 212
Neat things I've coded in my own tree.
Hmmmmm... now THAT could be handy!

Oh and I already knew that stuff, I was agreeing with you :D

Flipside :D

 

Offline Galemp

  • Actual father of Samus
  • 212
  • Ask me about GORT!
    • Steam
    • User page on the FreeSpace Wiki
Neat things I've coded in my own tree.
Quote
Originally posted by _argv[-1]
New feature: Subsystem display names


This is actually already implemented in the POF. Open up a POF in an editor, and you'll notice it's subsystems each have a display name. Here's the example Properties entry for a rotating radar dish submodel, named radar01a:

Code: [Select]
$special=subsystem
$name=Radar Dish
$rotate=10


Now, if I make the table reference the radar01a submodel, targeting it in game will reveal the name Radar Dish.

The exception is in turrets, where the subsystem name changes according to what weapon is mounted on it. You can specify the name Gun Turret or Huge Turret or whatever, but depending on the weapon it will be forced to Beam Turret or Flak Turret or Laser Turret, etc.
"Anyone can do any amount of work, provided it isn't the work he's supposed to be doing at that moment." -- Robert Benchley

Members I've personally met: RedStreblo, Goober5000, Sandwich, Splinter, Su-tehp, Hippo, CP5670, Terran Emperor, Karajorma, Dekker, McCall, Admiral Wolf, mxlm, RedSniper, Stealth, Black Wolf...

 

Offline TopAce

  • Stalwart contributor
  • 212
  • FREDder, FSWiki editor, and tester
Neat things I've coded in my own tree.
GE is right(as always), but making double table entry for a ship is easier to redouble the pof just to give another name for the subsystem, and is easier to handle.

It also saves the free space of your winchester.
My community contributions - Get my campaigns from here.

I already announced my retirement twice, yet here I am. If I bring up that topic again, don't believe a word.

 
Neat things I've coded in my own tree.
_argv's changes look pretty good to me.  FreeSpace has been needing an accurate energy system for some time.  As for turret line-of-fire checking, you could use one of DirectX's mesh functions, D3DXIntersectTri.  It takes five pointers to D3DXVECTOR3 structs: three corners of a polygon, the shot origin, and the shot direction.  It takes three pointers to FLOATs, which will contain the u and v barycentric coordinates and the distance from the origin of the intersection if it determines that the line intersects the triangle.  The function's return is a simple boolean value.  It's not particularly efficient (you'd have to cycle through all the triangles in the turret's cone of fire) and I dunno if DX8 included this function, but it's one way of determining if a turret has clear LoS.  It'd be easier if you were using the D3DX Mesh extensions, coz then you could use D3DXIntersect which cycles through all the mesh faces for you.

I've implemented a few of _argv's FS improvements in my own game engine from the word 'Go', because they seemed somewhat obvious if I'm going for extreme physics realism.  The damage system I'm using is simple though, and doesn't prevent little weapons from hurting capital ships because my game is based around space tech in the near future.  What would a 20mm cannon do to a Space Shuttle?  NASTY...

What would a 20mm cannon do to a heavily-armoured space-faring equivalent of a modern Destroyer?  Not a great deal, but it would certainly hurt if it kept shooting for long enough.

The shield systems I'm using are singular shields, mainly because the ship-mod code takes up quite enough processing time already (what with all the accurate collision-detection and positioning) and hence I don't want to make things even worse by calculating exactly which part of a ship's shields got hit.  Singular shields simplifies the FX stack, too.  Instead, when a ship's shields are struck, they glow slightly.  Normally, shields are visible as a specular reflection on a semitransparent globe around the ship.

Shields?  In a near-future game?  Yep.  They're developed by the American forces first, and they only deflect energy weapons.  Plasma 'ghosts' through them, dealing full damage to hull but depleting the shields too (VERY deadly weapon, the Plasma Accelerator Coil, aka PAC).  Mass weapons ignore shields entirely.  Missiles with RADAR-based tracking systems have a small amount of trouble locking on through shields.


If I EVER get my engine finished, I'll modify it for FreeSpace use.  Same HUD, same (or better) AI, same ships, same shield hit effect types.  But it'll be DX9-compliant, and I'll sure as hell figure out vertex and pixel shaders...
'And anyway, I agree - no sig images means more post, less pictures. It's annoying to sit through 40 different sigs telling about how cool, deadly, or assassin like a person is.' --Unknown Target

"You know what they say about the simplest solution."
"Bill Gates avoids it at every possible opportunity?"
-- Nuke and Colonol Drekker

 
Neat things I've coded in my own tree.
Quote
Originally posted by GalacticEmperor


This is actually already implemented in the POF. Open up a POF in an editor, and you'll notice it's subsystems each have a display name. Here's the example Properties entry for a rotating radar dish submodel, named radar01a:

Code: [Select]
$special=subsystem
$name=Radar Dish
$rotate=10


Now, if I make the table reference the radar01a submodel, targeting it in game will reveal the name Radar Dish.

The exception is in turrets, where the subsystem name changes according to what weapon is mounted on it. You can specify the name Gun Turret or Huge Turret or whatever, but depending on the weapon it will be forced to Beam Turret or Flak Turret or Laser Turret, etc. [/B]


Well, I originally did this because I wanted to be able to get around this issue with turrets getting forced to 'beam turret' or whatnot, but I figured I'd make it generic so you can override the subsys name in the POF. Besides, editing POFs and distributing modified versions with one's mod is not necessarily a good idea -- it adds to the mod's size a lot more than a line in a table.

Quote
Originally posted by Descenterace
_argv's changes look pretty good to me.  FreeSpace has been needing an accurate energy system for some time.  As for turret line-of-fire checking, you could use one of DirectX's mesh functions, D3DXIntersectTri.  It takes five pointers to D3DXVECTOR3 structs: three corners of a polygon, the shot origin, and the shot direction.  It takes three pointers to FLOATs, which will contain the u and v barycentric coordinates and the distance from the origin of the intersection if it determines that the line intersects the triangle.  The function's return is a simple boolean value.  It's not particularly efficient (you'd have to cycle through all the triangles in the turret's cone of fire) and I dunno if DX8 included this function, but it's one way of determining if a turret has clear LoS.  It'd be easier if you were using the D3DX Mesh extensions, coz then you could use D3DXIntersect which cycles through all the mesh faces for you.


FreeSpace has its own collision detection routines, which are poly-accurate and deal with such things as shields and submodels. They are also fairly fast (obviously, since they get called 16 million times per frame).

Quote
I've implemented a few of _argv's FS improvements in my own game engine from the word 'Go', because they seemed somewhat obvious if I'm going for extreme physics realism.  The damage system I'm using is simple though, and doesn't prevent little weapons from hurting capital ships because my game is based around space tech in the near future.  What would a 20mm cannon do to a Space Shuttle?  NASTY...


That's gotta hurt.

Quote
What would a 20mm cannon do to a heavily-armoured space-faring equivalent of a modern Destroyer?  Not a great deal, but it would certainly hurt if it kept shooting for long enough.


That was the way it worked in FreeSpace 1 (or FS2 with "big damage" flags removed). There's a slight problem here. Ever try firing 9mm bullets at a heavy tank? If you have, you will notice that they don't even scratch it, even if you fire a lot of rounds at it. The armor is so strong that it isn't really affected at all by your weak gunfire. In FS2, the same applies to Subach HL-7s and SD Ravana armor.

Quote
The shield systems I'm using are singular shields, mainly because the ship-mod code takes up quite enough processing time already (what with all the accurate collision-detection and positioning) and hence I don't want to make things even worse by calculating exactly which part of a ship's shields got hit.  Singular shields simplifies the FX stack, too.  Instead, when a ship's shields are struck, they glow slightly.  Normally, shields are visible as a specular reflection on a semitransparent globe around the ship.


In FreeSpace, shields are a mesh surrounding the ship, and are part of the ship model. When they are hit, part of this mesh is lit up. Singular shields doesn't change much with regards to processing time -- but it does change much with regards to brain processing time!

Quote
Shields?  In a near-future game?  Yep.  They're developed by the American forces first, and they only deflect energy weapons.  Plasma 'ghosts' through them, dealing full damage to hull but depleting the shields too (VERY deadly weapon, the Plasma Accelerator Coil, aka PAC).  Mass weapons ignore shields entirely.  Missiles with RADAR-based tracking systems have a small amount of trouble locking on through shields.


Shields deflecting energy weapons? I would think that a near-future shield system would be a strong electromagnetic field, so matter weapons would be most easily deflected, followed by plasma, and ending with laser weapons which are the hardest for it to deflect (since photons move very fast, so there is less time for the field to push them away). This field might disrupt radar (by deflecting the radar pings), but I don't know.

Quote
If I EVER get my engine finished, I'll modify it for FreeSpace use.  Same HUD, same (or better) AI, same ships, same shield hit effect types.  But it'll be DX9-compliant, and I'll sure as hell figure out vertex and pixel shaders...


Oo, shaders in FreeSpace. Joy. Merge that into fs2_open, would you? ;7
« Last Edit: September 03, 2003, 03:32:45 pm by 561 »

 

Offline Flaser

  • 210
  • man/fish warsie
Neat things I've coded in my own tree.
Quote
Originally posted by _argv[-1]

That was the way it worked in FreeSpace 1 (or FS2 with "big damage" flags removed). There's a slight problem here. Ever try firing 9mm bullets at a heavy tank? If you have, you will notice that they don't even scratch it, even if you fire a lot of rounds at it. The armor is so strong that it isn't really affected at all by your weak gunfire. In FS2, the same applies to Subach HL-7s and SD Ravana armor.


That's why I proposed the treshold/resistance system!
BTW sorry, for my late reply to your post...

I know Freespace does take armor into account - but IIRC only in the form of hitpoints.

FS solves the 9mm - tank problem through flags.
However it could get too complicated IMHO.

A Subach shouldn't have a chance against a modern Hecata, but it should just scratch an Orion.

The two factor I'm speaking of would allow a ship to have a unique resistance to weapons.

So you don't need any flags, all you need is two factors to be added to each ship - this could be stored in armors.tbl.

The treshold allows the ship to disregard weapons that can't even scratch it, the other factor - resistance on the other hand, would also help to show how hard the armor plating is.

So instead damaging it the same as a cruiser a destroyer could take a lot less damage, since a certain percentage of the damage would be taken away by the armor.

You can further complicate things by giving each weapon a penetration factor - this factor would be given to their damage when determining treshold; so you could have a low yield, high speed railgun, that DOES penetrate a destroyer armor, but can't do any significan't damage.

That way we could handle even subsystem damage with the same damage model, except that anti-sub guns would be given a high penetration.
"I was going to become a speed dealer. If one stupid fairytale turns out to be total nonsense, what does the young man do? If you answered, “Wake up and face reality,” you don’t remember what it was like being a young man. You just go to the next entry in the catalogue of lies you can use to destroy your life." - John Dolan

 
Neat things I've coded in my own tree.
The Destroyer I was referring to is the one in my game.  My ships will look a bit like modern space stations, but better armoured (and armed).  If you shoot the right parts, you can make them break apart...

A 20mm cannon wouldn't scratch a FreeSpace cruiser, but FS ships are far tougher than those in my game.
'And anyway, I agree - no sig images means more post, less pictures. It's annoying to sit through 40 different sigs telling about how cool, deadly, or assassin like a person is.' --Unknown Target

"You know what they say about the simplest solution."
"Bill Gates avoids it at every possible opportunity?"
-- Nuke and Colonol Drekker

 
Neat things I've coded in my own tree.
Quote
Originally posted by Flaser


That's why I proposed the treshold/resistance system!
BTW sorry, for my late reply to your post...

I know Freespace does take armor into account - but IIRC only in the form of hitpoints.

FS solves the 9mm - tank problem through flags.
However it could get too complicated IMHO.

A Subach shouldn't have a chance against a modern Hecata, but it should just scratch an Orion.

The two factor I'm speaking of would allow a ship to have a unique resistance to weapons.

So you don't need any flags, all you need is two factors to be added to each ship - this could be stored in armors.tbl.

The treshold allows the ship to disregard weapons that can't even scratch it, the other factor - resistance on the other hand, would also help to show how hard the armor plating is.

So instead damaging it the same as a cruiser a destroyer could take a lot less damage, since a certain percentage of the damage would be taken away by the armor.

You can further complicate things by giving each weapon a penetration factor - this factor would be given to their damage when determining treshold; so you could have a low yield, high speed railgun, that DOES penetrate a destroyer armor, but can't do any significan't damage.

That way we could handle even subsystem damage with the same damage model, except that anti-sub guns would be given a high penetration.


OH. You want to specify the toughness of a ship's armor, and the armor-penetration ability of various weapons. That way, cruisers would shrug off ML-16s just like Hecates shrug off HL-7s, but maybe corvettes would take damage from the Maxim. And yes, I can see subsystem damage being applied in the same way, although turrets would have to be exempt, since they are obviously not protected by armor anywhere near as tough as the main ship's. Anyway, we don't need a new table, just specify toughness in ships.tbl and penetration in weapons.tbl. (toughness - penetration) would specify a damage scale -- if penetration is, say, 75% of toughness, then it'll start to scratch the ship, and if it's 100% or more, then it'll do full damage.

Sound good?

Quote
Originally posted by Descenterace
The Destroyer I was referring to is the one in my game.  My ships will look a bit like modern space stations, but better armoured (and armed).  If you shoot the right parts, you can make them break apart...

A 20mm cannon wouldn't scratch a FreeSpace cruiser, but FS ships are far tougher than those in my game.


Not only are they tougher, they also do not have weak points like that. You can't shoot a Hecate in just the right spot and have it blow up, because there is no such right spot.

New changes!

  • The rate of fire penalty for linked primaries may be disabled with a #define (or -D option to the compiler) "FS2_NO_LINKED_ROF_PENALTY".
  • Friendly beam fire may be enabled with the #define "FS2_ALLOW_FRIENDLY_BEAM_FIRE". Again, you can use -D to the compiler.
  • Singular shields are now optional. Use the ship flag "singular shields" to enable this feature for individual ships, or the command line option "-singular-shields" to enable it for all of them.
  • The weapon flag "use energy on turret" causes that weapon to consume the ship's weapon energy, even when it is mounted on a turret. Applies to beam weapons also (but in separate code).
  • The weapon flag "drain big ships" causes esuck weapons to apply a power drain to BIG|HUGE ships. This is needed because in normal FS2, such ships have tiny power output (0.1 is typical), so you'd be able to disable the Colossus with a Lamprey. Not good.
  • Fighter beams do not whack, but all others do. I'd rather use Mass, but I'm lazy, and that's complicated!


I think that's it for incompatible and controversial changes. When warpcore is back up I'll still check that there aren't any other changes I didn't notice.
« Last Edit: September 03, 2003, 03:35:00 pm by 561 »

 

Offline Taristin

  • Snipes
  • 213
  • BlueScalie
    • Skelkwank Shipyards
Neat things I've coded in my own tree.
Quote
Originally posted by _argv[-1]
New changes!

  • The weapon flag "drain big ships" causes esuck weapons to apply a power drain to BIG|HUGE ships. This is needed because in normal FS2, such ships have tiny power output (0.1 is typical), so you'd be able to disable the Colossus with a Lamprey. Not good.
[/B]

:lol:

*runs off to suck the power from the Sathanas in my Crimion*
Freelance Modeler | Amateur Artist

 
Neat things I've coded in my own tree.
Quote
Originally posted by Raa Tor'h
"Chapter 3: Explosions
In which the Plot is so Secret, even we do not know exactly what happens yet. But we know that there will be many Explosions. " - The Terran-Vasudan War Project Website

:lol:

This sounds like a description of a Hollywood action film.

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Neat things I've coded in my own tree.
Quote
Originally posted by _argv[-1]
  • Fighter beams do not whack, but all others do. I'd rather use Mass, but I'm lazy, and that's complicated!
  • [/b]


This should be optional too.  Some people prefer the whack.

 

Offline Taristin

  • Snipes
  • 213
  • BlueScalie
    • Skelkwank Shipyards
Neat things I've coded in my own tree.
Quote
Originally posted by _argv[-1]


:lol:

This sounds like a description of a Hollywood action film.


Pleh, I can't even read my siggy any more...

look:






Quote
Originally posted by Goober5000


This should be optional too.  Some people prefer the whack.


Yes, I rather enjoy being smacked about by AAAf...
Freelance Modeler | Amateur Artist

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Neat things I've coded in my own tree.
Same with beams not piercing shields. ;) Compatibility, I guess.

 
Neat things I've coded in my own tree.
Oh yeah. I forgot to mention that I also hacked the whack :ha: so that non-type-C (fighter) beams will whack proportionately to damage inflicted. That means whacking from AAA is as it's always been, and whacking from huge beams will send you for... a spin. :shaking:

 

Offline TrashMan

  • T-tower Avenger. srsly.
  • 213
  • God-Emperor of your kind!
    • Minecraft
    • FLAMES OF WAR
Neat things I've coded in my own tree.
GREAT STUFF!

I don't like the interchangable beams tough - they sould either be slash or normal, not a little of both.
Nobody dies as a virgin - the life ****s us all!

You're a wrongularity from which no right can escape!

 

Offline Taristin

  • Snipes
  • 213
  • BlueScalie
    • Skelkwank Shipyards
Neat things I've coded in my own tree.
Quote
Originally posted by _argv[-1]
That means whacking from AAA is as it's always been, and whacking from huge beams will send you for... a spin. :shaking:


If your hit with a bigger beam, you usually die anyway...

But it would be nice to see a ship like the Orion get 15 degrees when hit like in the intro...
Freelance Modeler | Amateur Artist

 
Neat things I've coded in my own tree.
Quote
Originally posted by Lightspeed


thats what makes it fair. Either you have high firepower, or you can only mount one weapon. Ulysses can use Morn / Kayser or any other combos whereas thoth is limited to _one_ weapon.

It's meant to be like that, and changing it would unbalance FS2 a lot.


You know, I just had a thought -- remove the penalty only if all of the ship's primary banks mount the same weapon. That way it's fair, and should make you happy, even though I still think the penalty is dumb.

Quote
Originally posted by Raa Tor'h
If your hit with a bigger beam, you usually die anyway...


You'd be surprised.

Quote
But it would be nice to see a ship like the Orion get 15 degrees when hit like in the intro...


I think you'd have to alter the Orion's physics details for that to work.

Quote
Originally posted by TrashMan
I don't like the interchangable beams tough - they sould either be slash or normal, not a little of both.


Then don't enable it. (It's optional now, specified in a weapon flag.)
« Last Edit: September 03, 2003, 03:35:49 pm by 561 »

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
Neat things I've coded in my own tree.
you know that swiching beam thig would probly best be implemented with a new beam type, rather than modifying two existing ones
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 KARMA

  • Darth Hutt
  • 211
    • http://members.fortunecity.com/aranbanjo
Re: Neat things I've coded in my own tree.
Quote
Originally posted by _argv[-1]
Surface Shields
Most ships other than fighters and bombers do not have shield meshes. With surface shields, they can have shields anyway -- weapons fire that strikes the hull drains the shields until they are depleted, just like with normal shields. You can put surface shields on a ship of any size or type. An obvious application of this is the Lucifer in FS1, where surface shields were crudely emulated by making the ship invulnerable. To enable surface shields, just give a non-zero shield amount in the ships.tbl entry; if the ship does not have a shield mesh, then surface shields will be used instead. (Shielded Sathanas anyone?)

[/list] [/B]


ok, I arrived at this point reading the first post then I started dacing naked in the house;7 :drevil: :drevil:

wonderful, really wonderful
how does it work exactly? it's the shield ani rendered over the hull or whatever?
edit-> I've read further, there is no visual effect, but only the buzz sound
well, it still will be good for the moment:)
« Last Edit: September 01, 2003, 05:15:51 am by 433 »