Hard Light Productions Forums

Hosted Projects - Standalone => Diaspora => Diaspora Tech Help => Topic started by: Nightstorm on February 16, 2015, 12:07:09 pm

Title: External stores vanish
Post by: Nightstorm on February 16, 2015, 12:07:09 pm
Hey all,

I'm still early into the troubleshooting of this as I spend most of my time IN the cockpit and not outside so it's not that game breaking.  Here's what I'm running:

The latest patch but with the newest as of 2/12/15 SSE2 build of 3.7.1 exe (the one that fixed the HUD stores display)

I have a custom mission that I wrote and this is where I've encountered the bug or whatever it is.  I have not tested it in other missions or campaign yet.

When I launch all of the stores are initially visible.  It seems to be related to the distance from the battlestar.  Once I reach that distance the external stores just vanish from the model.  They still work, they still show on the HUD, they are just not rendered. 

If I halt my viper immediately after launch and stay close to the battlestar they stay present.  That sounds like a mission type variable?  When distance of my Viper from the Battlestar = X it does something that causes this?

Just guessing.  I wrote that mission based heavily off of one of the test missions that came with the original release.  If you have any ideas to point me in the right direction that would be great.  Thanks!
Title: Re: External stores vanish
Post by: AdmiralRalwood on February 16, 2015, 12:40:37 pm
Could be a bug introduced when external weapon model view distance was changed to actually do something; could be incorrectly calculating the distance, for example.
Title: Re: External stores vanish
Post by: Nightstorm on February 17, 2015, 05:31:37 am
Is that hard coded into the exe or is that a variable that can be changed someplace?  Thanks!
Title: Re: External stores vanish
Post by: Colonol Dekker on February 17, 2015, 06:07:45 am
External weaponry is a flag. Table based right?
Combat landing reloads are mission code. Written into the .fs2 sooooooooOOOOOO. ... how much of the original file remains and how many events did you tweak?
Title: Re: External stores vanish
Post by: AdmiralRalwood on February 17, 2015, 11:07:44 am
It's not a flag, it's a value; one which can't be disabled outright (although you can set it so high as to be irrelevant).

However, upon double-checking the code, it's highly unlikely that the distance calculation is wrong, since it's exactly identical to the value for checking which LOD level should be used.

Are you sure you're viewing your external ordinance from exactly the same camera distance each time?
Title: Re: External stores vanish
Post by: Nightstorm on February 18, 2015, 11:26:15 am
The distance is as close to the Viper as the camera will zoom.  It now seems more time based than anything.  Does the engine have a setting where if too many, or a certain number of objects need to be rendered that it would turn those off?  I can literally be watching the missiles on the ship and *poof* they vanish without my changing a thing.

I'll need to test in one of the campaign missions to see if its just something with my custom mission.  I'll post my findings.  Thanks!
Title: Re: External stores vanish
Post by: AdmiralRalwood on February 18, 2015, 04:56:31 pm
Does the engine have a setting where if too many, or a certain number of objects need to be rendered that it would turn those off?
No. If there were, your secondaries wouldn't be showing up on the HUD's hardpoint gauge; they use identical logic to decide whether or not to render.
Title: Re: External stores vanish
Post by: Nightstorm on February 18, 2015, 09:26:46 pm
Hmm ok.  Well they do render on the HUD.  They do everything they should except show up on the Viper after they vanish.
Title: Re: External stores vanish
Post by: Nightstorm on February 23, 2015, 08:27:43 pm
Well, from the testing I just did.  It's most certainly something in the new exe files.  I couldn't tell you what though.  If I used the 3.7.1 Diaspora R1 exe the stores do not vanish.  There's no stores hud display and the wireframe issue would still be present I would imagine but the stores stay and work as expected.

If I use 3.7.1 r11251 or r11257 the stores display on the hud is fixed but the stores vanish either after a short distance from the battlestar or after a period of time even if I stay close to battlestar.  I don't know if that will help track it down.  If I launch and stay at full throttle they will vanish in just a few seconds.

If I cut throttle and match speed with the battle star and stay close to the ship they last considerably longer but still vanish.  I am not doing anything else other than looking at the external view zoomed in as close as possible to the viper.

