Author Topic: Proposal: POF <--> XML  (Read 3973 times)

0 Members and 1 Guest are viewing this topic.

Offline Goober5000

  • HLP Loremaster
  • 214
    • Goober5000 Productions
Proposal: POF <--> XML
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. :)

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Proposal: POF <--> XML
Why not Collada dae?  Max has it listed as XML.
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 

Offline Kazan

  • PCS2 Wizard
  • 212
  • Soul lives in the Mountains
    • http://alliance.sourceforge.net
Re: Proposal: POF <--> XML
Collada IS XML.
PCS2 2.0.3 | POF CS2 wiki page | Important PCS2 Threads | PCS2 Mantis

"The Mountains are calling, and I must go" - John Muir

 

Offline Goober5000

  • HLP Loremaster
  • 214
    • Goober5000 Productions
Re: Proposal: POF <--> 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.

 

Offline Spicious

  • Master Chief John-158
  • 210
Re: Proposal: POF <--> XML
 |
 | If it doesn't work, file a bug or something.
 V

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Proposal: POF <--> XML
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.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline Spicious

  • Master Chief John-158
  • 210
Re: Proposal: POF <--> XML
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.

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Proposal: POF <--> XML
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.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 
Re: Proposal: POF <--> XML
|
 | 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.

 

Offline Spicious

  • Master Chief John-158
  • 210
Re: Proposal: POF <--> XML
Is there a subsystem called Engine?

 
There is. The bug occurs for ships with multiple engine subsystems as well.

 

Offline Spicious

  • Master Chief John-158
  • 210
Is it called engine or Engine?

 
Doesn't matter, happens regardless of capitalization. Test model (Hecate) attached.

[attachment deleted by admin]

 

Offline Spicious

  • Master Chief John-158
  • 210
It should be =$engine01 instead of =engine01 really. It shouldn't cause a problem anymore.

 

Offline Spicious

  • Master Chief John-158
  • 210
Amusingly enough, wanting to compare BSP data rules PMF out of consideration. PCS2 has only been saving 4 bytes of BSP data per subobject.

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
I didn't think any BSP data was supposed to be saved in PMF.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline Spicious

  • Master Chief John-158
  • 210
Originally it wasn't saved in PMF, but was added later.

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
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.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline Spicious

  • Master Chief John-158
  • 210
As I mentioned earlier, while PCS2 is storing some BSP data now, it's only storing at most 4 bytes per subobject.

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Any reason it does, but only 4 bytes?  That a bug or something?
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays