Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Starman01 on July 14, 2009, 03:02:40 am
-
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
-
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)
-
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.
-
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?
(http://wcsaga.hard-light.net/team/KeldorKatarn/wreck.png)
-
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
-
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.
-
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 ?
-
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
-
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.
-
This sounds like a job for...GEOMOD
-
Who is this guy and when will he be finished with my debris then ? :D
-
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, 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....
-
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
-
I agree. Sometimes the simplest solution is the best. ;)
-
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 :) )
-
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.
-
I could also build more detailed debris models, but not before I get that map ;)
-
: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
-
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.
-
That would be great, thanks a lot man. :) If you need help testing it contact me :)