Results 1 to 30 of 54

Thread: xpak Tutorial

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    CeltiberoRamiroI Member Monkwarrior's Avatar
    Join Date
    Apr 2004
    Location
    Salduie/Caesaraugusta/ Sarakusta/Saragossa
    Posts
    828

    Default Re: xpak Tutorial Request

    Quote Originally Posted by Myrddraal
    vale, you don't need to repack the files, it won't run any smoother for it. In fact if you want to distribute you mod it saves space not to repack as you can upload only the files you edited...
    It is true that you don't need to repack the files, but if you modify the files included in the packs, those files won't work for the users of the mod having the paks still packed.
    This is the case, for example, of the faction symbols appearing in the ui interface.
    However, I've just found something really interesting (sorry if this was already known). We can easily make new patches for the game . I asked some time ago about a method for this purpose. But it was too complicated and required several software programs.
    I thought: let's try easier! This is the step-by-step procedure:

    1) New folder in the desktop (I named it: test) with a copy of xpak.exe, a copy of samplePak.bat, a new txt file named patch_1.txt and another folder named patch_1.
    In this folder I put the data subdirectory with the required structure. In my case the test was only: data\ui\captain banners and data\ui\roman\interface.

    2) This is the content of patch_1.txt:
    Code:
    patch_1.pak
    patch_1\data\ui\captain banners\captain_card_armenia.tga
    patch_1\data\ui\captain banners\captain_card_britons.tga
    patch_1\data\ui\captain banners\captain_card_carthage.tga
    patch_1\data\ui\captain banners\captain_card_germans.tga
    patch_1\data\ui\captain banners\captain_card_pontus.tga
    patch_1\data\ui\captain banners\captain_card_spain.tga
    patch_1\data\ui\captain banners\captain_card_thrace.tga
    patch_1\data\ui\roman\interface\sharedpage_01.tga
    patch_1\data\ui\roman\interface\stratpage_02.tga
    3) I opened samplePak.bat with notepad (I don't know any other method ) and I changed it to this content:
    Code:
    xpak.exe -v -pf patch_1.txt
    4) I run samplePak.bat (simply by clicking on it) and patch_1.pak was created almost inmediately.

    5) I copied this file in Data\packs and the symbols are now visible in all the user interface positions.

    I hope this will be of help to include more easily modifications in the files contained in the packs.

  2. #2
    aka AggonyAdherbal Member Lord Adherbal's Avatar
    Join Date
    Oct 2004
    Location
    Belgium
    Posts
    1,014

    Default Re: xpak Tutorial Request

    thanks matey, this will save me a lot of time
    Member of The Lordz Games Studio:
    A new game development studio focusing on historical RTS games of the sword & musket era
    http://www.thelordzgamesstudio.com

    Member of The Lordz Modding Collective:
    Creators of Napoleonic Total War I & II
    http://www.thelordz.co.uk

  3. #3

    Default Re: xpak Tutorial Request

    Quote Originally Posted by Monkwarrior
    It is true that you don't need to repack the files, but if you modify the files included in the packs, those files won't work for the users of the mod having the paks still packed.
    This is the case, for example, of the faction symbols appearing in the ui interface.
    This is really very helpful information Monkwarrior, thank you. I have a couple of points to add, resulting from my own experiments with this approach.

    - The game engine will only read data from one supplementary .pak archive. It must be named "patch_1.pak".

    So it will not recognise additional archives with names like "mymod.pak", or even "patch_2.pak", sadly. This prevents this from being a very useful way of overlaying consecutive data changes, made by several successive mods, for example.

    - The game engine does not seem to recognise replacement text files stored in "patch_1.pak".

    Adding replacement text files such as "desc_strat.txt" to the archive caused a CTD in my tests. This is a shame, since it would have allowed all of a mod's data to be presented as a single patch archive.

    If anyone discovers different results to these, I would be very interested to know about it. :)

  4. #4
    CeltiberoRamiroI Member Monkwarrior's Avatar
    Join Date
    Apr 2004
    Location
    Salduie/Caesaraugusta/ Sarakusta/Saragossa
    Posts
    828

    Default Re: xpak Tutorial

    Thanks for the info Nigedo.
    Yes, unfortunately this method seems to be a little limited.
    I thought that it would be possible to do next patch_2.pak, patch_3.pak and so on. Did you tried patch_2 alone or with a patch_1 present?

    About txt files, my idea was that only the files already present in the paks were suitable for patch_1.pak. And your finding confirms my idea.

    I have other bad news. I tried to make a large patch_1.pak with all the new unit cards and infos I made. However, the game was showing different cards each time I opened the unit selection pannel. This happened in spite of having revised the directory hundreds of times to confirm all the files were listed properly.

    In view of that I'm using patch_1.pak only for a reduced number of files, mainly (or only) those that can't be renamed.

  5. #5

    Default Re: xpak Tutorial

    Quote Originally Posted by Monkwarrior
    I have other bad news. I tried to make a large patch_1.pak with all the new unit cards and infos I made. However, the game was showing different cards each time I opened the unit selection pannel. This happened in spite of having revised the directory hundreds of times to confirm all the files were listed properly.
    Ah. That doesn't bode well.

    I was hoping to use this method to tightly package all graphical replacements for a mod I'm working on.

    We should try to research thoroughly the limitations of patching and publish them in a new comprehensive guide on the subject, I think. Too busy at the moment to look into it further, but I will at some point. :)

  6. #6
    CeltiberoRamiroI Member Monkwarrior's Avatar
    Join Date
    Apr 2004
    Location
    Salduie/Caesaraugusta/ Sarakusta/Saragossa
    Posts
    828

    Default Re: xpak Tutorial

    Quote Originally Posted by Nigedo
    I was hoping to use this method to tightly package all graphical replacements for a mod I'm working on.
    Me too.

    Quote Originally Posted by Nigedo
    We should try to research thoroughly the limitations of patching and publish them in a new comprehensive guide on the subject, I think. Too busy at the moment to look into it further, but I will at some point.
    I hope you find time to do it. I imagine the correct method would be to increase step by step the size of the patch_1.pak in order to find the limit.
    In any case, take this problem report with caution. Perhaps I made a mistake somewhere.

  7. #7

    Default Re: xpak Tutorial

    Sorry, I missed this question previously.

    Quote Originally Posted by Monkwarrior
    Did you tried patch_2 alone or with a patch_1 present?
    I tried it both alone and with a "patch_1.pak" installed.

    My guess is that the changes CA made to the game engine with patch 1.2 included an update to a hardcoded pointer that directs the engine to compile data from the current and next numbered "patch_x.pak" archive. Adding "patch_1.pak" does not increment this internal pointer, so further numbered (or named) patches are not compiled.

    I think you are quite correct in the approach you outlined for testing the limits of patching. I will surely give it a go when my mod is ready for packing.

  8. #8
    Axebitten Modder Senior Member Dol Guldur's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,550

    Default Re: xpak Tutorial

    Which elements of the game in 1.3 and BI now need the use of pak files in order to be modded?
    "One of the most sophisticated Total War mods ever developed..."

  9. #9
    CeltiberoRamiroI Member Monkwarrior's Avatar
    Join Date
    Apr 2004
    Location
    Salduie/Caesaraugusta/ Sarakusta/Saragossa
    Posts
    828

    Default Re: xpak Tutorial

    Bad news, mates.
    The 1.5 patch for RTW has a patch_1.pak in packs folder.
    So if you want to include new files, you must unpack this, include the new files and repack.

    @Dol Guldur

    It is necessary for all the files included in the original packs and whose name cannot be changed.
    In my case I'm using it for:
    model_strat\textures\#banner_symbol_factionname.tga.dds
    ui\ROMAN\INTERFACE\different files
    ui\CAPTAIN BANNERS\CAPTAIN_CARD_FACTIONNAME.tga
    ui\UNITS\FACTIONNAME\#UNITNAME.tga
    ui\unit_info\factionname\UNITNAME_INFO.tga
    (these two last cases only for those units that keep the original name, but change the cards)

  10. #10
    Axebitten Modder Senior Member Dol Guldur's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,550

    Default Re: xpak Tutorial

    Quote Originally Posted by Monkwarrior
    Bad news, mates.
    The 1.5 patch for RTW has a patch_1.pak in packs folder.
    So if you want to include new files, you must unpack this, include the new files and repack.
    Yeah, I noticed - so it so with 1.6 too.

    @Dol Guldur

    It is necessary for all the files included in the original packs and whose name cannot be changed.
    In my case I'm using it for:
    model_strat\textures\#banner_symbol_factionname.tga.dds
    ui\ROMAN\INTERFACE\different files
    ui\CAPTAIN BANNERS\CAPTAIN_CARD_FACTIONNAME.tga
    ui\UNITS\FACTIONNAME\#UNITNAME.tga
    ui\unit_info\factionname\UNITNAME_INFO.tga
    (these two last cases only for those units that keep the original name, but change the cards)
    Thx. I'm using it for a lot more than that and I seem to remember reading that the file had some limit as to how much it could contain (?)
    "One of the most sophisticated Total War mods ever developed..."

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO