Unofficial PAPA file format

Discussion in 'Mod Support' started by LennardF1989, June 4, 2013.

  1. mot9001

    mot9001 Well-Known Member

    Messages:
    833
    Likes Received:
    650
  2. DeathByDenim

    DeathByDenim Post Master General

    Messages:
    4,325
    Likes Received:
    2,118
    Ah, yeah. I probably know why that is. Skyboxes are in the A8R8G8B8 format, but papatran most likely converted your PNGs to DXT5. That format is a lossy format and reduces the quality quite a bit. They way I did it previously was rather hacky because I didn't know yet how papatran worked, so I just hardcoded my papa editor to write the A8R8G8B8 data to position 0x80 in the file. When I further developed the code, I took that part out of course. The version that is on GitHub now does have support for writing A8R8G8B8, but I haven't made any binaries for it yet. I'll see if I can get a somewhat stable version out.

    In the mean time, you can try editing the file "<PA Installation Directory>/media/pa/default.settings". It contains a field called
    Code:
    texture-format-alpha: dxt5
    I'm just guessing right now, since I can't test it at the moment, but you might be able to get away with changing that to
    Code:
    texture-format-alpha: a8r8g8b8
    Also, use the sample mod on GitHub. That way you don't have to overwrite game files and your custom skybox can simply be turned on and off from PAMM.
    Last edited: February 11, 2014
  3. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
    Wow, that looks great! I packaged it up for PAMM for you and I can upload it too if you want. Just copy the folder inside the zip to ~\Uber Entertainment\Planetary Annihilation\mods\.

    Attached Files:

  4. maxpowerz

    maxpowerz Post Master General

    Messages:
    2,208
    Likes Received:
    885
    Edit.
    The Forum saved a post that i wrote yesterday and posted it today when i went to write a new post..
    hmmm
  5. zweistein000

    zweistein000 Post Master General

    Messages:
    1,360
    Likes Received:
    727
    I'm probably the least educated on black magic you are talking about here in this topic. I'd like to convert 2 .png files into .papa files. To which demon must I present a blood offering of 100 virgins and my soul to do that.

    I'd like detailed idiot proof instructions, if possible, thank you.
  6. DeathByDenim

    DeathByDenim Post Master General

    Messages:
    4,325
    Likes Received:
    2,118
    You'll need papatran for that, which in turn depends on a default.settings to be present. So the easiest way is to just copy the png's to where you want the papa's to be. Then run papatran from the media directory. For example, suppose you want to make a nifty texture for the orbital factory. Copy the nifty.png to <PA Install dir>/media/pa/units/orbital/orbital_factory. Then from the command line, cd to <PA Install dir>/media and call papatran like this:
    Code:
    ../tools/papatran pa/units/orbital/orbital_factory/nifty.png -o pa/units/orbital/orbital_factory/nifty.papa
    (Change the '/' to '\' if you are using Windows)

    I'll just take the soul now.
    zweistein000 likes this.
  7. zweistein000

    zweistein000 Post Master General

    Messages:
    1,360
    Likes Received:
    727
    great, you just told me how to make my MEX stand out without icons. Now It's up to uber to find the pesky bug that makes mex icons not show up on AMD HD 4xxx graphics cards.
  8. brandonpotter

    brandonpotter Well-Known Member

    Messages:
    966
    Likes Received:
    389
    When is there gonna be a plugin, or a script for 3D Studio Max?

    Im dying to get my commander done, rigged, and textured, so I can show it off to people :p
    meir22344 likes this.
  9. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    So a random though I am hunting after right now:
    Understand papa enough to write a program that goes through it and scales all coordinates in the model (and in the bones so the animation stays correct as well?) to change the scale of the unit.

    I am not very well versed with 3D models in general, is this a feasible approach?

    EDIT:
    @raevn
    Looking at old threads you seem to be pretty successful with turning TA models into PA models. To do that you should have the knowledge I am looking for, could you link me the newest info available? :>

    EDIT 2:
    I have not yet touched the bones, but this looks promising.
    Scaled down osiris commander:
    [​IMG]
    Last edited: September 21, 2014
  10. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,323
    Off the top of my head, it shouldn't require anything more than just multiplying all the coordinates of both the triangles & bones, so it's very feasible.

    Attached is the most up-to-date 010 editor template I have; also refer to the import/export scripts from the Blender importer. If you let me know more about what you are doing, I can provide more help (eg., what language will it be in etc.)

    Actually, I think you might be able to script blender to do this (import PAPA, apply scale & export). Unfortunately this will suffer from the rotated bones issue, but for many units that would be a quick approach.

    Attached Files:

    cola_colin likes this.
  11. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    I am fine with writing a java or maybe scala program to handle the bitfiddeling, I just need to know which bits and bytes to multiply :) Thanks, the 101 templates look like I understand them.
  12. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,323
    Updated template with fix for Bot Factory

    Attached Files:

  13. mikeyh

    mikeyh Post Master General

    Messages:
    1,882
    Likes Received:
    1,535

Share This Page