Hard Light Productions Forums
Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: Enioch on August 17, 2010, 04:09:55 am
-
Hello, people!
I've run into a snag while trying to test-export our first Renegade Legion ship to FSO. The problem is this:
In the RL universe, ships use 'broadsides' of laser guns, synchronized to fire together, like old ships-of-the-line. The obvious solution to that problem is to create a turret model that spans the length of the ship with firing points at regular intervals and 'salvo mode' enabled.
Thus far, all's good. The turret works perfectly. :)
However. :(
The length of the turret is a problem, in that the FSO (or PCS2, I dunno what to blame) creates cubic 'bounding boxes' for turrets based on the submodel radius -the distance from the center of the model to the furthest vertex. Which means that, since my turret is pretty long, it gets a bounding box about 400 meters on every side. Which, of course, extends to the other side of the model.
So, I get a situation where a fighter fires at the starboard laser guns of a capital ship and also damages the port guns, since their bounding box extends to the starboard side...
This, of course, is highly unrealistic, as you can probably figure out for yourselves. If I'm firing at you from the right, I should damage only your guns on the right, not blow holes into your left side...
My question is this:
Is there any way to manually adjust the dimensions of a bounding box, or force the engine to register hits on a turret only when the turret model itself is hit?
Thanks!
-
fix up your model. that shouldnt happen unless you have very glaring mesh problems and/or stray vertices/polys in the mesh.
-
How does the integrity of the mesh come into it? I can't guarantee that there aren't any problems, of course, and I'll definitely look into it, but I don't get it.
Is it possible that you misunderstood? My shots aren't 'flying through' the ship. There are no collision errors. But when my shots hit the hull of the warship that lies within the limits of the turret bounding box, damage gets carried to the turret.
(http://img827.imageshack.us/img827/2200/explainl.png)
-
Isn't there a flag or something that forces FS to look for submodel collisions before doing damage, instead of just using the distance between the impact point and the submodel center?
-
Is there? I looked in the wiki, and couldn't find it.
-
Do you have the pivot of the turret set to it's center? If so you should not be getting a bounding box that wide.
-
No, I'm pretty sure PCS2 calculates the bounding box based on the actual dimensions of the subobject, otherwise everything we have would have perfectly square bboxes (take a look at a few models - they don't). Make sure the object center is where you want it to be, and that there isn't any extraneous geometry floating around anywhere.
-
I don't think its the bounding box, but rather the radius.
FSO applies damage to subsystems based on radius by defualt, IIRC.
-
No radius is used for special point subsystems. Subobject based subsystem use the actual mesh for detection if done right.
-
I've had problems with the bounding boxes before with the Carrack. Not the same problems, mind you. I wanted to have the turret model really big so that when it blew up it took a chunk out of the ship, but the interpreted turret would actually be really small. Visually it was convincing, but the target's bounding box betrayed the real size of the turret mesh.
As far as I could tell, there is no way to manually alter the size of a bounding box. In your case, however, the mesh might have some stray vertices lying about.
-
I've had problems with the bounding boxes before with the Carrack. Not the same problems, mind you. I wanted to have the turret model really big so that when it blew up it took a chunk out of the ship, but the interpreted turret would actually be really small. Visually it was convincing, but the target's bounding box betrayed the real size of the turret mesh.
I reckon you could do some very clever POF-ing to make that work... at worst, you would end up using Lua-scripting to destroy the larger hull section whenever the turret went down.
-
How does the integrity of the mesh come into it? I can't guarantee that there aren't any problems, of course, and I'll definitely look into it, but I don't get it.
Is it possible that you misunderstood? My shots aren't 'flying through' the ship. There are no collision errors. But when my shots hit the hull of the warship that lies within the limits of the turret bounding box, damage gets carried to the turret.
*snipped picture*
as i've said, check your mesh thoroughly. bounding boxes are determined on the maximum distance of points, edges and polygons from the objects center. either your object center is out of whack or you have extraneous poly's/points/edges somewhere.
provide the pof and an .obj of the offending file so that we can check.
-
Be my guest! :)
Clicky (http://www.mediafire.com/file/rm91n1fsy4kzp7u/Troubleshoot.rar)
The POF is still WIP, so many turrets do not have subobject info yet. What you wanna check are the 'chains' of hexagons in the sides of the ship.
I could provide a .tbl entry as well, if you think you need it.
-
oh.. dear.. god...
dude, no offense, but forget the way you did turrets till now, and just observe retail pofs.
IIRC, max firepoints per turret is 3, otherwise engine doesnt give a flying one.
for sanity's sake, do you have the latest mediavp's? if you do, open the GTD Orion and observe how all of its turrets are composed and then apply said stuff to your model while pofing.
the geometry doesnt have anything that should **** up the bounding boxes, so my guess is that the turrets get damaged a lot is because the firing points expand the bounding box.
also, it crashed PCS2 for me when viewing one turret, but no biggie there.
add me on msn if you have it, i can guide you thru the process of turreting
-
IIRC, max firepoints per turret is 3, otherwise engine doesnt give a flying one.
Wrong. Max number of firingpoints is 10.
-
IIRC, max firepoints per turret is 3, otherwise engine doesnt give a flying one.
Wrong. Max number of firingpoints is 10.
thats something i didnt know.
amusing :D
*thinks about a 10 FP 2-part beam turret...*
*my brain asplode*
-
Yep. Max number is 10. That much I checked before even working on the mesh.
@pecenipek: No offense taken. But I do know something about turreting. :p
And I know which turret you mean (the one that crashed PCS2). It does that for me too. Its mesh has flipped normals. I fixed the issue in the original mesh and next export will be OK.
But that still doesn't solve my issue. If it's the firing points that expand the bounding box, then they shouldn't, because I did everything by the book.
Is the issue solvable, or will I have to live with it? Because I can live with it. I just don't want to.
-
Something is wrong with the bounding boxes of those turrets according to PCS2. In fact almost every bounding box including detail0. They all seem shifted to starboard. o_O
I'd say it's the result of a bad conversion - what format was it converted from or which program?
Edit: Correction - some bounding boxes for objects that are NOT on the ships centreline are shifted either too far (always along the X axis) towards or away from the centreline. Quite odd.
-
Huh. You know, I never noticed.
Bad conversion is possible, but unlikely. Conversion was from Blender to PCS2 via .dae format.
I even followed the instructions!
-
oh yes its very very possible. even when following instructions :p
-
Which app was used to build the model? I ask cos I've never once encountered this sort of issue on any model built in blender, but very often from models originating from other apps, even if they go through blender prior to conversion.
-
Oh ho!
but very often from models originating from other apps, even if they go through blender prior to conversion.
Got our culprit right there, mesa thinks. Model was built in Max 7, but I switched to Blender halfway through, because I like Blender more. :p
Exported it via .3ds I think (don't really remember, because I did it ages ago).
BUT!
Only detail-0 was created in Max. Turrets were all Blender.
I re-exported the mesh, and the bounding boxes seem right, now. But I haven't tested the model in game yet.
@VasAdm: how did you solve the issue?
-
Max _weapons_ per turret is 3 I think, I believe that's where the confusion came from. You can have 3 banks of weapons, across 10 firepoints, per turret. But in FotG we should only need one weapon per turret, so even our octuple turrets should be able to fire 8 blasts of death :)
-
You can have up to 3 banks of primaries and up to 4 banks of secondaries in a turret. You can also have up to 10 firingpoints in a turret.
-
You can have up to 3 banks of primaries and up to 4 banks of secondaries in a turret. You can also have up to 10 firingpoints in a turret.
So it's like a turret-mounted fighter with unlimited ammo!
-
No you only get 10 fire points total. On primaries and secondaries you can have more.
-
You can have up to 3 banks of primaries and up to 4 banks of secondaries in a turret. You can also have up to 10 firingpoints in a turret.
Uh. problem... there are only 3 turret slots per class (primary/secondaries), per turret in FRED. How would you assign the 4th slot?
-
I don't really know what techniques specifically stamp out that bounding box shift behaviour, but this is what has worked on a wide variety of bugs:
1) Extensive use of the 'select non manifold' function to iron out geometric impossibilities. Kill off double verts, holes in edges, unintentional floating polys and other weirdness. When it's clean, the only edges that should get selected with that tool are the edges of small floating greebles. Ie, if you then pressed ctrl+L to select everything physically linked to the current selection, only those small greebles should get selected. NOT the main hull.
2) Select all geometry objects and press Ctrl + A and apply scale and rotation to object data for everything. This is cos it's easy to forget which individual subobjects may have changed rotation or scale since the last time it was done, so it's an important clean-up step prior to any conversion.
3) For each object, enter edit mode, select all and recalculate normals to be on the outside (Ctrl + N). This is probably the biggest cleaner-upperer, but without step 1 having been done chances are it won't be that helpful.
4) For each subobject excluding the rotating ones that already have specifically positioned centres, use the 'Centre New' buttons in the edit tab to ensure the subobject centres are where they should be.
-
Thanks VA.
Steps 2, 3 and 4 I'd done before first export. I'd been removing double verts and other nasty stuff regularly, but I don't remember if I did it exactly prior to conversion. Did it now, though. Still haven't tested the model in-game (not much free time) but the turrets' bounding boxes in PCS2 seem right.