Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Trivial Psychic on October 19, 2011, 08:32:19 am

Title: Subsystem Scanning and Submodels
Post by: Trivial Psychic on October 19, 2011, 08:32:19 am
I've already got this in Mantis as it could be a bug, but it is also technically a feature request.  I was FREDding recently and discovered when I tried to make a cap-ship-subsystem-scan mission, that you can't select a submodel-subsystem to be scanned.  With more and more modelers making designs with actual destroyable submodels replacing the simpler box type, it should really be enabled.  Is this possible... or relatively easy to impliment?  If so, could it be done soon?

Thanks.
Title: Re: Subsystem Scanning and Submodels
Post by: Trivial Psychic on October 26, 2011, 11:18:50 pm
Double-Post

I've just found out that its not submodels that are not scannable, its non-standard-named subsystem.  Basically, any subsystem that includes the names Navigation, Communication(s), Sensors, Weapons, or Engine(s), even if there are additional attributes such as numbers and locations (the Sathanas is a good example), may be scanned.  However, subsystems such as Reactor or Bridge, are not on the list and thus cannot be scanned.  I feel that this limitation should be lifted.
Title: Re: Subsystem Scanning and Submodels
Post by: CaptJosh on October 27, 2011, 07:56:40 am
That IS weird. 

Question: if the limitation is lifted, wouldn't we still need some sort of flag to indicate a subsystem is scannable? I mean, if the restriction is lifted and all subsystems become scannable, that might cause some issues in missions that only want certain systems scanned?
Title: Re: Subsystem Scanning and Submodels
Post by: zookeeper on October 27, 2011, 08:37:21 am
Question: if the limitation is lifted, wouldn't we still need some sort of flag to indicate a subsystem is scannable? I mean, if the restriction is lifted and all subsystems become scannable, that might cause some issues in missions that only want certain systems scanned?

Aren't only ships and subsystems with cargo scannable?
Title: Re: Subsystem Scanning and Submodels
Post by: Trivial Psychic on October 27, 2011, 06:11:32 pm
That is correct.  Right now however, when you select a non-standard subsystem, the cargo space gets greyed out.
Title: Re: Subsystem Scanning and Submodels
Post by: karajorma on October 28, 2011, 12:58:34 am
So it seems like this should be fixable without destroying backwards compatibility. No old missions will have subsystems that suddenly become scannable since they have no cargo.
Title: Re: Subsystem Scanning and Submodels
Post by: zookeeper on October 28, 2011, 02:53:59 am
That is correct.  Right now however, when you select a non-standard subsystem, the cargo space gets greyed out.

Right, that seems to be the case. Kinda silly.

While we're on the subject... is there really any reason to ever gray the cargo space out? If someone wants to put cargo on a subsystem, why should they need to first go check the "toggle subsystem scanning" box?
Title: Re: Subsystem Scanning and Submodels
Post by: karajorma on October 28, 2011, 05:48:20 am
Because if you don't tick the box, you can't scan subsystems on anything below destroyer class.
Title: Re: Subsystem Scanning and Submodels
Post by: zookeeper on October 28, 2011, 06:35:50 am
Because if you don't tick the box, you can't scan subsystems on anything below destroyer class.

Yeah, and I don't see how that makes any sense. If a subsystem cannot be scanned unless it has cargo in any case, then why should I need to tick an extra box before I can put cargo on, say, a fighter subsystem? Are there retail missions where a subsystem on something below destroyer class has cargo but shouldn't be scannable?
Title: Re: Subsystem Scanning and Submodels
Post by: karajorma on October 28, 2011, 06:57:37 am
I think you're missing the point. If you don't have a tickbox you've just made every single destroyer in the game which doesn't have a cargo set for at least one subsystem scannable.

In addition you've complicated the code for scanning as now the code has to decide if a ship is scannable on parse by checking if there are any cargoes set for any of it's subsystems.

