Results 1 to 10 of 10

Thread: PFM's new Mod Compatability Features

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default PFM's new Mod Compatability Features

    Hi,
    I just uploaded PFM version 2.4 containing new functions to improve your mods' compatability with others.

    A prevalent question in the Workshop comments is "Is this compatible with Radious/DarthMod"? So compatability is kind of a major "selling point" for smaller mods, and with Steam Workshop support, it's very possible that we'll see several minor mods addressing different aspects of the game; if a player wants to use several of them, it's good to have each one only change the data they actually mean to modify.

    One of the things that makes mods incompatible with each other is that they're working on the same DB table: If the DB files have the same name, the game will only load data from one of them (although I'm not 100% sure about that). If that file contains all lines from the original game, including ones changed by another mod, that mod's changes will be overwritten.

    This is where PFM's new features "Rename all Files" and "Minimize DB files" (found in the Postprocess menu) come in.
    - The "Rename All Files" will prompt for a prefix to prepend to your mod's files' names (like aum_).
    This will put that string in front of all files in the pack, minimizing the chance that another mod will overwrite the file (or be overwritten by it).

    - The "Minimize DB files" removes all data rows from the db/ tree in the pack that have not changed from the game files.
    This will ensure that only the lines you edited will get loaded; the other data is already present, so no need to load it again anyway; it would only overwrite other mod's changes to it.


    Let's look at an example.
    Mod ashigaru_reprice changes the cost of ashigaru upkeep to half. This means that in the table units, there are lines like yari_ashigaru...40 (for the upkeep). Samurai entries have not been changed by the mod.

    Mod samurai_buff adds additional attack values to Yari and Katana Samurai. This means, there are lines like yari_samurai...12 (attack value) and katana_samurai...15. Here, Ashigaru entries have not been modified.

    What modders usually do is to edit the units table, change the values they want, save the pack and put it up as their mod. Now for our two mods, if both keep "units" as the name of their changed table files, the game will load both of them, so the one that gets loaded later will overwrite changes by the first.

    So here's what our modders do: the first chooses "Rename files" in PFM and enters arm_ (for "ashigaru reprice mod"). This will rename the units file into "arm_units". The second modder uses "sbm_ (for "samurai buff mod") for his rename, resulting in an "sbm_units" file.

    The game will still load both of them though, so the data still gets overwritten. So what each one does is use "minimize DB files". For "ARM", this will get rid of all non-Ashigaru units; for "SBM", this will remove all but the Yari and Katana Samurai lines. Now the files stand perfectly independent from each other and can both be used side by side.

    DB files that have not changed at all will be removed from the pack altogether; non-DB files will be left untouched. All this will _not_ overwrite your current pack file; the changes are opened with the name "optimized_<yourmod>.pack" so you can save it separately.

    This obviously doesn't prevent all incompatabilies; mods still may want to change the same lines (for instance, an Ashigaru Buff Mod would still conflict with ARM). But it does minimize the possibility for conflicts, and it won't hurt the mod's changes being applied at all.

    I'm not entirely sure the file name change is neccessary, but it's certainly a good idea (and not really much effort ). It's probably best to have a working pack, containing all data, and only use "minimize" before a release; this way, you still have the other entries you can edit, and the other tables you can look into. Also, you might need to keep track of indices that need to be unique with a file.


    This all works flawlessly with the smaller changes I've been doing; if you could comment how it works for you (I'd especially be interested in behavior for the larger mods), that would be great.


    TL;DR:
    Before releasing your mod, in PFM:
    - select the db folder, then in the "Postprocess" menu "Rename->Selected"
    - enter the prefix you want for your mod's files
    - select "Postprocess"->"Minimize DB Files"
    - save the pack
    Now your mod is as compatible as can be and still works on its own.
    Tools: PFM 4.1 - EditSF 1.2.0
    (Download PFM - Download EditSF)
    Warscape Modding Guide
    Join the PFM User Group on Steam to receive PackFileManager update notifications.

    Respecto Patronum

  2. #2
    AngryTitusPullo's Avatar Comes Limitis
    Join Date
    Jan 2006
    Location
    Kuala Lumpur
    Posts
    13,018

    Default Re: PFM's new Mod Compatability Features

    Will this works with startpos.esf changes too ?


    CIVITATVS CVM AVGVSTVS XVI, MMVI
    IN PATROCINIVM SVB Dromikaites SVB MareNostrum SVB Quintus Maximus
    Want to know more about Rome II Total Realism ? Follow us on Twitter & Facebook

  3. #3

    Default Re: PFM's new Mod Compatability Features

    Quote Originally Posted by LestaT View Post
    Will this works with startpos.esf changes too ?
    No. Startpos is a single file which gets loaded as a whole.
    Tools: PFM 4.1 - EditSF 1.2.0
    (Download PFM - Download EditSF)
    Warscape Modding Guide
    Join the PFM User Group on Steam to receive PackFileManager update notifications.

    Respecto Patronum

  4. #4

    Default Re: PFM's new Mod Compatability Features

    The "Minimize DB files" removes all data rows from the db/ tree in the pack that have not changed from the game files.
    This will ensure that only the lines you edited will get loaded; the other data is already present, so no need to load it again anyway; it would only overwrite other mod's changes to it.

    Wowwowowowow!

    Nice!

  5. #5

    Default Re: PFM's new Mod Compatability Features

    Thanks! This is exactly what I was looking for. I opened the pack I created with the Assembly kit and then used PFM to optimize and rename it.

    While we're on the subject of the assembly kit. Is it possible to do something similar using only the official tools? And what exactly are the differences between PFM and the official tools? Personally I only gave modding a try when the assembly kit had come out, so I never used anything but it. And now that I see PFM I'm kind of confused as to what was so revolutionary about CA's release of these tools. Can anyone enlighten me?

  6. #6

    Icon5 Re: PFM's new Mod Compatability Features

    Thanks! This is exactly what I was looking for. I opened the pack I created with the Assembly kit and then used PFM to optimize it and rename the tables.

    While we're on the subject of the assembly kit. Is it possible to do something similar using only the official tools? And what exactly are the differences between PFM and the official tools? Personally I only gave modding a try when the assembly kit had come out, so I never used anything but it. And now that I see PFM I'm kind of confused as to what was so revolutionary about CA's release of these tools. Can anyone enlighten me?

  7. #7

    Default Re: PFM's new Mod Compatability Features

    Quote Originally Posted by JSQuareD View Post
    Thanks! This is exactly what I was looking for. I opened the pack I created with the Assembly kit and then used PFM to optimize it and rename the tables.
    Yep, that's exactly how I do it

    Is it possible to do something similar using only the official tools?
    No. The Assembly Kit is part of the software toolkit used by CA, so it's mostly written towards their own requirements; and they always work on the full data set (so they don't run in the danger of leaving stuff out).

    And what exactly are the differences between PFM and the official tools? [...] now that I see PFM I'm kind of confused as to what was so revolutionary about CA's release of these tools. Can anyone enlighten me?
    Well the official tools were created by CA, PFM was created and is maintained by the community.
    Before the official tools came out, the information about what data goes where was mostly guesswork, try-and-error and incomplete. It did go pretty far in the end, but there still were things erroneous, missing, or incorrect; and that was after about 3 years after the original release. Still, the database editor you see now has made another jump ahead with release of the tools just because the last missing pieces could be put together.
    That goes for the DB tables; ESF (startpos) is even worse, because for that basically no information at all was available, and it was very easy to crash the game by editing a value in the wrong place (or only one although it is referenced somewhere else as well). Not to mention that there still were (and probably are) flat-out bugs in PFM which just gets it wrong in some cases.
    Tools: PFM 4.1 - EditSF 1.2.0
    (Download PFM - Download EditSF)
    Warscape Modding Guide
    Join the PFM User Group on Steam to receive PackFileManager update notifications.

    Respecto Patronum

  8. #8

    Default Re: PFM's new Mod Compatability Features

    Wow, thanks for the quick reply!

    So basically PFM can now do the exact same thing as the assembly kit, but it has a feature-set more tailored towards modding, while on the other hand being less reliable?

    Also, I noticed that tables in text/db were not minimized. Does this mean that when two mods both add units, these files will collide and cause only one of the descriptions to be loaded in game? How about when two mods both alter different existing unit descriptions?

  9. #9

    Default Re: PFM's new Mod Compatability Features

    Quote Originally Posted by JSQuareD View Post
    Wow, thanks for the quick reply!
    You posted just before my after-lunch refresh

    So basically PFM can now do the exact same thing as the assembly kit, but it has a feature-set more tailored towards modding, while on the other hand being less reliable?
    You could say that. I'm not really aware of anything unreliable though, if you come across anything, let me know.

    I noticed that tables in text/db were not minimized. Does this mean that when two mods both add units, these files will collide and cause only one of the descriptions to be loaded in game? How about when two mods both alter different existing unit descriptions?
    Yes, the loc files aren't optimized; I needed the feature for mods that didn't cause any loc entries, so I didn't know they were created. I will very probably include them later.

    And I'm not entirely sure how the game handles overlaying data. It is possible that it will load all entries with different primary keys from all files, regardless of name... try it, find out and let us know
    Tools: PFM 4.1 - EditSF 1.2.0
    (Download PFM - Download EditSF)
    Warscape Modding Guide
    Join the PFM User Group on Steam to receive PackFileManager update notifications.

    Respecto Patronum

  10. #10

    Default Re: PFM's new Mod Compatability Features

    thx for you Daniu this program is great
    Last edited by Gigantus; November 05, 2012 at 06:20 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •