Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Tools => Topic started by: JGZinv on February 14, 2012, 02:42:07 pm

Title: Paid Bounty - Model Extractor Fixed/Updated
Post by: JGZinv on February 14, 2012, 02:42:07 pm
I'll cut to the chase...  I've got $275 USD to spend towards having an old model extractor program overhauled
so it spits out geometry, textures, and UVs correctly. I'm offering the job here and elseware to try and get a bite.

The extractor is for Tachyon the Fringe's old PAK archive format. It is not a "normal" PAK or one that can be opened
with any of the other PAK tools out there. that I've located.

The existing extractor was made in VisualBasic 6 circa 2001, and has a dev log of the author brute forcing his way though
some example files. I have the source as well of course. I don't care what the final program is written in if you want to port the
code over or start from scratch - it just needs to work. I'm not even worried if it has a GUI. I just need to know how to use it, and
it preferably run in Windows (Linux might work too if we absolutely "must").

It does have some problems, namely:

OBJ exports are unreadable in anything besides Deep Exploration due to the author commenting every other line.  - fixed by Goober
Scale of the exported objects is approximately planet to galaxy size, not fighter size.
There may be some issues with geometry skewing.  - Item removed due to there not being a way to prove or disprove errors.
The PCX textures export, but are not exported correctly to be viewable by anything but DE again. PCX are viewable in hex easily enough.  - fixed by Goober
UV maps are pretty much unfinished, the author says it the log he couldn't figure out the math to finish extraction.
There are some Array Out of Bounds errors, so on a handful of models it will crash on processing.


There are two things I'd like to see in the way of added features to the extractor:

1. Read a text file and place the relevant object pieces in XYZ space, in a single OBJ, after the source files have been initially extracted.
In Tachyon any large object is held together with an OCF or Object Combination File, which is text. I've already figured out pretty much everything
as to what does what in the file. But some bases and ships are 100 to 200 pieces (more like 14 unique parts repeated) arranged. I'd really really like to avoid
having to place everything by hand. I don't need the pieces physically connected or setup with subsystems, just oriented and placed correctly.

2. Batch mode. There's 1160 PAK files. It'd be nice if I could just aim it at a directory and it'd start at A and work to Z. I already extracted everything I could
one by one (sometimes 2 and 3 times), and that takes a long long time to do.
  - fixed by Goober


A nice wish would be if I could reimport things back into PAK for use in Tachyon, but I'm not holding out hope for something that complicated.
We could rennovate Tachyon and test things a lot easier though if it was possible.


In any case, getting this fixed would mean we could cut another 3 to 4 years of model fabrication off our FringeSpace project. They aren't the prettiest models
in the universe, but a lot can be done later to make it better, and there's a lot of improvements just moving to FSO in the lighting dept. alone.


Here's example files, and the PAK extractor itself with all it's related files... if you want to take a look.

http://files.fringespace.org/jgz/Pakextractor/PAK%20Extrator%20Package.zip (http://files.fringespace.org/jgz/Pakextractor/PAK%20Extrator%20Package.zip)

An OCF file decrypted:
http://files.fringespace.org/jgz/Pakextractor/GALCRUIS.txt (http://files.fringespace.org/jgz/Pakextractor/GALCRUIS.txt)


If you think you can do what we need, please contact me.

Title: Re: Paid Bounty - Model Extractor Fixed/Updated
Post by: Goober5000 on February 16, 2012, 11:42:14 am
Visual Basic 6 for the win! :D  I might take a look at this.
Title: Re: Paid Bounty - Model Extractor Fixed/Updated
Post by: JGZinv on February 16, 2012, 11:47:46 am
The offer is still open... so go ahead. ^_^
Title: Re: Paid Bounty - Model Extractor Fixed/Updated
Post by: Colonol Dekker on February 16, 2012, 11:55:18 am
I get the feeling that a few others are already feverishly beavering away digesting the challenge. :yes:
Title: Re: Paid Bounty - Model Extractor Fixed/Updated
Post by: JGZinv on February 16, 2012, 12:04:07 pm
Well then they're welcome to say something or ask questions.