The only change is swapping out the exe I start with.  Can anyone else replicate the result?  I suppose I could obtain all of the versions of the exe post release and test each one.  Figure out when the issue was introduced.
Title: Re: External stores vanish
Post by: AdmiralRalwood on February 23, 2015, 09:21:50 pm
I can virtually guarantee that the issue would have been introduced with r11178 (but if you'd like to confirm that by trying it with the nightlies made before and after that revision, feel free), since external weapon models were always rendered no matter how far away they were prior to that revision.

It's behaving as if the depth calculation is checking the distance between the ordinance and the center of the mission area (coordinates 0,0,0) instead of the distance between the ordinance and the camera. If that's the case, however, everything should be changing LOD levels based on how far it is from the center of the mission, which doesn't seem to be happening.

I'm continuing to look into the relevant code, but I'm afraid graphics coding may as well be black magic as well as I understand it.
Title: Re: External stores vanish
Post by: Nightstorm on February 23, 2015, 09:32:13 pm
Confirmed.  The bug was introduced in r11178. 

------------------------------------------------------------------------
r11178 | MageKing17 | 2014-11-21 12:42:44 -0600 (Fri, 21 Nov 2014) | 3 lines
Changed paths:
   M /trunk/fs2_open/code/model/model.h
   M /trunk/fs2_open/code/model/modelinterp.cpp
   M /trunk/fs2_open/code/ship/ship.cpp

From The_E, niffiwan, m_m, and myself: Fix Mantis 2404.

Makes "$Weapon Model Draw Distance:" actually stop external weapon models from being drawn beyond that distance (modified by detail level).
------------------------------------------------------------------------


Not present prior to that.
Title: Re: External stores vanish
Post by: Nightstorm on February 23, 2015, 09:38:33 pm
I don't suppose you have a copy of the code from R11177 that you could put in the HUD ordinance corrections in R11251?  That would be ideal :)  Unless of course the bug is found an creamed :)
Title: Re: External stores vanish
Post by: Nightstorm on March 15, 2015, 09:46:03 am
So to recap a few things that are known:

1. The wireframe view / hard point gauge was broken some time prior to r10530.  I don't know when exactly.
2. Diaspora v1.1 was based on that release so its hard point gauges are broken.
3. Diaspora v1.1.1 didn't change the code base version so no change there.
4. In Nightly build r11178 there was change that affected "$Weapon Model Draw Distance:".  This appears to have the affect of causing external stores to vanish once a specific distance from the 0,0,0 coordinates of the game grid are reached.
5. In Nightly build r11251 the wireframe view/ hard point gauges were fixed.

Can the code that affects the "$Weapon Model Draw Distance:" introduced in r11178 be easily corrected?  I can confirm it is still present in the latest build r11278 from (Fri, 06 Mar 2015).

That's the largest bug still in Diaspora that I have encountered.  It would awesome to correct that :)

Thank you!

Title: Re: External stores vanish
Post by: AdmiralRalwood on March 15, 2015, 02:22:03 pm
Can the code that affects the "$Weapon Model Draw Distance:" introduced in r11178 be easily corrected?
It can be "easily corrected" by just reverting that revision, but then "$Weapon Model Draw Distance:" goes back to doing nothing. It would be preferable to find out why it isn't working correctly, but I haven't had much luck there (and I don't know if anybody else has looked into the problem yet).

Have you made a Mantis (http://scp.indiegames.us/mantis/) ticket for the problem yet?
Title: Re: External stores vanish
Post by: Nightstorm on March 15, 2015, 08:57:07 pm
No, I've never used Mantis before.  I clicked the link and it looks like I can sign up for an account.

I'm not a part of any team here or anything, just a fan of the projects and thought I would help out where I could or at least point out the issue to those that do work on it.

I signed up and created report 0003149.

I took a best guess at the parameters to enter it under.
Title: Re: External stores vanish
Post by: karajorma on March 16, 2015, 10:21:18 pm
No, I've never used Mantis before.  I clicked the link and it looks like I can sign up for an account.

I'm not a part of any team here or anything, just a fan of the projects and thought I would help out where I could or at least point out the issue to those that do work on it.

You don't need to be a member of the team to sign up for mantis. If you've found a bug and you're willing to help us test fixes (especially if you're willing to do the kind of work you've done on here to help us resolve it), that's more than enough.
Title: Re: External stores vanish
Post by: Nightstorm on March 16, 2015, 11:13:31 pm
It would be nice to fix that particular bug as it of course affects any version that uses external stores.  I got TBP working with Yarn's wide screen fix build and it works fantastic.  I noted the stores bug there too as expected.

I'm really impressed with the versatility of this engine.  I've got three different installations, Freespace2 with all of it's mods, The Star Wars Trilogy being my current favorite of them, The Babylon Project and Diaspora.

Each one of them feels different, flies different and does a superb job of representing each genera.  I'm really looking forward to the next release of Diaspora.  Can't wait to be able and fly off of a Valkyrie class Battlestar.

And Fate of the Galaxy, that looks to be the best Star Wars sim since X-Wing Alliance :)  Lots of cool stuff coming.