Jump to content
Sign in to follow this  
gerwin

Collision lods of ships

Recommended Posts

First of, I found the stock game at my current settings still allows one fly though stock frigates/destroyers unharmed. But I do notice gunfire being able to hit things like the superstructure. I think that functionality is pretty essential for harpoon missile impact. And indeed I do have inconsistent harpoon results when targeting a 3rd party ship.

 

I exported a large box as a lod. Internally named 'hull' as the parent mesh of the main lod, then used this as a collision mesh. But the gunfire still only impacts near the waterline.

 

If you adjust a stock ships main ini to show the collision lod you can see how they are shaped. It is usually the hull and superstructure with some boxes representing turrets and radars. Some look very usable as an additional distance lod: OHperry, Knox, Krivak. others are very poorly mapped.  (I suppose this LOD is supposed to be low poly and using a primary lod will probably lead to infinitely more collision calculations (=bad). ).

 

I read whiteboysamurai had problems with this to, did anyone ever solve this?

 

PS: Stock Knox Class has an oddity in the data.ini disabling its weapons: [XX3] where it should read [003].

 

 

 

 

Share this post


Link to post
Share on other sites

Thats not only gunfire, but missiles do that, too... I had experiments with a lot of ASMs, which just flew above the targets, or hitting the same miserable radar dish all the time. Krivak is almost done, btw.

 

What I have problems with right now are helo decks which can be used for helo operations.

Share this post


Link to post
Share on other sites

The game engine doesn't seem to treat ground objects as truly solid objects like terrain (or flight decks) for purposes of crashing into them. I've damaged the main rotor of a helicopter on many occasions by flying through a ship's superstructure, but other than that I rarely see the sort of catastrophic damage you'd expect from such an event. Regardless of those issues, the stock ships and any designed with proper collision meshes will properly take hits from missiles and gunfire.

 

When it comes to third-party ships released before SF2:NA, missiles and bullets will pass right through. The only thing we've been able to get to work is to copy the ship's LOD (preferably the lowest-poly one if there are more than one) and assign that as the collision LOD. This is very inefficient, though, because like you said the game engine has to do more work because of all the extra polygons.

 

Gerwin, I've tried something similar to what you did: Export a boxy collision LOD roughly the same size as the third party ship. I couldn't get it to work either. I'm pretty sure the reason is that the model's pivot points (and maybe min-max extents) have to be the same as the collision model. Because we have no way of knowing where those points are in the original model, this is nearly impossible.

 

I've tried making helo decks for stock and third party ships too, but ran into the same problem for the same reasons. Without the original file, we can't know precisely how everything is supposed to line up. More experimentation is required in any case.

 

Edit: Just noticed that the stock Knox also does not have node names assigned for its components. Strange...

 

[Hull]
ModelNodeName=                                      <= This is kind of important >_>
EffectSize=1.0
MinExtentPosition=-6.81,-67.43,-3.87
MaxExtentPosition= 6.81, 65.32, 9.70
Edited by WhiteBoySamurai

Share this post


Link to post
Share on other sites
When it comes to third-party ships released before SF2:NA, missiles and bullets will pass right through. The only thing we've been able to get to work is to copy the ship's LOD (preferably the lowest-poly one if there are more than one) and assign that as the collision LOD. This is very inefficient, though, because like you said the game engine has to do more work because of all the extra polygons.

 

Gerwin, I've tried something similar to what you did: Export a boxy collision LOD roughly the same size as the third party ship. I couldn't get it to work either. I'm pretty sure the reason is that the model's pivot points (and maybe min-max extents) have to be the same as the collision model. Because we have no way of knowing where those points are in the original model, this is nearly impossible.

 

I've tried making helo decks for stock and third party ships too, but ran into the same problem for the same reasons. Without the original file, we can't know precisely how everything is supposed to line up. More experimentation is required in any case.

 

You say it like taking the normal lod of the Ship will work, but in the cases which I tested the most: Slava (YeYeYe) and Spruance (MikeWHL) this procedure did not work for me so far. So maybe it work sometimes, but I have not seen it.

 

The simple box experiment has only one origin and one pivot, so I it is no too hard to place. You can make it visible and verify alignment. (I succesfully made a distance lod for a few 3rd party items in a similar fashion.). Maybe the Collision lod requires at least all meshes listed in the Datafile? That would complicate matters alot.

 

Regarding the Knox, I put 'Hull' as the Modelnodename, and 'Deck' on the next blank one. IIRC.

Share this post


Link to post
Share on other sites

You're right, the normal lod -> collision lod method doesn't work for some ships. It could be an issue of too much complexity (for models with lots of wires, railings, and radar dish stuff) or gaps in the mesh (the Kynda had this issue for me). The Slava works for me as far as I can tell (my missiles can hit it), though to be honest I've never tried strafing the ship.

 

The box experiment might be able to work. For one thing, try setting the center point for the "hull" box at 0,0,0. That's what I set it for the hull of all my ships, and maybe Thirdwire has the same idea. If that doesn't work, we should probably assume that the collision mesh needs at least a superstructure (linked to the hull in the hierarchy, of course) and probably the other components listed in the data file.

Share this post


Link to post
Share on other sites

I rechecked te Slava, with the small 24kb LOD as a collision mesh it works quite well with gun and rocket impacts.

My confusion with it is that when the 1st harpoon hits it (while not entirely destroying it) I see no impact effect. I only see the small fire that remains.

Making me think there was no collision. When a second harpoon finishes the job, it does show a proper explosion.

Either way it works sufficiently! :)

 

EDIT: the above lack of an impact explosion was because of a weapondata.dat saved with an older version of the weapon editor.

 

The old Spruance model (MikeWHL) has gaps like his Kynda model of course.

 

Attached the stock knox collision lod. This is one of the few with proper texturing, It even shows decals.

post-32175-0-40619400-1381251024.jpg

Edited by gerwin

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

By using this site, you agree to our Terms of Use, Privacy Policy, and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..