Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Tools => Topic started by: Goober5000 on November 07, 2010, 03:41:55 pm
-
A situation has come up repeatedly in my modding experience where it would be useful to find out the differences between two POF models. Mostly this is because we have two models that appear identical but which have different dockpoints, or different paths, or some sort of obscure modification to the POF data that none of the modders can remember.
I thought it might be cool to create a diff tool to compare the difference between two models, but there are already a number of very good diff tools available today, and it seems a shame to create a new one from scratch. Then I realized that if the POF were somehow converted to text format, one could simply run an existing diff tool on the text form of the POF.
So, is it possible for PCS2 or some other tool to do this? Can the PMF format, for example, be easily saved to XML form? XML would seem to be the best text format to use, as it most closely corresponds to the chunk tree layout of the existing binary object.
This would also allow the enterprising modder to tweak some aspect of the POF without having to load up the modelling program, in the same way that a mission can be tweaked in a text editor without loading it up in FRED. Of course, he would need to know what he's doing. :)
-
Why not Collada dae? Max has it listed as XML.
-
Collada IS XML.
-
Ah, well, there you go. :)
Now if I can only find a version of PCS2 that doesn't trigger the "Array out of bounds" error, I'll be all set.
-
|
| If it doesn't work, file a bug or something.
V
-
Only problem with that is that you're not guaranteed to get a 100% identical representation of the POF data in the Collada format. For one, there isn't even any BSP info at all. Even PMF doesn't have that. We'd need a way to dump to an XML file that contains _all_ POF data chunks, or some other type of dump that can be compared with a text diff tool. Or, we'd need a tool specifically for comparing the binary files.
-
I would have thought BSP info, as generated data, shouldn't matter. Collada should retain almost everything else.
Perhaps more annoying is that ordering of xml nodes is non-deterministic.
-
It is generated info, but since it's been generated by different methods over the years, different versions of PCS2, etc, if that was the only difference between models, I'd definitely want to know that was causing any observed behavioral difference.
-
|
| If it doesn't work, file a bug or something.
V
On exporting to DAE and re-importing, the "$engine_subsystem=Engine" line gets dropped from the thruster properties.
-
Is there a subsystem called Engine?
-
There is. The bug occurs for ships with multiple engine subsystems as well.
-
Is it called engine or Engine?
-
Doesn't matter, happens regardless of capitalization. Test model (Hecate) attached.
[attachment deleted by admin]
-
It should be =$engine01 instead of =engine01 really. It shouldn't cause a problem anymore.
-
Amusingly enough, wanting to compare BSP data rules PMF out of consideration. PCS2 has only been saving 4 bytes of BSP data per subobject.
-
I didn't think any BSP data was supposed to be saved in PMF.
-
Originally it wasn't saved in PMF, but was added later.
-
O R'lyeh? That's news to me. Still, there's no guarantee that converting to PMF and back to POF won't somehow affect the data, so converting before comparing files might not work consistently. We could still use some sort of analyzer that works on POF files as is I think, to meet the request in this thread at least.
-
As I mentioned earlier, while PCS2 is storing some BSP data now, it's only storing at most 4 bytes per subobject.
-
Any reason it does, but only 4 bytes? That a bug or something?
-
Yeah, it's a bug. It essentially does write(bsp_data, sizeof(bsp_size)) instead of write(bsp_data, bsp_size). It's a fairly simple fix but requires a PMF version bump.