Author Topic: Double Triangle Trouble  (Read 2082 times)

Offline furswift

  • Posts: 101
  • Cookies: 53
Double Triangle Trouble
« on: March 14, 2011, 02:05:22 PM »
  I recently tried to export a model built in 3ds Max as a nif for BC. It's about 27K triangles and it's 51 separate objects, not a unified mesh. I ran an STL check and there were no mesh errors on the entire model. However, when I tested it in game the game crashed immediately when the ship took damage. I looked at the voxelizer debug and saw that the model had hundreds of double sided triangles. I thought this might be because the mesh isn't unified, but I did a little research to find out if this was really the reason. My NX Excelsior is made up of about 100 different objects and is over 28K triangles. It also has lots of mesh errors, but it has only 94 double sided triangles. While this isn't great it isn't crashing the game or causing any major damaging issues either. Then I looked at Wiley's TOS Enterprise model. It's over 28K triangles and is not a unified mesh. But the voxelizer debug says it only has 8 double sided triangles. I've also seen a 6K poly model that is just 2 separate objects but it has 102 double sided triangles. So as it stands I can find no correlation between poly count, mesh unity, mesh errors, and double triangle count. I really want to get this model to work in game, but I can't find out why it develops all of these double sided triangles when being exported to nif format. Is there something I missed in the export process? Is the nif exporter for Max 2010 just crappy? Is it simply luck? I even tried booleaning my entire model together but there was no help there. Has anyone else run into this issue?

Offline baz1701

  • Posts: 3392
  • Cookies: 1434
Re: Double Triangle Trouble
« Reply #1 on: March 16, 2011, 04:58:14 AM »
Have you tried to re-import the nif back in to max and run the checks again?

Should show you what got screwed up before you exported. All so is it welded? I mean two verts in the same place?
Whatever knocks us back, can only make us stronger.

Offline furswift

  • Posts: 101
  • Cookies: 53
Re: Double Triangle Trouble
« Reply #2 on: March 16, 2011, 11:44:02 AM »
I did try reimporting the nif. There were a lot of duplicate, unwelded verts. None of these errors existed on the model that I built, however. I fixed the errors and reexported, but the game crashes if I try to load the ship.

Offline baz1701

  • Posts: 3392
  • Cookies: 1434
Re: Double Triangle Trouble
« Reply #3 on: March 16, 2011, 12:12:19 PM »
what about if you export to obj and then import in to nifskope then save as a nif?
Whatever knocks us back, can only make us stronger.

Offline furswift

  • Posts: 101
  • Cookies: 53
Re: Double Triangle Trouble
« Reply #4 on: March 16, 2011, 12:40:26 PM »
Ok I tried that, but the game crashed when I loaded the ship. Is there something I need to do in Nifskope to make it a Bridge Commander nif? I know nothing about Nifskope. :(

Offline baz1701

  • Posts: 3392
  • Cookies: 1434
Re: Double Triangle Trouble
« Reply #5 on: March 16, 2011, 12:57:45 PM »
Sadly I have never used it so can not advise.

Perhaps some with MAX 10 can try re-exporting it I only have max9 so cannot open it.
Whatever knocks us back, can only make us stronger.

Offline X_TheUnknown_X

  • Posts: 325
  • Cookies: 328
  • (Semi) Retired
Re: Double Triangle Trouble
« Reply #6 on: March 16, 2011, 05:08:28 PM »
I have encountered this problem a few times before, and (usually) it has very little to do with the model. I'm sure that dupilcate vertices are needed to give the impression of hard edges - and removing them you make the whole mesh look smooth, so that could be the unwelded verts you get after re-import.
The problem I had came when I made my two starbases (Kessok and Fed), I had vox files over 200MB big. I found that BC uses vox files for mesh damaging (as you probably know), and the engine has 2 settings for damage resolution: one in the hardpoint, and one hidden in the ship.py file - both need to be calibrated for the ship's scale in BC. I would reccomend finding a ship of similar size to yours, and copying over the damage res settings. I'll post below an extract from the KM Sovvy ship.py file:

Quote from: Sovereign.py
      # Params are: File Name, PickLeafSize, SwitchOut Distance,
      # Surface Damage Res, Internal Damage Res, Burn Value, Hole Value,
      # Search String for Glow, Search string for Specular, Suffix for specular
      pLODModel = App.g_kLODModelManager.Create(pStats["Name"])
      pLODModel.AddLOD(pStats["FilenameHigh"], 10, 40.0, 15.0 , 15.0, 400, 1000, "_glow", None, "_specular")
      pLODModel.AddLOD(pStats["FilenameMed"],  10, 100.0, 15.0, 15.0, 400, 900, "_glow", None, "_specular")
      pLODModel.AddLOD(pStats["FilenameLow"],  10, 800.0, 15.0, 30.0, 400, 900, "_glow", None, None)

Offline King Class Scout

  • Posts: 1775
  • Cookies: 893
  • the other half of SFRD
Re: Double Triangle Trouble
« Reply #7 on: March 16, 2011, 06:28:46 PM »
hmm...i think you just gave me a way to improve the damage sizes on one of my own ships.  i've got it set the same as the ship script I borrowed it from, and it's too big.  does it match the "damage Resolution" rating in the hardpoint script?

edit: never mind.  it worked beautifully, matching the hardpoint and ship numbers. the damage panels are smaller, and the actual breakup is a bit more detailed.
OS novel fan

Coming Soon: King's Mod Tuning Shop

best line I've ever read
Me: mine [my bridges] would probably be simple to get the characters to use.  the only person that sits is the captian.
Baz: space is vast there[sic] legs will be tired by the time they get to the next planet

Offline CptBenSisko

  • Posts: 275
  • Cookies: 6
Re: Double Triangle Trouble
« Reply #8 on: March 20, 2011, 09:19:10 PM »
ive tried to export your excelsior model to .obj with nifscope to import it into Milkshape3D but the program crashes everytime....sooo...maybe this double triangle issue has something to do with it...

Offline DJ Curtis

  • Ship Builder
  • Posts: 1967
  • Cookies: 1412
  • I make ships.
Re: Double Triangle Trouble
« Reply #9 on: March 20, 2011, 09:42:27 PM »
BC big-time prefers a unified mesh.  Other than combing the components I don't have any advice I'm afraid.