Results 1 to 17 of 17

Thread: Strat settlement models missing shadows

  1. #1
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Strat settlement models missing shadows

    Entire cultures are lacking shadows on their settlement strat models. Some cultures work, some don't, and it seems that it is broken only for cultures furthest down the descr_cultures.txt file.

    Looking at an earlier version the problem is not as bad: only the last culture is missing shadows. I can't pinpoint what the cause is because a lot has changed since then. The changes do include adding some extra strat models for custom settlements, if that's relevant.

    It's definitely a culture problem, not a model problem. I took a model from a working culture and gave it to a broken culture: still no shadow.

    It's like the game engine is running out of resources, unable to apply shadows to settlements further down the descr_cultures list.

    Can anybody shed any light on this? A search came up empty.

  2. #2
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Strat settlement models missing shadows

    Solved.

    Deleting all unused strat models from the mod (residences and faction_variants folders) got most of the shadows back. All it took then was to decrease the size/complexity of one remaining model: it was 500kB but after welding its vertices it reduced to 175kB.

    So it seems to be a symptom of having too many CAS files (which the game still loads even if they're never used). Not necessarily "too many" as in total number, rather total combined size/complexity of the models.

  3. #3
    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,068
    Blog Entries
    35

    Default Re: Strat settlement models missing shadows

    Any rule of thumb of the limit?
    And is it just the settlement models that effect it or the character models (which can be quite a lot in some mods) as well?










  4. #4
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Strat settlement models missing shadows

    Rule of thumb: not enough info to say. Originally there were 160 residences CAS files in the mod, totalling 10.5MB. About half of the settlement types had no shadow. Now there are 95 @ 6.6MB with all shadows working.

    I have since noticed that only one port shadow is working (first tier of first culture) and no fort or watchtower shadows are working. Removing another bunch of residence CAS files from the mod fixed it but that was just to test; I can't permanently delete them because they're used by the mod. I tried reducing the vertex count of some of the bigger ones but that didn't help.

    So it looks like shadows are calculated/applied first to all settlement models, then the other things: ports, forts, watchtowers (in what order I don't know). Resources and character models all have working shadows.

    No, I don't think that character models make any difference. When testing the port shadows I tried deleting a bunch of character CAS files (changing descr_character.txt too so it was no longer referencing them) and it made no difference, still just the one port shadow. I took out about 10 of them, the ones with the largest file sizes. It was only when I started taking out residence models that more port shadows started to appear.

  5. #5
    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,068
    Blog Entries
    35

    Default Re: Strat settlement models missing shadows

    160 residences is quite a number, it's 35 in vanilla I think? Another hard coded limit it would appear.

    Come to think of: the character shadows are actually CAS models in itself, not game generated as with the other static models. That might be the reason why it has no effect on this issue.










  6. #6
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Strat settlement models missing shadows

    It would be roughly 11 x culture count for vanilla? But that's just settlements. The mod also has some additional CAS files for ports, watchtowers and forts; they're included in the "residences" stats I posted.

    the character shadows are actually CAS models in itself
    Yes, was wondering about that too. I can confirm that reducing the vertex count of a resource model does affect things, which also confirms that the model count is not the culprit, it's the model complexities (vertex count), possibly the combined vertex count of all models (in which case model count is still a factor: more models = more vertices).

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

    Join Date
    Jun 2009
    Location
    Gold Coast
    Posts
    6,493

    Default Re: Strat settlement models missing shadows

    The info here could be relevant to this thread, if I'm following both correctly.
    FrunkSpace | Mod Announcements | Colonies & Empires

    Under the patronage of Iskar of the House of Siblesz. I am the proud patron of:

    atthias | PaulH | Athos187

  8. #8
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Strat settlement models missing shadows

    Sounds like the exact same thing yes.

  9. #9
    Overlord.ru's Avatar Centenarius
    Join Date
    Jan 2009
    Location
    Russian Federation, Moscow Region, Town of Electrostal
    Posts
    867

    Default Re: Strat settlement models missing shadows

    To sleepy atm to get it right, but what do you mean by saying "unused strat models"? How can I figure out which models are unused?

    BTW, I noticed that adding some new objects to one model causes another model to lose shadow o_O seems that the size of the file increases which leads to loss of shadow as you mentioned...

  10. #10
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Strat settlement models missing shadows

    For every file in the residences folder see if it is referenced in descr_cultures.txt. If not then it is unused*.

    For faction_variants subfolders it is the same but check only the culture section to which that faction belongs. e.g. In vanilla england is northern_european, so a CAS file in faction_variants\england is only used if that CAS file is mentioned in the northern_european section of descr_cultures.txt.

    It might be that none of your files are unused. Mine is a mod of a mod, both of which have added a bunch of CAS files and have a lot of changes to factions and their cultures. So, for example, there were quite a few CAS files in faction_variants folders for the (now) wrong cultures, leftovers from the original mod. Even the original mod seems to have a lot more CAS files than it needs, probably older versions that were never removed.

    * I think. Vanilla has quite a few which I can't find referenced in any file at all, e.g. eastern_city_buildings.cas, eastern_city_wall_3.cas, eastern_city_wall_4.cas and a lot more of similar names for all cultures. The mod (Third Age) has its own similar things. Does anyone know what these are?

    seems that the size of the file increases which leads to loss of shadow as you mentioned...
    I have noticed that in some cases vertex welding did not reduce the file size very much at all but still made a difference to the shadow problem. So I'm not sure that file size is a reliable indication of how much it will break shadows, or at least I am sure that the amount a file's size is reduced by is not a reliable indication of how much it will help.
    Last edited by Withwnar; August 08, 2016 at 11:56 PM.

  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,068
    Blog Entries
    35

    Default Re: Strat settlement models missing shadows

    Quote Originally Posted by Withwnar View Post
    * I think. Vanilla has quite a few which I can't find referenced in any file at all, e.g. eastern_city_buildings.cas, eastern_city_wall_3.cas, eastern_city_wall_4.cas and a lot more of similar names for all cultures. The mod (Third Age) has its own similar things. Does anyone know what these are?
    It's a RTW leftover - there the settlement\port models consisted of two parts: wall and buildings, hence the model's names. I needed to merge the original models (wall and buildings) when I converted Rise of three Kingdoms from RTW to M2TW, hence I am sure of that.
    Last edited by Gigantus; August 11, 2016 at 10:44 PM.










  12. #12
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Strat settlement models missing shadows

    So those can safely go. Great, thanks.

  13. #13

    Default Re: Strat settlement models missing shadows

    I've finally had a proper go at this by dismantling bits of PKH - stream of consciousness text during testing here

    99% sure Character .cas, resources on map, trees other campaign textures make no difference.

    Number of textures for the residences doesn't seem to make much/any difference either. Switching my experimental model from 3 textures to just 1 of them didn't help.

    I'm getting the start of the problem (last culture missing port shadows) with:
    total residences folder size 5.15MB
    19 standard residence models (they're being re-used by 5 cultures so I suspect counting 5 x)
    10 faction_variant cas's (all at 55kb, copied versions of a vanilla fortress)

    reducing the size of the standard residence models did help on one experiment, but I've reverted back for the above stats - our max one the huge_city is 158kb and that is probably counting as 5x for each culture even though most of the cultures won't be allowed to build that level - so that can get nerfed to a box for them

    it is rather limited though what you can actually get away with!

    for other info - for the crash on exit problem only files with valid names (e.g. something listed in descr_cultures) count towards total number of variants

    for the shadows problem - having 'valid' .cas files in the folders, e.g a huge_city variant for wales, if wales can't/hasn't actually built a huge_city - still contribute to the shadow problem/limit

  14. #14
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Strat settlement models missing shadows

    99% sure Character .cas, resources on map, trees other campaign textures make no difference.
    By resources do you mean the number of occurrences of them? e.g. 1 Wine resource vs 100 Wine resources.

    The resource models themselves do make a difference to the shadow problem, confirmed in post 6. However, vanilla ones are already typically quite simple/low vertex count so it's possible that changing them isn't having a noticeable effect. Most changes to resource models didn't have any effect, as I remember things. But some did, e.g. some of the big TATW ones.

    In the DCILA mod we later added a bunch of new, complex resource models. All my work getting shadows back went down the drain.

  15. #15

    Default Re: Strat settlement models missing shadows

    Quote Originally Posted by Withwnar View Post
    By resources do you mean the number of occurrences of them? e.g. 1 Wine resource vs 100 Wine resources.
    ahhhh- I deleted them from descr_strat so no occurrences on map - but I should re-check if the called models are counting towards it anyway - I'd not registered that you were talking about the resource models at that point! Thanks for the nudge.

    In the DCILA mod we later added a bunch of new, complex resource models. All my work getting shadows back went down the drain.

  16. #16
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Strat settlement models missing shadows

    Mmm, yes, residence models that aren't used still count in the shadow problem. Resources would too, I expect.

    It's like the game does some processing at campaign load (or game load?) to work out what the shadows need to look like. But it doesn't take into account whether each model is actually used by the game/mod, so processes everything it finds. And runs out of steam at some point if there is too much (too complex in total).

  17. #17
    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,068
    Blog Entries
    35

    Default Re: Strat settlement models missing shadows

    Have you tried if disabling caching helps?

    [io]
    disable_file_cache = 1










Posting Permissions

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