Author Topic: Need code info regarding debris  (Read 4153 times)

0 Members and 1 Guest are viewing this topic.

Offline Starman01

  • 213
  • Mechwarrior
    • Wing Commander Saga
Need code info regarding debris
Hello old friends from the SCP-Team ! Starman is back, so start shaking in fear :D

Fun byside, I'm currently trying something out with Debris, but it would save me a lot of time if I first can have some insider information, also there may be some code improvements since my absence that I missed and that also could make the work easier.

So, here is what I need to know :

When a ships explore, the debris parts will be pushed away from the center of the explosion, most certainly through the "explosion blast" value from the ships.tbl, is that correct ?  So bigger blast means more speed ?

How are the hitpoints for the debris pieces calculated ?

Can these both values manipulated ? If not on purpose, maybe through a hack or something ?

What's the lifetime of the debrisparts  ?

When exactly are the debrisparts spawned ? AFAIK it's in the same second the ship blows up. If Explosion propagate, it could happen that the mainhull hasn't exploded yet, but the debris is already present, at least I think I saw that a few times. Can the spawning be delayed for 2 seconds ?

The reason for the question is, that I want to create debris parts, or better one huge debris part, that do NOT float away from the explosioncenter, and therefore will not be destroyed by the explosion blast (which already can happen)

Thanks in advance for the infos :)

Starman

MECHCOMMANDER OMNITECH

9 out of 10 voices in my head always tell me that I'm not insane. The 10th is only humming the melody of TETRIS.

 

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Re: Need code info regarding debris
There is already this entry in ships.tbl http://www.hard-light.net/wiki/index.php/Ships.tbl#.24Debris:

Default hitpoints per piece seem to be 1/8 of the parents hitpoints

Default lifetime is either 0.5 to 2.5 seconds (1/6) or then it wont expire at all (5/6 chance)

Do not meddle in the affairs of coders for they are soggy and hard to light

 

Offline Trivial Psychic

  • 212
  • Snoop Junkie
Re: Need code info regarding debris
Would you be trying to duplicate the effect from some Sci-Fi shows where a destroyed ship's hull will remain largely intact, though the ship will be useless?  An example of this would be B5 Season 3 "Severed Dreams" when B5 takes out the E.A.S. Roanoke.  I guess if you made a model with a largely-intact copy of the main LOD as a single-piece debris, then set the debris speed and rotation factors extremely low, with a long lifetime.

An improvement of this, would be to allow 2 different debris LODS, one with the single-piece hull, and another with the usual debris chunks.  It would probably require two different sets of debris entries in the table, so that chunks can be flying off at high speeds.  That way someone could blast away at the single piece debris and cause it to blow up into the multi-chunk debris with the usual behavior.  On top of that, it would be useful to have sexps to override the intact stage and go right to chunks.  Another option would be a weapon flag which causes any ship that it strikes to skip the single-piece stage, so sustained fire from pulse-guns would cause a ship to go to a single-piece, while a hit from a Vorlon main gun would blast the same ship apart.  Another useful addition (probably in AI definition table) would be to retain a single-piece debris as a target for hostiles, but at the extreme bottom end of the priority scale.  Furthermore, have the ability for the debris of a ship to be called in a sexp, so a ship hulk could be targeted for destruction by enemy guns, as ordered by the FREDder via sexp.
The Trivial Psychic Strikes Again!

 

Offline Tolwyn

  • The Admiral
  • Administrator
  • 214
  • Ridiculously Old Fraud
    • Wing Commander Saga
Re: Need code info regarding debris
Would you be trying to duplicate the effect from some Sci-Fi shows where a destroyed ship's hull will remain largely intact, though the ship will be useless? 

Wing Commander Saga: A Legend Is Reborn | WingCenter
 
Tolwyn’s reputation for risk taking with other people’s lives was considered  to understate the facts. The admiral’s willingness to sacrifice anyone or anything to achieve his objectives had long been lauded in the popular press. He was “the man who got things done”.- Colonel Blair

No errors, no random CTDs, just pure fun and proof of why getting hit with missiles is a bad thing.
-WC Saga's beta tester


Report Wing Commander Saga bugs with Mantis

 

Offline Starman01

  • 213
  • Mechwarrior
    • Wing Commander Saga