Now if you want to suggest moving the toggle button to the initial status editor (IIRC it's on the ship flags editor) that's a completely different matter.
Title: Re: Subsystem Scanning and Submodels
Post by: CaptJosh on October 28, 2011, 10:57:40 am
So it seems like this should be fixable without destroying backwards compatibility. No old missions will have subsystems that suddenly become scannable since they have no cargo.

That answers my question. I may not be a coder, but I do remember the importance of not breaking retail compatibility, so I thought it best to ask the question sooner rather than later. Glad there's a mechanism already in place that would make sure the change wouldn't be harmful to that.
Title: Re: Subsystem Scanning and Submodels
Post by: zookeeper on October 28, 2011, 11:59:45 am
I think you're missing the point. If you don't have a tickbox you've just made every single destroyer in the game which doesn't have a cargo set for at least one subsystem scannable.

I might be missing something indeed, because it still doesn't make sense to me. :D What does it matter if they're all scannable, if there is nothing to scan and thus scanning won't happen?

This is the way I see the current behaviour:

1. You can only scan subsystems which have cargo.
2. You can only put cargo on a subsystem if you toggle "toggle subsystem scanning" on, and it's off by default.

...which already assumes that if you put cargo somewhere, you want it to be scannable, so I have difficulty seeing how the "toggle subsystem scanning" checkbox isn't just an unnecessary extra hoop to jump through. If I need to make cargo scannable before I can put cargo anywhere, then the presence of cargo should be the only cue the game needs from me. As it is I feel like I need to tell FRED that "hey, I'd like to have subsystem cargo, so could you please make subsystem cargo scannable so I can put in the subsystem cargo".

Unless, as I said, I am still missing something.

In addition you've complicated the code for scanning as now the code has to decide if a ship is scannable on parse by checking if there are any cargoes set for any of it's subsystems.

Now if you want to suggest moving the toggle button to the initial status editor (IIRC it's on the ship flags editor) that's a completely different matter.

Well, sure, the more reasonable behaviour being technically more difficult to implement (or having no one willing to do it) is of course an understandable reason not to do it.

Anyway, yeah, the checkbox would make more sense in the initial status editor, I think.

And I guess I could volunteer to write a patch for determining scannability at parse time as per my suggestion, if it so happens that I'm not missing something important and it'd actually be an acceptable change. It sounds like it can't really complicate the code much, but that's certainly an assessment I don't want to try to make before taking a look.
Title: Re: Subsystem Scanning and Submodels
Post by: Goober5000 on October 28, 2011, 03:01:10 pm
The "toggle subsystem scanning" box essentially means "turn subsystem scanning behavior on if it's normally off, and off if it's normally on", but that was too much text to fit in the checkbox.

The default FS2 behavior is to scan the entire ship at once for corvettes and below, and to scan the subsystems of capital ships.  If a ship has that box checked, then the behavior changes to scan the subsystems for corvettes and below, and to scan the entire ship at once for capital ships.

For scan-the-entire-ship-at-once behavior, subsystems cannot be scanned, whether a subsystem has cargo or not.  Likewise, for scan-subsystems behavior, the ship cannot be scanned, whether the ship has cargo or not.
Title: Re: Subsystem Scanning and Submodels
Post by: chief1983 on October 28, 2011, 03:06:58 pm
The "toggle subsystem scanning" box essentially means "turn subsystem scanning behavior on if it's normally off, and off if it's normally on", but that was too much text to fit in the checkbox.

The default FS2 behavior is to scan the entire ship at once for corvettes and below, and to scan the subsystems of capital ships.  If a ship has that box checked, then the behavior changes to scan the subsystems for corvettes and below, and to scan the entire ship at once for capital ships.

For scan-the-entire-ship-at-once behavior, subsystems cannot be scanned, whether a subsystem has cargo or not.  Likewise, for scan-subsystems behavior, the ship cannot be scanned, whether the ship has cargo or not.

^ Can we get a tooltip in FRED with that information in it?  :P
Title: Re: Subsystem Scanning and Submodels
Post by: zookeeper on October 28, 2011, 03:23:57 pm
The "toggle subsystem scanning" box essentially means "turn subsystem scanning behavior on if it's normally off, and off if it's normally on", but that was too much text to fit in the checkbox.

The default FS2 behavior is to scan the entire ship at once for corvettes and below, and to scan the subsystems of capital ships.  If a ship has that box checked, then the behavior changes to scan the subsystems for corvettes and below, and to scan the entire ship at once for capital ships.

For scan-the-entire-ship-at-once behavior, subsystems cannot be scanned, whether a subsystem has cargo or not.  Likewise, for scan-subsystems behavior, the ship cannot be scanned, whether the ship has cargo or not.

What the... :sigh: That's seriously messed up.
Title: Re: Subsystem Scanning and Submodels
Post by: Trivial Psychic on October 28, 2011, 06:49:41 pm
If the little issue that I brought up is intended to be rectified, is it possible to tack on another bit of a feature request?  I could foresee situations when a mission designer actually wants the cargo of a subsystem to be displayed to the pilot.  For example, I'm a pirate and there is a very large transport that I've disabled to capture specific cargo.  The transport has several different cargo bay subsystems, and I need to know which one has the cargo.  The question (if it is indeed feasible, relatively simple, and desirable), is whether to make it a checkbox in the ships' initial status, or activate it on a per-subsystem basis, with a checkbox next to the cargo description window.
Title: Re: Subsystem Scanning and Submodels
Post by: Goober5000 on October 29, 2011, 01:29:06 am
There's a set-cargo-known sexp.  It would be fairly easy to derive a set-subsystem-cargo-known sexp from that.

Actually, the sexp is set-scanned, and it already supports subsystems.
Title: Re: Subsystem Scanning and Submodels
Post by: Trivial Psychic on October 29, 2011, 07:57:48 am
Actually, the sexp is set-scanned, and it already supports subsystems.
Is this in response to my request for displayed subsystem cargo content, or to the non-standard-subsystems-not-scanable thing?
Title: Re: Subsystem Scanning and Submodels
Post by: Goober5000 on October 29, 2011, 05:00:21 pm
Your most recent post besides that one.  The one where you asked about making subsystems cargo visible without having to scan it.
Title: Re: Subsystem Scanning and Submodels
Post by: Trivial Psychic on October 29, 2011, 10:43:11 pm
The one where you asked about making subsystems cargo visible without having to scan it.
Actually, I meant that you can bring up its content via scanning just like with transports or cargo.  Right now, for subsystems (IIRC) you can only have "not scanned" and "scanned".  You can't have "not scanned" turn into "spare fighter parts" or whatever, once scanned.  Am I right about that?
Title: Re: Subsystem Scanning and Submodels
Post by: Goober5000 on October 30, 2011, 03:08:07 am
Oh.  Yeah, that's correct.
Title: Re: Subsystem Scanning and Submodels
Post by: Dragon on October 30, 2011, 03:18:36 am
I don't think so, it's the other way around. IIRC, you can't have a "scanned-unscanned" type of scanning, you have to set cargo to "scanned". I didn't checked that in a long time though.
Title: Re: Subsystem Scanning and Submodels
Post by: Goober5000 on October 30, 2011, 03:21:58 am
Well, I guess I don't remember then.
Title: Re: Subsystem Scanning and Submodels
Post by: karajorma on October 30, 2011, 07:32:10 pm
What the... :sigh: That's seriously messed up.

Not really. What you're suggesting makes no sense. You want the ship and the subsystems to be scannable at the same time. Suppose I decide to target an unscanned destroyer when I am in range of one of its subsystems, which one should get scanned? Which result should be displayed?
Title: Re: Subsystem Scanning and Submodels
Post by: CaptJosh on October 30, 2011, 07:52:35 pm
Kara, that's easy. The subsystem has to be targeted to be scanned. Thus, if you have no subsystems targeted at all, you scan the whole ship. If you have the subsystem in range targeted, you scan it.
Title: Re: Subsystem Scanning and Submodels
Post by: karajorma on October 30, 2011, 08:53:28 pm
You do realise that makes no logical sense at all, right? :p

But nonetheless, this isn't going to ever stop being a tickbox.
Title: Re: Subsystem Scanning and Submodels
Post by: Goober5000 on October 30, 2011, 10:56:11 pm
^ Can we get a tooltip in FRED with that information in it?  :P
I've put it in the wiki.  Does that suffice?
http://www.hard-light.net/wiki/index.php/Minor_FRED_Features
Title: Re: Subsystem Scanning and Submodels
Post by: zookeeper on October 31, 2011, 02:04:27 am
What the... :sigh: That's seriously messed up.

Not really. What you're suggesting makes no sense. You want the ship and the subsystems to be scannable at the same time. Suppose I decide to target an unscanned destroyer when I am in range of one of its subsystems, which one should get scanned? Which result should be displayed?

Ok, fine, it needs a checkbox to determine whether the ship or subsystems should be scannable, because otherwise you couldn't scan the ship if you have any subsystem targeted, and that would be annoying.

Still, the problem isn't so much the existence of a checkbox or two than a yet another case of stuff being hardcoded based on ship size and it being explained nowhere in the UI. All that's really needed is a single checkbox to determine whether to scan the ship or subsystems, and possibly another checkbox to disable scanning altogether (so that you can make unscannable cargo). The current way of reversing what the checkbox does based on ship size is very confusing and doesn't seem to really serve any useful purpose. If a sane default is wanted then it's the checkbox itself which should default to being on or off based on ship size, although even that seems unnecessary and prone to cause light confusion considering how rare subsystem scanning is.
Title: Re: Subsystem Scanning and Submodels
Post by: zookeeper on October 31, 2011, 02:18:44 am
^ Can we get a tooltip in FRED with that information in it?  :P
I've put it in the wiki.  Does that suffice?
http://www.hard-light.net/wiki/index.php/Minor_FRED_Features

Well, how does one get to that page when they have a problem with setting up scanning-related stuff? It's on a wiki page for "minor features" linked to only from Portal:FRED, so to me it seems pretty... undiscoverable.

Anyway, if my checkbox suggestion in the previous post is acceptable, then the box should be named something like "scan ship (on) or subsystems (off)" instead of "toggle subsystem scanning". Then all the information you need in order to understand the feature is right there.
Title: Re: Subsystem Scanning and Submodels
Post by: karajorma on October 31, 2011, 03:55:35 am
Again, doing that would break existing missions. Do you really want to field every single question from every single newbie who tells you that they've scanned the ship in question but the mission didn't continue?
Title: Re: Subsystem Scanning and Submodels
Post by: Trivial Psychic on October 31, 2011, 06:52:57 pm
All I was asking about was A), allowing non-standard subsystem to be scannable, and B), allow scanned subsystems to display the cargo content when scanned (though admittedly I haven't tried this out on a transport class ship with subsystem scanning toggled on) using a checkbox next to the subsystem in the "initial status" menu to "display content when scanned" or something like that.
Title: Re: Subsystem Scanning and Submodels
Post by: Goober5000 on November 01, 2011, 12:03:40 am
Still, the problem isn't so much the existence of a checkbox or two than a yet another case of stuff being hardcoded based on ship size and it being explained nowhere in the UI.
The problem is, that is dictated by FS2.  In the main FS2 campaign, you scan the Iceni (as a whole ship) and the Sathanas (as subsystems).  The cutoff threshold is defined as ship class size, and it just so happens that corvette classes and below use the scan-at-once behavior.  The UI has nothing to do with this.

The only thing that FRED does is add a checkbox to switch this behavior.  That's it.  And that's the simplest way this problem can be solved, because if we had a series of four option buttons to properly represent all four combinations (capital-at-once, capital-subsystems, corvette-at-once, corvette-subsystems) it would get very confusing very quickly.

You should also consider that you are the only person who has found this concept difficult to understand in the seven years since the feature was added.

Quote
All that's really needed is a single checkbox to determine whether to scan the ship or subsystems
Which is what we have...

Quote
and possibly another checkbox to disable scanning altogether (so that you can make unscannable cargo)
That's easy.  Just set the cargo to known and the cargo name to something like "Unable to Scan".  Or even set the cargo to unknown.  That's how it works in sm1-02 in FS2.

Quote
Well, how does one get to that page when they have a problem with setting up scanning-related stuff? It's on a wiki page for "minor features" linked to only from Portal:FRED, so to me it seems pretty... undiscoverable.
And this is a minor FRED feature.  Tell me, just where on the wiki is there a page specifically devoted to "setting up scanning-related stuff"? :rolleyes:


All I was asking about was A), allowing non-standard subsystem to be scannable, and B), allow scanned subsystems to display the cargo content when scanned (though admittedly I haven't tried this out on a transport class ship with subsystem scanning toggled on) using a checkbox next to the subsystem in the "initial status" menu to "display content when scanned" or something like that.
a) I think this can be done pretty easily.  I've looked through the code and restricting the subsystems may simply be arbitrary.
b) This would require more work, although it can probably be tied to the existing "scannable" flag.
Title: Re: Subsystem Scanning and Submodels
Post by: zookeeper on November 01, 2011, 01:25:09 am
Still, the problem isn't so much the existence of a checkbox or two than a yet another case of stuff being hardcoded based on ship size and it being explained nowhere in the UI.
The problem is, that is dictated by FS2.  In the main FS2 campaign, you scan the Iceni (as a whole ship) and the Sathanas (as subsystems).  The cutoff threshold is defined as ship class size, and it just so happens that corvette classes and below use the scan-at-once behavior.  The UI has nothing to do with this.

