Results 1 to 16 of 16

Thread: ground texture of battle maps

  1. #1

    Default ground texture of battle maps

    Hi everybody,

    does someone know where are the texture file for the ground of battle maps?

    i googled and spent 2 hours exploring files, so i'm now desperate...

    Thanks.

  2. #2

    Default Re: ground texture of battle maps

    ai tink tei a in \M2TW\battlefield o \M2TW\settlements

  3. #3

    Default Re: ground texture of battle maps

    i looked at these places, don't find...

  4. #4
    irishron's Avatar Cura Palatii
    Moderator Emeritus

    Join Date
    Feb 2005
    Location
    Cirith Ungol
    Posts
    47,023

    Default Re: ground texture of battle maps


  5. #5
    makanyane's Avatar Praeses
    Content Emeritus

    Join Date
    Feb 2006
    Posts
    9,093
    Blog Entries
    1

    Default Re: ground texture of battle maps

    Quote Originally Posted by irishron View Post
    ahhh, bum, I really really need to update that...

    the battlefield texture name/path is stored in descr_geography_new.db generally the texture files are in m2/data/battlefield/climate_name/summer or winter, so if you only want to alter an existing one you can do it there.

    if you want to introduce a new texture file there is a method of changing the .db by regenerating it from the equivalent .txt file, but I wouldn't now recommend that as it wipes out the RGB values for the distant views, and can cause other problems... The IWTE tool now has an option to directly edit the .db file
    http://www.twcenter.net/forums/showt...ed-tutorial%29

  6. #6

    Default Re: ground texture of battle maps

    Quote Originally Posted by makanyane View Post
    ahhh, bum, I really really need to update that...

    the battlefield texture name/path is stored in descr_geography_new.db generally the texture files are in m2/data/battlefield/climate_name/summer or winter, so if you only want to alter an existing one you can do it there.

    if you want to introduce a new texture file there is a method of changing the .db by regenerating it from the equivalent .txt file, but I wouldn't now recommend that as it wipes out the RGB values for the distant views, and can cause other problems... The IWTE tool now has an option to directly edit the .db file
    http://www.twcenter.net/forums/showt...ed-tutorial%29
    There's a long standing siege battle CTD bug in EB2 which has defied our abilities to pin it down. There does seem to be a relationship with climates (Siege battles on Crete CTD when the climate is pink, but not when it's orange). Anyway, I knew we were using descr_geography_new.txt to generate the .db file, and sure enough, IWTE revealed that every single RGB value was zero. I'll use IWTE to fix that (not sure it will solve the problem), but I'm interested in this portion of your comment:

    Quote Originally Posted by makanyane View Post
    I wouldn't now recommend that as it wipes out the RGB values for the distant views, and can cause other problems...
    What other problems does it cause?
    EBII Council

  7. #7
    makanyane's Avatar Praeses
    Content Emeritus

    Join Date
    Feb 2006
    Posts
    9,093
    Blog Entries
    1

    Default Re: ground texture of battle maps

    Quote Originally Posted by Kull View Post
    There's a long standing siege battle CTD bug in EB2 which has defied our abilities to pin it down. There does seem to be a relationship with climates (Siege battles on Crete CTD when the climate is pink, but not when it's orange).
    sounds like a variation of this one;
    http://www.twcenter.net/forums/showt...52#post5633252
    med on map_climates is pink... so you need to sort the path lengths for your captains's attachments... and maybe the other stuff too to be safe!

    don't ask me to explain why! I have absolutely no idea!

    Anyway, I knew we were using descr_geography_new.txt to generate the .db file, and sure enough, IWTE revealed that every single RGB value was zero. I'll use IWTE to fix that (not sure it will solve the problem), but I'm interested in this portion of your comment:

    What other problems does it cause?
    there's a couple of issues, based around adding a additional texture references via the .txt version. The games own cfg based txt to db conversion is a buggy memory hog, and can either crash at the point of trying to generate the .db, or later when you try and load a battle or do weird things to the campaign map, see this thread for an example;
    http://www.twcenter.net/forums/showt...ew-txt-editing

  8. #8

    Default Re: ground texture of battle maps

    Quote Originally Posted by makanyane
    med on map_climates is pink... so you need to sort the path lengths for your captains's attachments... and maybe the other stuff too to be safe!

    don't ask me to explain why! I have absolutely no idea!
    @makanyane, this was really really helpful. Thank you so much! I think this is the final nail in the coffin for that crash! In the spoilers are my findings from the EB internal forum, I think you may find them interesting as they shed some light on the problem.

    Spoiler Alert, click show to read: 
    This rhymes fairly well with the error I saw in FileMon at the start. Hooray for potential silver bullet number 18!

    Quote Originally Posted by FileMon

    11:01:29 kingdoms.exe:7716 OPEN E:\cd-spill\medieval2eb2svn\mods\ebii\data\unit_models\_ units\eb_officer_roman\textures\eb_officer_roman_t riarii_camillan.texture__unit_models\attachmentset s\faction_variations\f_rome\ PATH NOT FOUND Options: Open Directory Access: 00100001
    11:01:29 kingdoms.exe:7716 OPEN E:\cd-spill\medieval2eb2svn\mods\ebii\data\unit_models\_ units\eb_officer_roman\textures\eb_officer_roman_t riarii_camillan.texture__unit_models\attachmentset s\faction_variations\f_rome\variations\south_europ ean\ PATH NOT FOUND Options: Open Directory Access: 00100001
    11:01:29 kingdoms.exe:7716 OPEN E:\cd-spill\medieval2eb2svn\mods\ebii\data\unit_models\_ units\eb_officer_roman\textures\eb_officer_roman_t riarii_camillan.texture__unit_models\attachmentset s\variations\south_european\ PATH NOT FOUND Options: Open Directory Access: 00100001



    The path length in the model db for the triarii isn't too far beyond what makanyane reports works:

    86 unit_models/_Units/EB_officer_roman/textures/EB_officer_roman_triarii_camillan.texture
    93 unit_models/_Units/EB_officer_roman/textures/EB_officer_roman_triarii_camillan_normal.texture

    But note that the full path to the triarii officer texture is 129 in my particular installation (E:\cd-spill\medieval2eb2svn\mods\ebii\data\unit_models\_ units\eb_officer_roman\textures\eb_officer_roman_t riarii_camillan.texture). 129 is above 127, which is a magic number in computing as it is the maximum number you can represent with 7 bits. So here's my crazy idea. If the full path to a texture file exceeds 127, in mediterranean climate, the game will go nuts and append that attachmentsets crap to the file it tries to read, and obviously fail as the file isn't there, and isn't supposed to be there.

    Let's assume that all you guys except me and Marvin have installed M2TW in some location that is longer than 27 characters (E:\cd-spill\medieval2eb2svn is 27). This means that the full path length will exceed 127 for more units in your cases than for me and Marvin. Thus leading to a crash due to some unit with long path at Knossos for you, and not for us!


    Spoiler Alert, click show to read: 
    Tried to rename my M2TW installation to something really long. Success! I now got the Knossos CTD again!
    Quote Originally Posted by FileMon
    09:35:50 kingdoms.exe:5140 OPEN E:\cd-spill\medieval2eb2svn_withreallylongobnoxiousnamet obreakmediterraneanclimate\mods\ebii\data\unit_models\_units\eb_hoplitai\tex tures\eb_hoplitai_kh.texture__unit_models\attachme ntsets\faction_variations\f_kh\ PATH NOT FOUND Options: Open Directory Access: 00100001
    09:35:50 kingdoms.exe:5140 OPEN E:\cd-spill\medieval2eb2svn_withreallylongobnoxiousnamet obreakmediterraneanclimate\mods\ebii\data\unit_mod els\_units\eb_hoplitai\textures\eb_hoplitai_kh.tex ture__unit_models\attachmentsets\faction_variation s\f_kh\variations\south_european\ PATH NOT FOUND Options: Open Directory Access: 00100001
    So, obviously what we need to do is reduce the length of the path to our files. We can't guard against anyone actually using an extremely long name for his M2TW folder, but the vast majority will not.

    As an example, the triarii path length can be shortened at least for a total reduction of 19 bytes:
    unit_models/_Units/EB_officer_roman/textures/EB_officer_roman_triarii_camillan.texture
    unit_models/_Units/EB_officer_roman/tex/EB_triarii_camillan.texture

    It will be a pretty big job to do all these reductions and updating the referencing files, but I really see no way around it. Well, apart from ditching mediterranean climate wholesale.

    Having problems getting EB2 to run? Try these solutions.
    ================
    I do NOT answer PM requests for help with EB. Ask in a new help thread in the tech help forum.
    ================
    I think computer viruses should count as life. I think it says something about human nature that the only form of life we have created so far is purely destructive. We've created life in our own image. - Stephen Hawking

  9. #9

    Default Re: ground texture of battle maps

    Quote Originally Posted by makanyane View Post
    don't ask me to explain why! I have absolutely no idea!
    I'll add my thanks to bovi's! And I think he nails the answer to your question in one of his posts:

    Quote Originally Posted by bovi View Post
    But note that the full path to the triarii officer texture is 129 in my particular installation. 129 is above 127, which is a magic number in computing as it is the maximum number you can represent with 7 bits. So here's my crazy idea. If the full path to a texture file exceeds 127, in mediterranean climate, the game will go nuts and append that attachmentsets crap to the file it tries to read, and obviously fail as the file isn't there, and isn't supposed to be there.
    Today is a good day for EB2....that bug has been with us for YEARS!

    Edit: Potentially this solves CTDs experienced by many mods, because now we know that the overall path length of any file - beginning right from C:\ - cannot exceed the magic number of 127. Think about that in the context that M2TW's default install location is C:\Program Files (x86)\Medieval II Total War\. That is 45 characters long, meaning that over 1/3 of the allowed path length is consumed just by the initial program path. No wonder the game is unstable at that location!
    Last edited by Kull; December 16, 2013 at 11:04 AM.
    EBII Council

  10. #10

    Default Re: ground texture of battle maps

    because now we know that the overall path length of any file - beginning right from C:\ - cannot exceed the magic number of 127.
    I hate to rain on the parade, but this is going a bit overboard. It's my fault for being lackadaisical with terminology, calling 127 a magic number. There is no other magic than that programmers tend to set hardcoded boundaries to a power of 2, or a power of 2 minus 1, mostly because we think a lot in binary and partly because it makes sense with some technical things like memory chunk sizes, file block sizes on disk and stuff and junk.

    So yeah, 127 is not some hardcoded limit for all paths, but rather only for files related to officer units in mediterranean climate, and only in settlement battles. Consider that when we exchanged the mediterranean climate with another, the battle loaded fine - even though the units were the same and the file path length was the same for them. Obviously then, there is no such limit in the code for other climates than mediterranean. Probably some CA programmer set such a limit on path length somewhere deep in his code, thinking CA would never need to exceed such a length (and they probably didn't). Also, it would be really easy to expand the limit if need arose. Unfortunately, easy for CA can mean impossible for us, and it does in this case. I don't know why there is different code for particular climates, probably some quick and dirty fix towards the end. Only CA devs would know.

    But yeah, other mods could have run into the siege battle CTD, and who knows where else CA may have put some such limit. But I feel I must point out that this is a silver bullet to fix a very specific problem (or at the most a pretty narrow set of problems), rather than a bombshell which could wipe out all kinds of instability.

    Having problems getting EB2 to run? Try these solutions.
    ================
    I do NOT answer PM requests for help with EB. Ask in a new help thread in the tech help forum.
    ================
    I think computer viruses should count as life. I think it says something about human nature that the only form of life we have created so far is purely destructive. We've created life in our own image. - Stephen Hawking

  11. #11

    Default Re: ground texture of battle maps

    Quote Originally Posted by bovi View Post
    I hate to rain on the parade, but this is going a bit overboard. It's my fault for being lackadaisical with terminology, calling 127 a magic number. There is no other magic than that programmers tend to set hardcoded boundaries to a power of 2, or a power of 2 minus 1, mostly because we think a lot in binary and partly because it makes sense with some technical things like memory chunk sizes, file block sizes on disk and stuff and junk.

    So yeah, 127 is not some hardcoded limit for all paths, but rather only for files related to officer units in mediterranean climate, and only in settlement battles. Consider that when we exchanged the mediterranean climate with another, the battle loaded fine - even though the units were the same and the file path length was the same for them. Obviously then, there is no such limit in the code for other climates than mediterranean. Probably some CA programmer set such a limit on path length somewhere deep in his code, thinking CA would never need to exceed such a length (and they probably didn't). Also, it would be really easy to expand the limit if need arose. Unfortunately, easy for CA can mean impossible for us, and it does in this case. I don't know why there is different code for particular climates, probably some quick and dirty fix towards the end. Only CA devs would know.

    But yeah, other mods could have run into the siege battle CTD, and who knows where else CA may have put some such limit. But I feel I must point out that this is a silver bullet to fix a very specific problem (or at the most a pretty narrow set of problems), rather than a bombshell which could wipe out all kinds of instability.
    Good point. On the other hand, now that we know this level of hardcoding exists in this one area, it's quite conceivable that the same programmer used similar limits elsewhere, but just not in places where there are so many potential chances for the problem to surface. There are probably hundreds of Mediterranean siege battles in every game, whereas other CTD "opportunities" tied to the same type of pathing limit could happen with less frequency.

    The point is, don't buy trouble by using really large program paths, as it definitely DOES lead to one CTD, and MIGHT cause others.
    EBII Council

  12. #12
    makanyane's Avatar Praeses
    Content Emeritus

    Join Date
    Feb 2006
    Posts
    9,093
    Blog Entries
    1

    Default Re: ground texture of battle maps

    bovi, thanks for the insight about the whole path length, that's not something I'd considered before and might help to explain why some things seem to work for some people but not others more generally.

    Quote Originally Posted by bovi View Post
    I don't know why there is different code for particular climates, probably some quick and dirty fix towards the end. Only CA devs would know.

    But yeah, other mods could have run into the siege battle CTD, and who knows where else CA may have put some such limit. But I feel I must point out that this is a silver bullet to fix a very specific problem (or at the most a pretty narrow set of problems), rather than a bombshell which could wipe out all kinds of instability.
    There's another odd thing that happens with certain climates and not others... at least one of the climates that doesn't normally have 'winter', ends up looking for building textures in
    blockset/textures/middle_eastern/winter and ignores the usual location of blockset/textures/winter so there are some variations in the ways the climates get handled internally

    I do wonder with the limit thing though, whether it'd be an actual deliberate hardcoded limit or if because of some odd variation in the way it handles the med/siege situation it's ending up trying to store the path length as a signed byte internally and falling over.

  13. #13

    Default Re: ground texture of battle maps

    It's worth noting that the limit affects other climates. We had siege battle CTDs impacting semi_arid and sandy_desert locations, too. And those likewise cleared up when the paths were shortened. Interestingly, the geography.db file has language which indicates that both of those (along with three others) "modify mediteranean". So the source of the problem could probably be triangulated down to the portion of "mediterranean" that is shared among that group. And perhaps contrasting it with temperate_deciduous might hone it even further. But at this point there is ZERO doubt that total path length is causing these CTDs.

    Quote Originally Posted by makanyane View Post
    There's another odd thing that happens with certain climates and not others... at least one of the climates that doesn't normally have 'winter', ends up looking for building textures in
    blockset/textures/middle_eastern/winter and ignores the usual location of blockset/textures/winter so there are some variations in the ways the climates get handled internally.
    Out of curiousity - which climate is that?

    Edit: If somebody was truly a glutton for punishment, they could take a working M2TW game and modify the game name to something that's 127 characters long. Then launch the game and see what kinds of things start crashing. If it's just the usual suspects (med-type climate related siege CTDs), then this is a limited impact issue. But if other things start to collapse......
    Last edited by Kull; December 17, 2013 at 06:33 PM.
    EBII Council

  14. #14
    makanyane's Avatar Praeses
    Content Emeritus

    Join Date
    Feb 2006
    Posts
    9,093
    Blog Entries
    1

    Default Re: ground texture of battle maps

    Out of curiousity - which climate is that?
    Couldn't find the info, that was why I was being vague, I just remember that's why I've ended up with a textures/middle_eastern folder in PKH... if I find it again I'll update


    We had siege battle CTDs impacting semi_arid and sandy_desert locations, too.
    that's starting to sound like it's ones which didn't start out having 'winter' in descr_climates.txt


    Interestingly, the geography.db file has language which indicates that both of those (along with three others) "modify mediteranean". So the source of the problem could probably be triangulated down to the portion of "mediterranean" that is shared among that group.
    yeah but... as we discovered when looking at the geography db rebuild issue, when the .txt file says 'modifies mediterranean' the game's db building process just copy/pastes mediterranean entries into any missing tables that weren't specified in the text file for the child climate - that resulting .db is exactly the same as a binary file, as if you'd copy/pasted the entries yourself in the .txt file and removed the 'modifies' line. So there isn't anything left in the .db that refers one climate to another.

  15. #15

    Default Re: ground texture of battle maps

    Quote Originally Posted by makanyane View Post
    that's starting to sound like it's ones which didn't start out having 'winter' in descr_climates.txt
    Aaaaaand you just answered the question I didn't post. If "modifies mediteranean" is the driving factor, how come our custom siege battle in the steppe climate didn't CTD? It has "modifies mediteranean" too....

    What the steppe climate has that the others don't, is "Winter" (unused1 also has winter, but it wasn't in EB2 at the time)
    Last edited by Kull; December 18, 2013 at 05:15 PM.
    EBII Council

  16. #16
    makanyane's Avatar Praeses
    Content Emeritus

    Join Date
    Feb 2006
    Posts
    9,093
    Blog Entries
    1

    Default Re: ground texture of battle maps

    On the subject of climates doing odd stuff, did you EB guys find anything with AI siege behaviour?
    because; http://www.twcenter.net/forums/showt...or-not-working
    though that seems to be related to the 3 perimeter largest castle - are you using those?

    is all getting quite strange that this stuff is still getting discovered so long after the release of M2!

Posting Permissions

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