Results 1 to 11 of 11

Thread: [Tutorial] How to fix the custom settlement bug in Linux (Ubuntu) and Mac

  1. #1
    Socrates1984's Avatar Decanus
    Citizen

    Join Date
    Jun 2014
    Location
    Athens, Greece
    Posts
    555

    Default [Tutorial] How to fix the custom settlement bug in Linux (Ubuntu) and Mac

    Contents


    IntroductionThis is a tutorial on how to fix the custom settlement bug (Crash To Desktop - CTD) in Linux. I am using Ubuntu (16.04 LTS), but I guess the procedure isn't very different in other distros.

    What is this bug?
    For Windows users this is a non issue. For Linux and Mac users, there are certain custom settlements that crash the game. It has been proved through experimenting that the wall and gate animations are the culprits. What exactly happens is this: When fighting a siege battle, including a sally out, the game zooms in, the loading screen shows up, the music stops and the game crashes even before the loading bar starts filling up.
    It has to be said right from the start that this fix isn't a complete one. This means that custom settlements will not crash the game, but it also means that some graphics and some animations will not work.

    This guide assumes a SteamOS installation. I don't think there will be any differences in the CD version of the game (becuase the folder paths must be the same), but if anyone tries it out and has any feedback, please share and I will update this post to include the information.

    It is a prerequisite to have unpacked the game for all this to work. If you haven't done so already, please do it before proceeding. This tutorial on Unpacking the Game in Linux (Ubuntu) explains everything.

    Where applicable, this guide assumes you know how to download a package either through Ubuntu Software or through the Terminal, so that won't be covered here.

    Up

    1. Essential softwareFirst, the general advice to leave your PC in peace when downloading. This means not using the Internet, not playing games, not reading pdfs, not using the Office suite, not having other applications running, not doing anything in general. Just be absent and let it download.
    We will be downloading three programs fo this tutorial.

    WINE
    Spoiler Alert, click show to read: 

    If you are interested in running some of the Windows programs or you are interested in playing some Med2TW mods, you probably already know what this is. If not, shame on you.
    Spoiler Alert, click show to read: 
    Okay, to elaborate, this is what WINE is.
    This link is a bit more technical, but necessary nonetheless.
    And if you are feeling lazy, How to install and configure WINE is the absolute must-read. Even if you don't open the other two links, this one you have to open and read carefully, because it explains what version of WINE to install and most importantly how to configure it with WINEtricks, our next prerequisite program.

    Just to clarify, installing WINE this way is not required per se for installing mods, but assuming you didn't already have it installed, this is as good time as any to install it properly.

    WINEtricks
    Spoiler Alert, click show to read: 

    This is the program to configure WINE
    . Otherwise WINE is more or less bare and in any case doesn't have full functionality and potential. Again, it is crucial to read the How to install and configure WINE link provided above, because, well, it worked great for me and I guess it will be the same for you.

    Integrated World Terrain Editor (IWTE)
    Spoiler Alert, click show to read: 

    This is a convenient program to edit lots of things in the game. I quote from its short description in its own dedicated subforum.
    The Integrated World Terrain Editor allows battle-map settlement, terrain & building editing using ms3d, also vegetation and geography.db editing, plus conversion options for static strat map models.
    You can find more information about it here and you can download it here.
    You can extract IWTE wherever you want, but a good place would be near the folders that you will be working on, i.e. near the mod folder whose settlements you want to fix. This will save you time and reduce the chances of selecting the wrong folder and/or file.
    As far as this tutorial is concerned, you will not have to become a master in its use, but in case you want to become a bit more familiarized there are a lot of tutorials explaining its functions. Most of them are somewhat outdated, but leo's seem to be the more recent (you can find them in the first post here under "Leo.civil.uefs IWTE Tutorials").

    About unzipping
    Spoiler Alert, click show to read: 
    In case you need to unzip the files that you downloaded, you don't need unzip, unrar, 7zip or any program like that, because the default Archive Manager does it all.

    Up

    2. IWTEMake some backups
    Spoiler Alert, click show to read: 
    The best thing to do with every mod you have is to back it up. The whole thing. Because you never know what file you might need in the future.
    In our case two folders are important:
    1) /data/blockset
    2) /data/settlements
    Make a backup of at least these two folders in case something is messed up.

    How to run IWTE
    Spoiler Alert, click show to read: 
    After having extracted the downloaded .rar file, you simply right click on it and press "Open with">"Wine Windows Program Loader". Besides the IWTE main window, another one will open, a Terminal. This Terminal simply notes what is happening in the main window and tracks any bugs. Disregard it and don't close it.

    Read 3 Binary Files
    Spoiler Alert, click show to read: 
    In the WorldFiles tab click on the Read 3 Binary Files button.


    A new window will pop-up.


    You have to find the path to the custom settlement that is causing the CTD. The files are in the /data/settlements folder. For example, in TATW the file to choose is in /data/settlements/unique_settlements.

    That's why I advised you to place IWTE near the mod folder, because now the trip to the settlement folder is relatively short.
    Now, open the settlement folder you know is causing a CTD and select the only file that is selectable, i.e. a .world file.

    This you will have to do three times in succession each time choosing the new selectable file that appears from the same folder as before (.worldcollision the second time and .animinstances the third). That's why it's called Read 3 Binary Files afterall.

    After that a new window will pop-up prompting you to save the file. Save it in the same folder as before, but choose a different name to be sure.


    If everything worked fine, you will now notice that the windows on the left of your screen have filled up with info.


    Well done! You have loaded the buggy custom settlement and we are now ready to fix it!

    Removing the wall animations
    Spoiler Alert, click show to read: 
    Next thing to do is grab the Objects window and enlarge it up to the point that the Animref column is visible. Sort the table by this column. You can see that the Animref values are (in this case) -4, 0 or 4. What we have to change is all the Objects labeled as Wall in the TypeDescr column.


    Next step: Select the first Wall Object, select the Animations tab, click on Remove Object Animation button and then OK.


    You will notice that this particular Obect has been removed from the list. Re-sort by Animref and rinse and repeat until all Wall objects with 0 value in the Animref column have been removed. (If there are other Walls with different values in the Animref column, don't touch them.) Sometimes there are other Objects that have the same animation as the Walls, in this case 0. Remove them as well, but take notice of the next sentence. - >
    -> After removing all the Walls you will also notice that the Animref of the Gates Objects have been renumbered. This doesn't always happen, but in any case be cautious not to remove any Gate animations.

    Well done! Now your custom settlements have no wall animation, which means that when they are receiving artillery fire they will proceed to the next level of destruction abruptly without any animation! Hey, you've been warned...

    Redirecting the gate animations
    Spoiler Alert, click show to read: 
    Now, we have to redirect the gate animations back to the vanilla ones. This is where having unpacked the game becomes crucial, because otherwise there are no vanilla animations to redirect to. Be sure to place (a copy of) the vanilla M2TW in the right place.
    To do this drag and drop the Objects window back to its place, select the WorldFiles tab again, then the update animations paths button and then OK.


    A new set of fields will appear. Each one describes what animation is used when something is happening to the Gates; for example what animation to use when the Gates open, when they are damaged, when they are destroyed etc.
    Watch carefully the folder paths in there and you will notice that they direct to files in the mod folder, TATW in this case, in the blockset/new_settlements/animations/gate_animations/ folder.
    We have to redirect these paths to vanilla animations and to the corresponding city size. But what animations to use for these custom settlements? Are they huge cities, fortresses or what? You can see what it is easily by looking at the end of the path, where the file name is mentioned, for example NE_huge_city_gate_damage_impact.anim. As you can see it refers to Northern European huge city settlements.


    Now, click on it and replace only the mod folders. For example replace

    BlockSet/new_settlements/Animations/Gate_Animations/minas_tirith_gate_anims/NE_huge_city_gate_damage_impact.anim

    with

    blockset/north_european/animations/gate_animations/huge_city_gate_anims/NE_huge_city_gate_damage_impact.anim

    Keep in mind that we only edit the folder paths to NE_huge_city_gate_damage_impact.anim, not the file itself. It should look something like this:


    You have to do this for all the fields. You can copy-paste, but I'm not a fan of this, because it lowers the levels of the attention required to do everything right.

    Well done! You now have vanilla animations for this particular settlement! They might show some graphic glitches, but hey you've been warned on this too.

    Saving and exiting
    Spoiler Alert, click show to read: 
    You can now save by clicking on the Save 3 Binary Files button. Be sure that your files are saved where they should be by going to the place that you saved them and checking.


    Now, delete the old ones (remember, I told you to back them up first?) and rename the new ones by removing the _1-1 part.

    Exit IWTE and play with your new working custom settlement, Minas Tirith!



    Up

    3. The settlement list for TATWThe method described above works for any mod or submod that has custom settlements, but seeing that TATW sparked the effort to fix it and its sheer popularity, I find it useful to list the settlements that have been tested so far. It's not complete, but it's close to it.

    Non working settlements
    Edoras
    Hornburg
    Isengard
    Minas Tirith
    Minas Morgul
    East and West Osgiliath
    Black Gate
    Moria
    Cair Andros

    Working settlements (just for the record)
    Esgaroth
    Erebor
    Imladris
    Dol Guldur
    Caras Galadhon
    Goblin Town
    Amon Sul
    Hobbiton
    Carn Dum
    Henneth Annun
    Barad Dur (It looked like a normal settlement to me)
    Pelargir (ditto)

    Note: Esgaroth is in red because it is reported elsewhere as non-working.

    Up

    4. For Mac usersAs I have said probably a million times by now, I am a Linux user, which necessarily means that I am not a Mac user. Despite that, the two OSs seem to face the same problem as has been reported. The reason must be the same, because the tests so far have proved that this fix works for Mac too.
    This means that Mac users can utilize this Tutorial to fix the bug themselves, by adjusting a bit the instructions. For example, Mac users probably have no use of WINE or winetricks or they probably need an unzipper. I honestly don't know but I will happy to include in this section any relevant information provided.


    Thanks
    The true magician behind all this is makanyane. I merely put this Tutorial together while she was doing all the hard work.
    I have to also thank Gigantus, Withwnar and xHolyCrusader who contributed greatly in the adventure to find the root of the problem and fix it.
    I also have to thank c.l. and vconesa (a Mac user) for the parallel tests, despite them being latecomers.
    Finally, a "thank you" is due to all who created this great tool, IWTE, whom I don't exactly know, but from what I see wilddog must be included.
    I probably forget some of the good people that helped and I apologize.
    Last edited by Socrates1984; February 23, 2017 at 09:23 AM. Reason: Fixed the "Removing the wall animations" and some typos part

  2. #2

    Default Re: [Tutorial] How to fix the custom settlement bug in Linux (Ubuntu) and Mac

    Do I download the same files if I want to unpack the game on mac?

  3. #3

    Default Re: [Tutorial] How to fix the custom settlement bug in Linux (Ubuntu) and Mac

    Hi!

    I'm playing DaC on the mac and its a perfect mod. The issue is that no map with anything bigger than a pallisade, this is a problem in campaign and custom battles (custom battles crash the game the second I select settlement level) - I'm wondering if its a related problem?

  4. #4
    Frunk's Avatar Form Follows Function
    Moderator Emeritus

    Join Date
    Jun 2009
    Location
    Gold Coast
    Posts
    6,495

    Default Re: [Tutorial] How to fix the custom settlement bug in Linux (Ubuntu) and Mac

    Quote Originally Posted by RECYCLEkids View Post
    Hi!

    I'm playing DaC on the mac and its a perfect mod. The issue is that no map with anything bigger than a pallisade, this is a problem in campaign and custom battles (custom battles crash the game the second I select settlement level) - I'm wondering if its a related problem?
    Hi RECYCLEkids, welcome to TWC!

    It might be worth asking that question in Divide and Conquer's dedicated sub-forum:

    http://www.twcenter.net/forums/forum...de-and-Conquer

  5. #5

    Default Re: [Tutorial] How to fix the custom settlement bug in Linux (Ubuntu) and Mac

    Thanks Frunk, its been a while!

    haha yeah I have but they said this might be a good place to look. I'm just playing around with these tools to see if I can make any progress - steep learning curve!

  6. #6

    Default Re: [Tutorial] How to fix the custom settlement bug in Linux (Ubuntu) and Mac

    Regarding the TATW settlement list, are the 'non working settlements' ones that still crash even after the fix and the 'working settlements' ones the only ones that this method actually fixes?

    Or do the working ones not require the fix at all, with the non working ones being the only ones needing to be fixed with this method?

    Reason for asking is I edited Minas Morgul in IWTE, (only gate animations, there were no wall objects apparently), but it still crashes on that settlement.
    Thanks for the clarification, and posting the tutorial in the first place!

  7. #7

    Default Re: [Tutorial] How to fix the custom settlement bug in Linux (Ubuntu) and Mac

    Hello, I have put together corrected paths to vanilla animations for the unique settlements and copied relevant vanilla animations into the mod blockset folder. Here are the files - please overwrite your existing third age mod blockset folder (NOT your vanilla blockset, you have to go further into the file tree into the mods directory) and your third age unique_settlement folder AFTER you back them up (in case you need to make further changes with IWTE and have to compare with my edits).

    To install Third Age Total War on Linux, follow the instructions provided in this forum in thread "Total War and Linux" by user sys0p and use the Python script in the reply by AqD to make mod directories lowercase.

    This "patch" has not been thoroughly tested, but I was able to get through the Fellowship campaign with the caveats listed below:

    https://www.mediafire.com/file/uzvtv...dated.zip/file

    https://www.mediafire.com/file/1vnp1...dated.zip/file

    1. The game crashed for me when I pulled up the trait increase notification windows associated with Merry and Pippin's troll quest near Bree. You can just right click on the right-hand ribbon to dismiss the notices without opening them.

    2. The campaign instructions tell you this at the beginning, but make sure to remove everyone from settlements at the end of a turn. I forgot to do this for Aragorn when he went to Umbar and lost.

    3. When the game tells you that the Mordor army has arrived at Minas Tirith, you must attack them in the same turn to be able to complete the Battle of Pelennor Fields. Unfortunately, I was not able to get Theoden's force in position to reinforce because that army spawns on the same turn north of Minas Tirith and the ringwall entrance was blocked. In the end, the generals on all sides died and I won using an Ent unit.

    4. I did not find Faramir in my playthrough, but Frodo and Sam will free themselves after Aragorn completes his battle at the Black Gate (if Aragorn died at MInas Tirith, you will have to have him walk to the Black Gate from Rivendell to trigger the Black Gate battle - the battle will trigger when he gets there even if you end up attacking the Black Gate without him and win)

    5. DO NOT assault Barad-Ur in the Fellowship campaign, it crashed my game. Since Barad-Ur is not in the unique_settlements folder, I assume that it is a vanilla settlement, but I am not sure about this. You can still besiege the tower and wait it out for surrender.

    6. It is hard to tell when the campaign is finished, because some cutscenes weren't working. I assumed that I won when Frodo reached Mount Doom and a notification popped up telling me that Mordor had been beaten. I think that the technical victory condition is elimination of Isengard and Mordor factions, but I didn't feel like scouring the map for every last enemy settlement.

    7. I was not able to fix custom battles, I think only campaigns are working right now (have not tested it completely).

    Have fun!)))

  8. #8
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,095
    Blog Entries
    35

    Default Re: [Tutorial] How to fix the custom settlement bug in Linux (Ubuntu) and Mac

    Appreciate the efforts










  9. #9

    Default Re: [Tutorial] How to fix the custom settlement bug in Linux (Ubuntu) and Mac

    Also see user ma-ta's reply to this BUG REPORT thread for an easy fix to a broken Dwarf faction animation (causes crash to desktop in battles with dwarven axethrowers): https://www.twcenter.net/forums/show...sting!!!/page2

  10. #10

    Default Re: [Tutorial] How to fix the custom settlement bug in Linux (Ubuntu) and Mac

    Quote Originally Posted by ivan09193 View Post
    Also see user ma-ta's reply to this BUG REPORT thread for an easy fix to a broken Dwarf faction animation (causes crash to desktop in battles with dwarven axethrowers): https://www.twcenter.net/forums/show...sting!!!/page2
    CORRECTION - that link is for an old 3.0 version. For correcting v3.2, follow these steps:

    -Open descr_projectile.txt file in nano or Notepad, located under Medieval\ II\ Total\ War/share/data/mods/third_age_3/data
    -Use ^W in nano to find 'third_age'
    -Notice that this line (327 in my file) is under 'projectile quality_thrown_axe' section
    -Uncomment the line by removing the semicolon ; character at the start of the line
    -I am not sure if this is strictly necessary, but I changed the directory on this line to read 'mods/third_age_3/data/models_missile/francisca_high.cas, 40' (without the quotes)
    -On the next line, insert a semicolon ; in front of the word 'model' to comment it out
    -I fixed the directory in the last line ahead of the 'JAVELINS' section to read 'mods/third_age_3/data/models_missile/francisca.cas, max'

    In summary, lines 327 to 329 will now read:
    model (tab I guess) mods/third_age_3/data/models_missile/francisca_high.cas, 40
    ;model (tab) data/models_missile/francisca_high.cas, 40
    model (tab) mods/third_age_3/data/models_missile/francisca.cas, max

    Now use ^X, hit 'Y' key and hit the enter key in nano to save changes and overwrite descr_projectile.txt

    Axethrowing animations should now work!

  11. #11
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,095
    Blog Entries
    35

    Default Re: [Tutorial] How to fix the custom settlement bug in Linux (Ubuntu) and Mac

    Appreciate the input. I do remember a discussion like that about francisca - for some reason the directory path needed to be absolute (including mods\third_age3) instead of starting at data\models.

    An issue similar to when using custom CAS models for the battle banners.










Posting Permissions

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