Page 1 of 2 12 LastLast
Results 1 to 20 of 28

Thread: 31 factions without the Faction Select screen crashing

  1. #1

    Default 31 factions without the Faction Select screen crashing

    The Faction Selection crash occurs when you click on several factions on the Faction Selection menu and M2TW CTDs. This happens if a mod has more than 26 factions.

    Examination

    Below is my examination of this problem. This is for modders who want to know what I have tried.
    Spoiler Alert, click show to read: 

    I found that if I clicked on 4 factions my mod crashed but if I alternated between clicking on the same two factions my mod did not crash and I realised that loading multiple different maps must be the cause of this crash.

    I then moved all the Faction Selection maps to a different folder and found that I could click on as many factions as I wanted and the mod would not crash. This confirmed my earlier suspicious that the maps were related to this crash.

    I performed the following experiments in which I lowered the number of Faction Selection maps and clicked on several factions until my mod crashed. The faction that was automatically loaded when I entered the Faction Selection Screen has not been counted as a faction clicked upon.

    30 maps: able to click on 4 factions before it crashed

    20 maps: able to click on 14 factions before it crashed

    10 maps: able to click on 24 factions before it crashed

    1 map: able to click on all 30 factions without a crash

    I feel that this pattern is not a coincidence.


    I then decided to vary the file sizes to see if the crash occurred because of the total file size of the all the Faction Selection maps was too much for M2TW to handle. I reduced the file size by making the files half their size.

    Half file size (average = 25kb) = able to click on 4 factions before a crash

    Double file size (average = 100kb) = able to click on 4 factions before a crash

    This indicated there is no correlation between file size and this crash.


    I then tried editing the size of the Faction Selection maps in the mtw2.Int but reducing this entry did not make any difference.


    Finally I swapped the '<identifier>UIP_SELECT_FACTION_MAP</identifier>' and '<identifier>UIP_SPECIAL_UNIT_ART</identifier>' entries in the mtw2.Int so that the Faction Selection Maps and Faction's Special Unit images would be switched around. I then moved the Faction Selection Maps to another folder and found that my mod no longer crashed. I then replaced the Faction's Special Unit images with the Faction Selection Maps and was able to have maps without any crashes. Though I no longer have any Special Unit images because now they cause the mod to crash.

    I tried to replace the Faction Selection Maps with the Faction Leader's Portrait but as this image is automatically added to the Faction Description it is impossible to use it without covering over the Faction Description.

    The 'campaign_factin_select_controller_proxy' could be used instead of the Faction's Special Unit images to display the map but as I don't know where these images are held I cannot use it.




    Specifics

    The m2tw.Int contains the fix and allows you to have up to 31 factions in the Grand Campaign, Custom Battle, and Hotseat. The icons have been made smaller in the custom battle selection screen to accommodate all 31 icons.

    This m2tw.Int replaces the Faction Selection Maps with the faction's special unit image. This is demonstrated in the screenshot below. The reason I have used this image is that M2TW can cope with 31 different Faction's Special Unit images but not 31 different campaign maps. As there was not other suitable image I had to use this one.

    Spoiler Alert, click show to read: 


    Guide

    1) Download the attached m2tw.rar, unpack it, and put the m2tw.Int in your mod's 'data\menu' folder.

    2) Your Faction's Special Unit images and Faction Selection Maps will now have switched place on the Faction Selection Screens.

    3) Replace all your Faction's Special Unit images in your mod's 'data\menu\symbols\fe_faction_units' with the Faction Selection Maps in your mods 'data\world\maps\campaign\imperial_campaign'.

    4) Delete all the maps from the 'data\world\maps\campaign\imperial_campaign' folder. If the files remain in here the mod will continue to crash on the Faction Selection Screen. MAP FILES IN THIS FOLDER CAUSE THE CRASH.

    5) Your factions no longer have any Special Unit images but you can edit the 'data/world/maps/campaign/imperial_campaign/map_FE.tga' file which will add an image into the space where the Special Unit images used to be.


    This fix doesn't fix the crash you get when you select the Grand Campaign, then go back to the menu and choose Custom Battle. I don't know how to fix it.
    Last edited by uanime5; April 06, 2010 at 09:15 AM.
    Morning Sun (adds Korea and China to the Shogun 2 map)
    http://www.twcenter.net/forums/forum...28-Morning-Sun

    Expanded Japan mod (97 new regions and 101 new factions)
    http://www.twcenter.net/forums/showt...ew-factions%29

    How to split a region in TWS2
    http://www.twcenter.net/forums/showt...split-a-region

    Eras Total Conquest 2.3 (12 campaigns from 970-1547)

  2. #2
    konny's Avatar Artifex
    Join Date
    Jul 2007
    Location
    Germania Inferior
    Posts
    3,631

    Default Re: 31 factions without the Faction Select screen crashing

    Interesting find!

    Did I understand it right, that if I replace the special unit pic with a pic of the factional map I would be able to display all factional maps without the pesty CTD? I would then use some some dummy art as map_FE that would be displayed for all factions.

    Team member of: Das Heilige Römische Reich, Europa Barbarorum, Europa Barbarorum II, East of Rome
    Modding help by Konny: Excel Traitgenerator, Setting Heirs to your preference
    dHRR 0.8 beta released! get it here
    New: Native America! A mini-mod for Kingdoms America

  3. #3

    Default Re: 31 factions without the Faction Select screen crashing

    That's correct. I've included a screenshot in the first post that shows how the new menu will look with the Faction's Special Units images and Faction Selection Maps reversed.

    It's also possible to edit the data/text/expanded.txt file to change the names of the Special Units to something else.
    Morning Sun (adds Korea and China to the Shogun 2 map)
    http://www.twcenter.net/forums/forum...28-Morning-Sun

    Expanded Japan mod (97 new regions and 101 new factions)
    http://www.twcenter.net/forums/showt...ew-factions%29

    How to split a region in TWS2
    http://www.twcenter.net/forums/showt...split-a-region

    Eras Total Conquest 2.3 (12 campaigns from 970-1547)

  4. #4
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: 31 factions without the Faction Select screen crashing

    Very interesting, and good deductions. There seems to be a linear correlation between the amount of factions you can click on before a crash and the amount of maps present in the folder:

    Quote Originally Posted by uanime5 View Post
    30 maps: able to click on 4 factions before it crashed

    20 maps: able to click on 14 factions before it crashed

    10 maps: able to click on 24 factions before it crashed

    1 map: able to click on all 30 factions without a crash

    I feel that this pattern is not a coincidence.
    For every map removed from the starting 30, you can click one extra faction before it crashes. 30 to 20 allows you to click 10 more, same with 20 to 10. The difference between 10 and 1 isn't 9 because there aren't 33 factions. Based on this, it would seem that the sweet spot for the faction select screen is 17 factions. That is to say that for 17 factions you can include 17 maps and click on all of them. If you have 18 factions only 16 can have maps, and if you have 16 factions it isn't utilizing the entire map space available to it. Incidentally, Medieval II Vanilla has exactly 17 factions available from the start, which either speaks to a soft-hard code based on CA's needs, or an unresolved bug that dictated the available factions(unlikely).

    The problem might be the way that it loads the initial map screen into memory. This is what it does whenever you click a new faction, based on the general system output log:
    [system.io] [info] exists: missing data/world/maps/campaign/custom/imperial_campaign/description.txt
    [system.io] [trace] file open,,auh-newbuild/data/world/maps/campaign/imperial_campaign/leader_pic_pagan.tga,,not found
    [system.io] [warning] open: auh-newbuild/data/world/maps/campaign/imperial_campaign/leader_pic_pagan.tga is missing
    [system.io] [trace] file open,,auh-newbuild/data/world/maps/campaign/imperial_campaign/leader_pic_pagan.tga,,not found
    [system.io] [warning] open: auh-newbuild/data/world/maps/campaign/imperial_campaign/leader_pic_pagan.tga is missing

    [system.io] [trace] file open,,auh-newbuild/data/menu/symbols/FE_buttons_48/symbol48_pagan_select.tga,16844
    [system.io] [info] open: found auh-newbuild/data/menu/symbols/FE_buttons_48/symbol48_pagan_select.tga (from: F:\Modding Files\AUH - Test Environment)

    [system.io] [trace] file open,,auh-newbuild/data/world/maps/campaign/imperial_campaign/map_pagan.tga,544
    [system.io] [info] open: found auh-newbuild/data/world/maps/campaign/imperial_campaign/map_pagan.tga (from: F:\Modding Files\AUH - Test Environment)

    [system.io] [trace] file open,,data/menu/symbols/FE_faction_units/pagan.tga,,not found
    [system.io] [trace] pack open,packs/localized.pack,data/menu/symbols/FE_faction_units/pagan.tga,,not found
    [system.io] [trace] pack open,packs/data_1.pack,data/menu/symbols/FE_faction_units/pagan.tga,,not found
    [system.io] [warning] open: data/menu/symbols/FE_faction_units/pagan.tga is missing
    Checks to see if description.txt file exists and outputs value of exists check to [info]; doesn't have a [trace] probably because no operations were tried.
    Looks for faction leader picture, and if it doesn't find it, looks again, and if it still doesn't find it, outputs to [warning] with exception information.
    Looks for selected version of faction symbol; if it finds it, executes file.open() and outputs to [info] with directory information.
    Looks for faction map; if it finds it, executes file.open() and outputs to [info] with directory information.
    Looks for the faction unit picture; if it doesn't find it, checks pack, and if it still doesn't, outputs to [warning] with exception information.

    There's a couple curious things here, assuming it logs all file operations. One is that some files seem to check the same location twice and throw exceptions, rather than check the pack. Another is that when you initially click on the campaign mode, it will already run two open() operations on the map files, one by way of something like a checksum/hash, and the other by way of its actual name and location. So it already has them opened, or something, when you initially click Campaign. The unit pictures on the other hand are only loaded for the initially selected faction. Once you have clicked on a faction once, it will not need to load the map for that faction again if you switch off and back on, which definitely suggests the map persists rather than gets cleared. Even if you jump around to other locations and come back, it will still not perform the same open() as the very first time the faction is clicked during that session.

    The initial load of all maps prior to any clicks may also factor in, which would explain why games with more factions have a lower threshold, since they have a higher starting number of pre-click maps. This is just speculation, but the output certainly verifies that maps are treated differently, in that some form of file operation is done on them without being contingent on a faction selection. If the click-based loads involve interfacing with the cache, that also begs the question if turning off the cache would resolve this error. Obviously no cache could cause performance issues elsewhere, but it'd be interesting to find out.

  5. #5

    Default Re: 31 factions without the Faction Select screen crashing

    Thank you unanime5 and Augustus Lucifer for posting your findings.

    I am nearing the end of my solo project and was looking for some workaround to the faction selection crash. As my mod has many provincial campaigns and factions it would have become quite intolerable for someone to browse about the menu.

    I opted to forego the faction descriptions and made the necessary coordinate changes within my own mtw2.Int file to allow the factions maps to stay in position (with same map size) as leader_pics. That is, I swapped the positions of UIP_SELECT_FACTION_DESCRIPTION with UIP_SELECT_FACTION_MAP. A transparent map_FE.tga now sits in the faction description area. Further, I completely filled the empty description area with all the campaign faction icons similar to Custom Battle, so nothing seems to look amiss on the Campaign menu.

    It does appear that the magic or mystical number is 17 or rather twice that. I can now jump among different provincial campaigns and make up to 34 faction/campaign selections without a CTD. There appears to be NO CTD while making factions selections within the same Provincial Campaign or Imperial Campaign. Jumping from one provincial campaign to another counts as one “faction selection” from the maximum 34 that you begin with. Actual examples: (a) 10+J7+J7+J7 CTD = 31 faction selections + 3 Jumps = 34; (b) 9+J7+J7+J5+J2 CTD = 30 faction selections + 4 Jumps = 34.

    Compared to the way things were, this is an acceptable compromise. For those that have only one Imperial Campaign mod, more options are available as you can use the Faction Strengths/Weaknesses sections for faction descriptions if so preferred.

    Cheers,
    brandybarrel's BattleAxe and Unit Guide Links:





  6. #6
    TaronQuinn's Avatar Semisalis
    Join Date
    Oct 2009
    Location
    Eastern United States
    Posts
    445

    Default Re: 31 factions without the Faction Select screen crashing

    Hail unanime5!

    Excellent research and work on your part. I'm trying to incorporate your work into DLV via a minimod of mine. Question: Do the victory condition images cause any problems? They're not on the faction selection screen, obviously, but I'm not if they could cause problems in their own right. DLV doesn't use any currently, but I hope to add them in the future.

    Thanks in advance.

    TQ

  7. #7
    RedGuard's Avatar Protector Domesticus
    Join Date
    Apr 2009
    Location
    Telmachian mountain range
    Posts
    4,350

    Default Re: 31 factions without the Faction Select screen crashing

    thanks Unianima5 your fix worked. thanks for all guys

  8. #8

    Default Re: 31 factions without the Faction Select screen crashing

    Did you really make a map THAT big? Holy crap!

  9. #9

    Default Re: 31 factions without the Faction Select screen crashing

    yes he did

  10. #10

    Default Re: 31 factions without the Faction Select screen crashing

    Would it be possible to use a generic "faction" map in the normal place instead of switching everything? IE just using the same faction_selection map for every faction.
    A well informed opinion is a well formed opinion.

  11. #11
    irishron's Avatar Cura Palatii
    Join Date
    Feb 2005
    Location
    Cirith Ungol
    Posts
    47,023

    Default Re: 31 factions without the Faction Select screen crashing

    Yes, just clone it for each faction. It would not be the first mod doing it.

  12. #12

    Default Re: 31 factions without the Faction Select screen crashing

    Quote Originally Posted by Carle View Post
    Would it be possible to use a generic "faction" map in the normal place instead of switching everything? IE just using the same faction_selection map for every faction.
    I was thinking the same thing, if that solves the crashes.
    and nothing is stopping you from customizing that Special unit image to clarify wich color you are and to generally pimp it a bit.

  13. #13
    Vegas_Bear's Avatar Biarchus
    Join Date
    Sep 2005
    Location
    Las Vegas, NV
    Posts
    605

    Default Re: 31 factions without the Faction Select screen crashing

    Thank you for this, helped me out a lot on my personal version of Retrofit.

    Vegas_Bear

  14. #14

    Default Re: 31 factions without the Faction Select screen crashing

    And how about this faction ranking scroll's bug???
    The viewing of some faction's small logos is uncorrect. Does somebody fix it???

  15. #15

    Default Re: 31 factions without the Faction Select screen crashing

    was just reminded about this and the multi player screen crashing on certain circumstances when more factions are added... what I'd found in the end is that if every faction has every bit it should have (even if just duplicated images) for the faction map and special unit images - then things become stable

    having missing images for a faction doesn't cause an immediate crash but does seem to be the cause of the 'after you clicked a few things' problem

    the multiplayer menu will also crash immediately if you don't have a custom battle pic assigned to each possible custom battle.

  16. #16

    Default Re: 31 factions without the Faction Select screen crashing

    Quote Originally Posted by robomanus View Post
    And how about this faction ranking scroll's bug???
    The viewing of some faction's small logos is uncorrect. Does somebody fix it???
    bump, anyone knows?

    ...CONJURATION INCREASED TO 90...

  17. #17
    Japabeaner's Avatar Libertus
    Join Date
    May 2014
    Location
    United States
    Posts
    66

    Default Re: 31 factions without the Faction Select screen crashing

    Hi, I'm sorry, where is the attached mtw file?

  18. #18
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

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

    Default Re: 31 factions without the Faction Select screen crashing

    The file attachment unfortunately got lost during a forum reset as it wasn't correctly attached.










  19. #19
    Mr_Nygren's Avatar Berserkir
    Join Date
    Mar 2009
    Location
    Sweden
    Posts
    4,351

    Default Re: 31 factions without the Faction Select screen crashing

    Quote Originally Posted by makanyane View Post
    was just reminded about this and the multi player screen crashing on certain circumstances when more factions are added... what I'd found in the end is that if every faction has every bit it should have (even if just duplicated images) for the faction map and special unit images - then things become stable

    having missing images for a faction doesn't cause an immediate crash but does seem to be the cause of the 'after you clicked a few things' problem

    the multiplayer menu will also crash immediately if you don't have a custom battle pic assigned to each possible custom battle.
    I have 31 maps in imperial_campaign for all the 31 factions (used for the big faction screenshot) - even the two unplayable ones such as the slave and herooftime.

    I do also have 31 special unit cards (used for faction leaders).

    Crashes on second selection currently, or third in a row.
    Be your friend's, true friend. Return gift for gift. Repay laughter, with laughter again
    but betrayal with treachery.

    - The Havamal

  20. #20
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

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

    Default Re: 31 factions without the Faction Select screen crashing

    Feel free to try the LNT file from RotK, see underneath how we worked around the problem. There is guide somewhere (miscellaneous?) that provides a basic set up for it.











Page 1 of 2 12 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
  •