I don't want to come off as rude saying it this way, but I really don't care how it gets done, I just need it working.
Been going around and around for a couple months now trying to find someone. You get tired of getting stonewalled
after a while. Going to have to start using dye for all these gray hairs I'm making...
Title: Re: Paid Bounty - Model Extractor Fixed/Updated
Post by: Rga_Noris on February 16, 2012, 12:46:33 pm
Open jobs like this are seldom a good idea when multiple people take the challenge. Who gets the bounty? I would advise any programmer to consider the terms here... You could make a program, bring it close to completion, and then lose all the cash because someone beat you to the punch. Or you complete it, and before receipt of the money, someone makes a better one, and your out. Unless you get an exclusive deal to develop this program, this is a poor way to spend time for anyone who really wants/needs the money. If the money is not your prime motivator, then have at it. Sorry JGZinv, but that could be the root of your troubles. Too risky.
Title: Re: Paid Bounty - Model Extractor Fixed/Updated
Post by: JGZinv on February 16, 2012, 01:25:32 pm
Right now people are just looking at it as to if it's do-able or not.

I've yet to be contacted directly or anyone say they can actually do the job.

When it comes down to that, I'll pick one person, if we get one, to do the job and receive the payment.

Unless people want to do it as a collaborative thing and split up the funds equally or donate it to HLP or something
of that nature. But we still need someone to first decide they can do it...
Title: Re: Paid Bounty - Model Extractor Fixed/Updated
Post by: Rga_Noris on February 16, 2012, 02:12:55 pm
I see. Some of the posts made it sound like a compitition was going on. All seems well ans foof.
Title: Re: Paid Bounty - Model Extractor Fixed/Updated
Post by: Goober5000 on February 16, 2012, 09:53:27 pm
Oh come on.  I opened up the source code and this is the first thing I see:
Code: [Select]
  If Option1(0).Enabled Then
    doStuff (i)
  Else
    If Option1(1).Enabled Then
      doStuff (i - 1)
    Else
      If Option1(2).Enabled Then
        doStuff (i - 2)
      Else
        If Option1(3).Enabled Then
          doStuff (i - 3)
        End If
      End If
    End If
  End If
Title: Re: Paid Bounty - Model Extractor Fixed/Updated
Post by: JGZinv on February 16, 2012, 10:17:58 pm
Don't look at me... I've been told it was buggy. 
Title: Re: Paid Bounty - Model Extractor Fixed/Updated
Post by: Goober5000 on February 16, 2012, 10:54:25 pm
But that's not a bug, that's just bad coding.  It could easily be written as a loop.
Title: Re: Paid Bounty - Model Extractor Fixed/Updated
Post by: JGZinv on February 17, 2012, 02:45:42 am
Additional OCF files per Goober request.

http://files.fringespace.org/jgz/Pakextractor/thregaton.txt
http://files.fringespace.org/jgz/Pakextractor/RCASINO.txt
http://files.fringespace.org/jgz/Pakextractor/HVYFRTR.txt
http://files.fringespace.org/jgz/Pakextractor/GALCRUIS.txt

And for a bonus... JGZ's OCF guide...

Code: [Select]
Tachyon OCF File Format:


Information:

[HEADER] Generic comment label.
NAME = THREGATON Name of structure/ship/object.
NUMPAKS = 13 Number of unique model files used.
NUMPARTS = 45 Number of total structure parts (copies & unique) used.


[PAKS] List of models used in structure.

PAK = SPSHIELDGEN,SGENTR.PAK,SGENTR.PAL,2,5 Name model will be referenced as in rest of file,
actual model file, related palette color file,
unknown values (XY?).


[PART_05] "Overall Piece" number range from 00 and up.
NAME = SPTUR1_017 Unique name used to identify each piece (copies are given a number extension).
PAK = SPTUR1 PAK file name for the model and textures used.
SCALE = 2 Scaling multiplier applied to whole piece, unknown size unit increment. Need to test.
ATTACH = SPLEFT_WING_001,5,0 Parent piece (assuming centerpoint based), Y axis?, Z axis?
ANGLES = 353,180,90 X? , Y?, Z? Rotation. Not sure about correct order yet, needs testing.
TYPE = 2 See Type list below. Essentially sub-system labeling.
SUB_TYPE = 0 Sub category of the above.
SOUND_LOOP = BODY Audio file name referenced in another master file for ambient external sounds.


Type 0 - Hull Pieces
Type 1 - Ship Head (cockpit?)
Type 2 - Turrets (has sub_type for different turret styles - 0 to 7)
Type 3 - ???
Type 4 - Ship Weapon Generator
Type 5 - Ship Shield Generator
Type 6 - Ship Engines
Type 7 - Launching Dock (has additional launch_dock entry with coordinates)
Type 8 - Landing Dock (has additional land_dock entry with coordinates)
Type 9 - Ship Power Generator
Type 10 - ???
Type 11 - ???
Type 12 - Base Comm Array
Type 13 - ???
Type 14 - Base Credit Plant (has additional entry CREDIT_POWERPLANT = number)