Author Topic: Conditions For Ship Debris (Or Lack Thereof)  (Read 5810 times)

0 Members and 1 Guest are viewing this topic.

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Conditions For Ship Debris (Or Lack Thereof)
So, I've been working with Admiral MS on his fantastic shipsave script to iron out some bugs. One thing that stands out is how the script destroys ships if necessary. The script will move the ship far away and use self-destruct (which we might change to ship-vaporize).

However, in cases like this we were thinking how it would be helpful to have a way to tell FSO when to not create debris or debris shards at all. Because this script has the potential to do a lot of things all at once, we are trying to minimize the amount of work FSO has to to during that time. (We use ship-vanish if the ship doesn't need to register as destroyed or departed.)

I was talking with Goober and a few ideas came out that I thought were worth discussing. What are the thoughts on...

1: Doing a distance check and if the destroyed ship is so far from the player/camera to not create the debris?

2: Adding an optional flag to self-destruct (or ship-vaporize) to not create debris or debris shards?
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Conditions For Ship Debris (Or Lack Thereof)
I like the second idea more. Even far-off debris may have an impact on the battlefield; Sathanases that have been blown up should register.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline Dragon

  • Citation needed
  • 212
  • The sky is the limit.
Re: Conditions For Ship Debris (Or Lack Thereof)
I also like the second idea. It could also be used whenever there's a story or balance related reason for ship not leaving debris. In general, it seems both very practical and a better solution performance-wise.

 
Re: Conditions For Ship Debris (Or Lack Thereof)
Doesn't the "vaporize on death" (or something) flag already kinda do that? IIRC, it makes the ship just disappear on destruction, no explosions or debris. So basically, you'd just have the script set the 'vaporize on death' flag on (not sure if that's possible mid-mission?) and then selfdestruct.

 
Re: Conditions For Ship Debris (Or Lack Thereof)
I'm pretty sure LUA scripting can't access most of the settings in the ship editor and these are usually unchangeable in-mission. So obviously I don't want a ship to have a vaporize flag when it's somwhere in the mission and may explode. It's even a problem to blow up a ship with LUA scripting and have the game register it as destroyed without the self-destruct sexp - ship:kill(ship) fails to do that despite its description telling me it should and setting hull to 0 hitpoints left doesn't kill it.
So to me the best solution seems to be self-destruct with an additional flag especially cause it can be used in Fred as well.
Here goes scripting and copy paste coding
Freespace RTS Mod
Checkpoint/Shipsaveload script

  

Offline Valathil

  • ...And I would have had a custom title if it wasn't for you meddling kids!
  • 29
  • Custom Title? Wizards need no Custom Title!
Re: Conditions For Ship Debris (Or Lack Thereof)
or fixing the lua function
┏┓╋┏┓╋╋╋╋╋╋╋╋╋┏┓
┃┃╋┃┃╋╋╋╋╋╋╋╋╋┃┃
┃┃┏┫┃┏┳━━┓┏━━┓┃┗━┳━━┳━━┳━━┓
┃┃┣┫┗┛┫┃━┫┃┏┓┃┃┏┓┃┏┓┃━━┫━━┫
┃┗┫┃┏┓┫┃━┫┃┏┓┃┃┗┛┃┗┛┣━━┣━━┃
┗━┻┻┛┗┻━━┛┗┛┗┛┗━━┻━━┻━━┻━━┛

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Re: Conditions For Ship Debris (Or Lack Thereof)
Vaporized ships don't "just disappear".  They still go through a (shorter) death roll, they still have explosions, and they still create debris.  It's just tiny shards instead of chunks.

 

Offline Cyborg17

  • 29
  • Life? Don't talk to me about life....
Re: Conditions For Ship Debris (Or Lack Thereof)
I'm pretty sure LUA scripting can't access most of the settings in the ship editor and these are usually unchangeable in-mission. So obviously I don't want a ship to have a vaporize flag when it's somwhere in the mission and may explode. It's even a problem to blow up a ship with LUA scripting and have the game register it as destroyed without the self-destruct sexp - ship:kill(ship) fails to do that despite its description telling me it should and setting hull to 0 hitpoints left doesn't kill it.
So to me the best solution seems to be self-destruct with an additional flag especially cause it can be used in Fred as well.

Guardian until the right moment?

 
Re: Conditions For Ship Debris (Or Lack Thereof)
Guardian until the right moment?
I have no idea why and where guardian should help.

There are some other uses for a no-debris flag as well besides the script and considering that vaporize still creates debris I think its a good idea to add this function.
Here goes scripting and copy paste coding
Freespace RTS Mod
Checkpoint/Shipsaveload script

 

Offline Cyborg17

  • 29
  • Life? Don't talk to me about life....
Re: Conditions For Ship Debris (Or Lack Thereof)
I have no idea why and where guardian should help.

It sounded you were trying to get around a ship exploding at the wrong time when you said:

Quote
So obviously I don't want a ship to have a vaporize flag when it's somwhere in the mission and may explode.

I think I just misunderstood.  NVM

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Re: Conditions For Ship Debris (Or Lack Thereof)
 :bump:

Can I make this an official request? I could really use the ability to have an optional flag with self-destruct or ship-vaporize (doesn't matter which one) to not create ship debris or explosion effects at all. Just make the ship disappear and count it as destroyed.
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Re: Conditions For Ship Debris (Or Lack Thereof)
Along with that, I have discovered that Scroll needs a way to turn off subsystems without "destroying" them (playing the explosion and sound effect).

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Re: Conditions For Ship Debris (Or Lack Thereof)
you mean like to make the modelled subsystem disappear with out going boom?
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Re: Conditions For Ship Debris (Or Lack Thereof)
Yep.

 
Re: Conditions For Ship Debris (Or Lack Thereof)
So here is my version of a no-debris shipflag including a sexp to set it and the code changes to fast forward through destruction so it looks like ship vanish.

Feedback is very much appreciated cause this is my first time changing some code that is actually relevant for the whole game. The names of the variables and functions might be misleading as well so if they should be changed tell me.
« Last Edit: August 11, 2012, 05:56:41 pm by Admiral MS »
Here goes scripting and copy paste coding
Freespace RTS Mod
Checkpoint/Shipsaveload script

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Re: Conditions For Ship Debris (Or Lack Thereof)
That's a good effort, but I really don't think a flag is appropriate for this.  Ship-vanish isn't implemented using a flag, for example.  It would be better, and simpler, to just make this a sexp in the vein of self-destruct, maybe called "destruct-no-debris".  Instead of fast-forwarding through the destruction code, it would be better to just call the remove-ship-from-mission code and set the mission log entry.

 
Re: Conditions For Ship Debris (Or Lack Thereof)
My first idea how to do this was to copy the ship-vanish SEXP, rename it and add the mission log entries.
Why I wanted to do it different is I wanted to get it to work in multiplayer and I thought that someone might want to use that option on ships that have been regularly destroyed during gameplay.

If it is unlikely that my first patch gets accepted, here is another patch for a new SEXP called ship-vanish-destroyed to do the job (ship_vanish_destroyed.patch). It has the same disadvantages of ship-vanish like vanishing all docked ships, removing the dots in the wingmen status hud gauge and not working in multiplayer. That's the reason the sexp should be named ship-vanish-xxx.

During testing I got an assertion related to builtin-messages and I was able to reproduce it even with the normal ship-vanish sexp under the same conditions. I made an additional patch to fix that (ship_vanish.patch).

[attachment removed and sold on the black market]
« Last Edit: August 11, 2012, 05:56:26 pm by Admiral MS »
Here goes scripting and copy paste coding
Freespace RTS Mod
Checkpoint/Shipsaveload script

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Re: Conditions For Ship Debris (Or Lack Thereof)
the second patch won't work because it does things like remove the wingman dots instead of marking destroyed. the flag was better.
« Last Edit: August 10, 2012, 08:27:13 am by mjn.mixael »
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Re: Conditions For Ship Debris (Or Lack Thereof)
Are you often on IRC, Admiral MS?  We could work through an implementation on Saturday.

 
Re: Conditions For Ship Debris (Or Lack Thereof)
Whenever I'm at home, IRC is usually running. Saturday could be fine depending on your time-zone (I am in CET) and when you do have time. My nickname is "Ams".
« Last Edit: August 17, 2012, 04:14:23 pm by Admiral MS »
Here goes scripting and copy paste coding
Freespace RTS Mod
Checkpoint/Shipsaveload script