The only thing that FRED does is add a checkbox to switch this behavior.  That's it.  And that's the simplest way this problem can be solved, because if we had a series of four option buttons to properly represent all four combinations (capital-at-once, capital-subsystems, corvette-at-once, corvette-subsystems) it would get very confusing very quickly.

Well, FRED could present a "scan ship or subsystems" checkbox to the user and still use the current behaviour behind the scenes by checking the size of the ship. If the user tells it to "scan ship" on a fighter, then it wouldn't set the "switch scanning behaviour flag" on that ship; if the user tells it to "scan ship" on a big ship, then it would.

Sure there might be a pitfall in there somewhere (like what happens if you change the ship class), but doesn't sound too utopistic to me.

Quote
Well, how does one get to that page when they have a problem with setting up scanning-related stuff? It's on a wiki page for "minor features" linked to only from Portal:FRED, so to me it seems pretty... undiscoverable.
And this is a minor FRED feature.  Tell me, just where on the wiki is there a page specifically devoted to "setting up scanning-related stuff"? :rolleyes:[/quote]

Yes, precisely. What IMO warrants rolleyes is exactly the fact that something like how to set up scanning-related stuff with a GUI even warrants external explanation as opposed to being entirely self-evident. Note that I'm not blaming anyone in particular.
Title: Re: Subsystem Scanning and Submodels
Post by: karajorma on November 01, 2011, 04:55:03 am
Well, FRED could present a "scan ship or subsystems" checkbox to the user and still use the current behaviour behind the scenes by checking the size of the ship. If the user tells it to "scan ship" on a fighter, then it wouldn't set the "switch scanning behaviour flag" on that ship; if the user tells it to "scan ship" on a big ship, then it would.

Now that, is a good idea. Not certain how possible it might be to code (probably not too hard) but it does make sense from a GUI point of view at least.