Re: Need code info regarding debris
Well, I'm not fully sure which episode that is (even if I have all seasons on DVD, but I can't recall the vessel name right now).

However, my idea/wish is to make capship explosion again how they were in WC3/4. In other words,  I first want the explosion to propagate like in FS, then comes the usual blast, and with the blast a bright flash on the screen. After that, there is one large burnout debris with probably 30% to 50% of the orginal ships hull size (but completly burned out, so not much left from the original textures). Maybe if possible, a few small ones too floating away.

I've read something about the speed thing, and wanderer also confirmed above. But the problem I see (and we had in earlier tests) is that the explosion blast usually kills the debris because it's quite close to the explosion center. Disabling the blast if of course also no solution, because then the player will no longer be affected by the blast

As for the flash, since there isn't anything in the engine maybe it can be done with Scrips (wanderer made one AFAIK), but I have Idea how to use that and how much work is involved to make it used ingame, since we have often quite a number of capships in the missions.

(edit) See tolwyns picture :) As usually was faster than me
MECHCOMMANDER OMNITECH

9 out of 10 voices in my head always tell me that I'm not insane. The 10th is only humming the melody of TETRIS.

  

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Need code info regarding debris
You guys are basically talking about hulks.  Cool concept, although only really good for capital ships.  Would be cool have a few wrecks of larger ships floating around in the mission though.  One that comes to mind in particular was the Orion used in Transcend (I think).  Some wrecks like that in a mission could be cool, although adding that debris to existing missions could be dangerous as it could be run through by existing warp ins.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline Starman01

  • 213
  • Mechwarrior
    • Wing Commander Saga
Re: Need code info regarding debris
although adding that debris to existing missions could be dangerous as it could be run through by existing warp ins.

Yeah, it's for caps only. Not sure what exactly you mean with that comment though . Could you please rephrase or explain a little ?
MECHCOMMANDER OMNITECH

9 out of 10 voices in my head always tell me that I'm not insane. The 10th is only humming the melody of TETRIS.

 

Offline Sushi

  • Art Critic
  • 211
Re: Need code info regarding debris
Just an idea, although it relies heavily on FREDders so isn't very general:

1. Get a separate "hulk" ship object/model.
2. Remove all debris from the original ship model.
3. When the ship explodes, use SEXPs to spawn a hulk model at the point of its death. You may need to make it temporarily invulnerable for the duration of the explosion.

Of course, just making it supported in code would be easier to use. :D

 

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Re: Need code info regarding debris
Well.. i was thinking adding ship flag for generating 'permanent debris' as well as making it possible to define hitpoints for the debris pieces.. downside is that it would only work well with ships that have specially made hulk style debris pieces.
Do not meddle in the affairs of coders for they are soggy and hard to light

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Need code info regarding debris
This sounds like a job for...GEOMOD
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline Starman01

  • 213
  • Mechwarrior
    • Wing Commander Saga
Re: Need code info regarding debris
Who is this guy and when will he be finished with my debris then ? :D
MECHCOMMANDER OMNITECH

9 out of 10 voices in my head always tell me that I'm not insane. The 10th is only humming the melody of TETRIS.

 

Offline Trivial Psychic

  • 212
  • Snoop Junkie
Re: Need code info regarding debris
Well.. i was thinking adding ship flag for generating 'permanent debris' as well as making it possible to define hitpoints for the debris pieces.. downside is that it would only work well with ships that have specially made hulk style debris pieces.
As you've pointed out, that would require models to be made with a single-piece hulk as the debris LOD.  My idea would be to upgrade the model handling to be able to have a 2-stage debris LOD system, so stage 1 is the hulk and stage 2 is the chunks.  You're gonna need to change the models anyway to make hulk debris, so you might as well give the whole thing an upgrade.
The Trivial Psychic Strikes Again!

 

Offline Starman01

  • 213
  • Mechwarrior
    • Wing Commander Saga
Re: Need code info regarding debris
Well, in our case we would of course need to change models, but adding a single debris part shouldn't be that much. Some models need correction anyway, and if we are already at it....
MECHCOMMANDER OMNITECH

