Page 1 of 11 12345678910 ... LastLast
Results 1 to 20 of 210

Thread: ESF Editor 1.4.8

  1. #1

    Default ESF Editor 1.4.8

    Hey guys,

    I've updated the ESF Editor to be compatible with Shogun 2 and fixed one or two bugs.

    OUTDATED: use Daniu's EditSF

    This version is based on 1.4.5 by Erasmus777 and has the same features, but no node descriptions xml has been included because I don't know how accurate it would be, you guys can always make a new one, right? Or just use the one from the 1.4.5 version.

    Changes in 1.4.8:
    • Fixed a bug that would stop you from saving changes

    Spoiler Alert, click show to read: 

    Changes in 1.4.7:
    • Improved support for the Shogun 2 ESF format in accordance with taw's comments
    • Fixed another bug that could cause a corrupt ESF file when saving
    • Improved performance when browsing a file
    • Improved performance when saving

    Changes in 1.4.6:
    • Added support for new ESF format used by Shogun 2 (new magic number and ascii and wide strings are stored with id at the end of the ESF instead of the old in the middle of the other data)
    • Fixed bug that could cause a corrupt ESF file when saving
    • Added support for new data formats (another 16 bit short and two more binary data types)
    • Fixed crash when no node descriptions are available
    • Go to Shogun 2/Napoleon folder when they exist instead of Empire folders
    • Shows Shogun 2/Napoleon save games in the list when opening a save game


    Source code is available so if you find any bugs you can fix them yourself
    Last edited by just; August 31, 2012 at 03:13 PM.

  2. #2
    The Hedge Knight's Avatar Fierce When Cornered
    Artifex

    Join Date
    Oct 2009
    Location
    England
    Posts
    5,875

    Default Re: ESF Editor 1.4.6

    Thanks Just . Fantastic work as always.

  3. #3

    Default Re: ESF Editor 1.4.6

    You rock.

  4. #4

  5. #5

    Default Re: ESF Editor 1.4.6

    Quote Originally Posted by husserlTW View Post
    You are the man! +rep !
    Thanks again for your quick response. Though I have not tried it yet in action, I think we have at last a new esf editor for... Napoleon's regions.esf as well !!!
    Last edited by husserlTW; February 25, 2011 at 11:48 AM.




  6. #6

    Default Re: ESF Editor 1.4.6

    Great job!

  7. #7

    Default Re: ESF Editor 1.4.6

    "just" - you are my lord and saviour - thank you! I would rep you again but it won't let me.
    If deception is an art, then the world is full of artists!
    Trust No One!

  8. #8
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,313

    Default Re: ESF Editor 1.4.6

    Looking at source code, I can see a few issues:

    • Types 0x4e and 0x4f are arrays of strings / ascii respectively. They must be decoded and reconverted if you change string/ascii enumeration at the end of file. I don't know if you ever remove things from that enumeration, or rearrange it. esf2xml convert them correctly, but leaves unused entries to make esf->xml->esf conversion byte-exact, and therefore to make testing a lot easier.
    • S2TW's save games also contain node type 0x09. It's 8 bytes, always 0. It is probably one of: Uint64, Int64, or Double - no way to tell as long as all examples are all-zeroes. I've just discovered it and didn't have time to add support for it to esfxml.
    • ETW esfs never contained 0x03 (just another uint16 or uint16), but they contained 0x43 arrays in a few places - and at least we know for sure how to decode them. esfxml still doesn't decode 0x43 short arrays.

    By the way none of BInary4X types are "binary data" - they're all arrays of basic types.
    OK, Binary46 is array of bytes, so it's *technically* binary data, but in any case all should be supported.

  9. #9

    Default Re: ESF Editor 1.4.6

    Quote Originally Posted by taw View Post
    Looking at source code, I can see a few issues:

    1. Types 0x4e and 0x4f are arrays of strings / ascii respectively. They must be decoded and reconverted if you change string/ascii enumeration at the end of file. I don't know if you ever remove things from that enumeration, or rearrange it. esf2xml convert them correctly, but leaves unused entries to make esf->xml->esf conversion byte-exact, and therefore to make testing a lot easier.
    2. S2TW's save games also contain node type 0x09. It's 8 bytes, always 0. It is probably one of: Uint64, Int64, or Double - no way to tell as long as all examples are all-zeroes. I've just discovered it and didn't have time to add support for it to esfxml.
    3. ETW esfs never contained 0x03 (just another uint16 or uint16), but they contained 0x43 arrays in a few places - and at least we know for sure how to decode them. esfxml still doesn't decode 0x43 short arrays.

    By the way none of BInary4X types are "binary data" - they're all arrays of basic types.
    OK, Binary46 is array of bytes, so it's *technically* binary data, but in any case all should be supported.
    Thank you for the code review taw.

    Point 1 does need checking, I don't change the ids of the strings (but the order can change, so the string list part of esfs are not byte-exact), but there might be problems when people copy/paste from one esf to another.
    Point 2: I hadn't encountered the type 9 in my save game, so I never put it in. I'll have to add it.
    Point 3/4: I suspected they were arrays, and if you look at the turns editor source you'll find that back then I still called them arrays, but at some point in the days between the turns editor and the esf editor I wasn't sure anymore about that, so I renamed them.

  10. #10
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,313

    Default Re: ESF Editor 1.4.6

    The context for what I marked as <uint64> but it might just as easily be a <double> or <int64>:

    In campaign_env/campaign_model-0000.xml there are 6 of these:

    142910| <rec type="PLAYER_SETUPS">
    142911| <rec type="PLAYER_SETUP" version="3">
    142912| <u>1</u>
    142913| <u>0</u>
    142914| <no/>
    142915| <s/>
    142916| <i>0</i>
    142917| <i>0</i>
    142918| <i>0</i>
    142919| <uint64>0</uint64><!-- speculative type -->
    142920| </rec>
    142921| </rec>

    Converted from my Chosokabe Summer 1570.save while playing tutorial campaign.

    I haven't seen this type in any other place yet.

  11. #11
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,313

    Default Re: ESF Editor 1.4.6

    I made esfxml expand bin3 format (found in ETW and S2TW's pathfinding) and added support for 0x09 speculatively called <uint64> until we figure out what it really is.

    If you need to verify how some part of esf should be parsed, I think esfxml does them all correctly now.

  12. #12

    Default Re: ESF Editor 1.4.7

    Changes in 1.4.7:
    • Improved support for the Shogun 2 ESF format in accordance with taw's comments
    • Fixed another bug that could cause a corrupt ESF file when saving
    • Improved performance when browsing a file
    • Improved performance when saving


    Go download

  13. #13

    Default Re: ESF Editor 1.4.7

    Hey Just what about adding labelling nodes as erasmus777 did in 1.4.5?




  14. #14

    Default Re: ESF Editor 1.4.7

    I am getting a "Specified cast is not valid." Unhandled exception error, I had no problem in 1.4.5

    I didn't edit anything that is out of the ordinary

    only the religion status and treasury of the starting faction

    hmmmm,

    Updated: Even editing the starting money, it gives me error when saving

    any ideas?

  15. #15

    Default Re: ESF Editor 1.4.7

    Quote Originally Posted by fredfrep View Post
    I am getting a "Specified cast is not valid." Unhandled exception error, I had no problem in 1.4.5

    I didn't edit anything that is out of the ordinary

    only the religion status and treasury of the starting faction

    hmmmm,

    Updated: Even editing the starting money, it gives me error when saving

    any ideas?
    My apologies for not testing that. It is fixed, download the new version.

  16. #16
    Laetus
    Join Date
    Feb 2011
    Location
    Vaughan, Canada
    Posts
    4

    Default Re: ESF Editor 1.4.8

    I get an error every time I try to save a edited file.

    Non-negative number required.
    Parameter name: count.

    Also, whenever I try to start a save game i have edited, it always crashes.

    Final Edit: I just simply used an older version(1.4.5) and it works perfectly!
    Last edited by Tadaon34; March 07, 2011 at 08:21 PM.

  17. #17

    Default Re: ESF Editor 1.4.8

    Quote Originally Posted by Tadaon34 View Post
    I get an error every time I try to save a edited file.

    Non-negative number required.
    Parameter name: count.

    Also, whenever I try to start a save game i have edited, it always crashes.

    Final Edit: I just simply used an older version(1.4.5) and it works perfectly!
    What changes did you make that led to the crash?

    Using the 1.4.5 version does not work perfectly, it just doesn't show any errors. In many cases it will not save your changes correctly.

  18. #18
    Laetus
    Join Date
    Feb 2011
    Location
    Vaughan, Canada
    Posts
    4

    Default Re: ESF Editor 1.4.8

    What changes did you make that led to the crash?

    Using the 1.4.5 version does not work perfectly, it just doesn't show any errors. In many cases it will not save your changes correctly.
    I changed the starting treasury for the Russian Empire in Napoleon.

    After that, I went to the FACTION_TECHNOLOGY_MANAGER to set the values to 0 so the techs would already be researched. And then i went to save, and it gave me some error, which didn't allow me to save at all.

    So I tried a second time and this time, i just changed the starting treasury, and it didn't give me the error that time, so I was allowed to save.

    So I go to load the edited file in-game and it crashes to desktop, upon which I started raging worse than the angry German kid, haha.

    So I tried numerous attempts in editing, saving, and trying to play the saved game. So, to see if it would work, i downloaded 1.4.5 and it worked like a charm for both changing the treasury and having the techs already researched and it allowed me to play the save file with no problems
    Last edited by Tadaon34; March 11, 2011 at 03:33 AM. Reason: More info

  19. #19

    Default Re: ESF Editor 1.4.8

    Hey Just let me report some issues on 1.4.8:

    1. When I add a description editor gives me the error:



    I can continue save the change but change is not saved.

    2. If I expand a record and make a change in one of its sub-records, then if I expand another it crashes, giving the same error message as above.

    3. I tried to make changes one by one saving meanwhile but changes are not saved. When I make the first change and save I try to open file again and most of the times it gives the error "file is already open" while it is shown there. Usually in second attempt it opens it but no change is saved.

    4. A minor issue but might help you understand problems better. When you click on a value and and select copy, it copies the value in Original Value as you've changed it.

    EDIT:

    I tried the same things with 1.6 and the only issue I met from the 4 above is only 1 (adding Description).
    Last edited by husserlTW; March 15, 2011 at 08:51 AM.




  20. #20

    Default Re: ESF Editor 1.4.8

    Hello.

    When I try change amount of money that my faction has in Shogun savegame file, it becomes corrupted and game crashes when I try load it.

    Any ideas?

Page 1 of 11 12345678910 ... LastLast

Posting Permissions

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