9 out of 10 voices in my head always tell me that I'm not insane. The 10th is only humming the melody of TETRIS.

 

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Re: Need code info regarding debris
Well.. i was thinking adding ship flag for generating 'permanent debris' as well as making it possible to define hitpoints for the debris pieces.. downside is that it would only work well with ships that have specially made hulk style debris pieces.
As you've pointed out, that would require models to be made with a single-piece hulk as the debris LOD.  My idea would be to upgrade the model handling to be able to have a 2-stage debris LOD system, so stage 1 is the hulk and stage 2 is the chunks.  You're gonna need to change the models anyway to make hulk debris, so you might as well give the whole thing an upgrade.
Well... all the debris pieces are ATM just tossed into a single lot.. Making a system like you describe would be considerably larger project than what i had in mind
Do not meddle in the affairs of coders for they are soggy and hard to light

 

Offline Tolwyn

  • The Admiral
  • Administrator
  • 214
  • Ridiculously Old Fraud
    • Wing Commander Saga
Re: Need code info regarding debris
I agree. Sometimes the simplest solution is the best. ;)
Wing Commander Saga: A Legend Is Reborn | WingCenter
 
Tolwyn’s reputation for risk taking with other people’s lives was considered  to understate the facts. The admiral’s willingness to sacrifice anyone or anything to achieve his objectives had long been lauded in the popular press. He was “the man who got things done”.- Colonel Blair

No errors, no random CTDs, just pure fun and proof of why getting hit with missiles is a bad thing.
-WC Saga's beta tester


Report Wing Commander Saga bugs with Mantis

 

Offline Starman01

  • 213
  • Mechwarrior
    • Wing Commander Saga
Re: Need code info regarding debris
Well, if you make the animated debrismap we talked about, I agree and we stick with the old debris version (those are at least much more faster to be build :) )
MECHCOMMANDER OMNITECH

9 out of 10 voices in my head always tell me that I'm not insane. The 10th is only humming the melody of TETRIS.

 

Offline Tolwyn

  • The Admiral
  • Administrator
  • 214
  • Ridiculously Old Fraud
    • Wing Commander Saga
Re: Need code info regarding debris
Well, if you make the animated debrismap we talked about, I agree and we stick with the old debris version (those are at least much more faster to be build :) )

*cough* if you mean low poly blocks we used in the prologue, then the answer is no. ;)

Actually I was refering to Wanderer's suggestion regarding small alterations to the debris system.
Wing Commander Saga: A Legend Is Reborn | WingCenter
 
Tolwyn’s reputation for risk taking with other people’s lives was considered  to understate the facts. The admiral’s willingness to sacrifice anyone or anything to achieve his objectives had long been lauded in the popular press. He was “the man who got things done”.- Colonel Blair

No errors, no random CTDs, just pure fun and proof of why getting hit with missiles is a bad thing.
-WC Saga's beta tester


Report Wing Commander Saga bugs with Mantis

 

Offline Starman01

  • 213
  • Mechwarrior
    • Wing Commander Saga
Re: Need code info regarding debris
I could also build more detailed debris models, but not before I get that map  ;)
MECHCOMMANDER OMNITECH

9 out of 10 voices in my head always tell me that I'm not insane. The 10th is only humming the melody of TETRIS.

 

Offline Starman01

  • 213
  • Mechwarrior
    • Wing Commander Saga
Re: Need code info regarding debris
:bump:

Since my problem/question isn't fully solved, I need to bring this up again :)

Well.. i was thinking adding ship flag for generating 'permanent debris' as well as making it possible to define hitpoints for the debris pieces.. downside is that it would only work well with ships that have specially made hulk style debris pieces.

@wanderer : Is this just planed or already WIP ? Since there is already a "lifetime timer" for the debris in the ships.tbl, all we need is a way to either set the hitpoints of a debris, or make it invulnerable from the start. The latter would be sufficient too, and maybe (just maybe, since I'm no coder :) ) less work then adding a variable to the game engine and ships.tbl

Though the idea of invulnerable debris should maybe be activated in the launcher or somewhere else, since It could be not so suitable for real Freespace mods
MECHCOMMANDER OMNITECH

9 out of 10 voices in my head always tell me that I'm not insane. The 10th is only humming the melody of TETRIS.

 

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Re: Need code info regarding debris
I already had code ready for setting debris hitpoints but decided against commited it as new and a lot more massive requests on the debris system were posted. I'll start working on it again.
Do not meddle in the affairs of coders for they are soggy and hard to light