1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Anyone Solved the Strategic View Error when Adding Too Many new SV Entries?

Discussion in 'Civ5 - Creation & Customization' started by sman1975, Feb 10, 2021.

  1. sman1975

    sman1975 Emperor

    Joined:
    Aug 27, 2016
    Messages:
    1,246
    Location:
    Dallas, TX
    Hey everyone,

    In case you weren't aware, when you add more than 50+ entries to the ArtDefine_StrategicView database, you eventually get a bizarre error in the Strategic View, where thousands of "ghost units" clutter the map, rending it unusable.

    I'm currently working on a mod that evidentially adds more than enough records, so the SV is thus corrupted. Unfortunately, if I omit SV adding entries for the new Resources, it crashes the game when you try to enter the Strategic View.

    So, my choice is live with a corrupted SV map, or let the game crash anytime a player attempts to use it anyways. Seems like a bad set of choices.

    I've searched around, but am only seeing posts where people are reporting the problem. Not much useful info on how to correct it. Would appreciate it if anyone has any suggestions.

    Thanks!
     
    Troller0001 likes this.
  2. LeeS

    LeeS Imperator Supporter

    Joined:
    Jul 23, 2013
    Messages:
    7,140
    Location:
    Illinois, USA
    There's no solution.

    The limit is 255 total entries in the table from whatever source. It is buried in the game's memory allocation space definitions and so is not accessible.

    This is why so many of us don't add new unit ArtDefs -- we just use existing ones. Because even if you reuse an existing Strategic View Icon but with a new ArtDef this will require a new entry in the ArtDefine_StrategicView table, with one more step towards Icons Icons Everywhere! bug.

    The issue tends to manifest on the main map as well.
     
    sman1975 likes this.
  3. sman1975

    sman1975 Emperor

    Joined:
    Aug 27, 2016
    Messages:
    1,246
    Location:
    Dallas, TX
    Thanks, @LeeS. I'd suspected that. However, if I really, really need to add a bunch of new art defs, and thereby break the SV map, is that a big problem or not? A clumsy way of asking, how many players (as a %) would be impacted, do you think?

    I find it more than a bit depressing that someone designing this game thought, "Hey, it'd be a great thing to place a hard limit on how many models can be used at any one time..." Perhaps as a way to force some stability into the overall design?

    Also...

    What do you mean by this? You've got me a bit worried... :wow:
     
  4. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,532
    Location:
    Near Portsmouth, UK
    How many players ... all of them. It affects anyone who changes to the SV map, the game slowly bleeds memory. How soon it manifests and the game starts to corrupt/crash depends on a number of external factors - how much memory in the machine, what else is running, etc, etc, etc.

    As for hard limits, this is just one of many that are/were in the game. Some got lifted, some didn't. And remember that 90% of the programmers of Civ V were only interested in hitting their deadlines for their part(s) of the game and really didn't care/consider about mods/modders
     
    sman1975 likes this.
  5. sman1975

    sman1975 Emperor

    Joined:
    Aug 27, 2016
    Messages:
    1,246
    Location:
    Dallas, TX
    Thanks. Makes sense. I've seen it myself on large maps in late game. Six minute AI turns, and so on.

    Was wondering - unmodd'ed Civ5 has 275 entries in the ArtDefine_StrategicView table, with the last 2 being Cocoa and Bison. I haven't tested by adding a few SV entries at a time, but I'm thinking 256 might not be the hard-coded ceiling. I'm wondering if anyone knows that actual "do not pass GO" number is?

    Well, that's been the case on every project I ever worked on. I suppose I should be thrilled the game is as modable as it is. :lol:
     
  6. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,532
    Location:
    Near Portsmouth, UK
    Definitively? No. As that number is hard coded into the database and/or graphics engine and we don't have the code for those.

    At a guess? 355 and 384 are both "sensible" numbers, but then 321 looks pretty, so it could be that
     
    sman1975 likes this.
  7. LeeS

    LeeS Imperator Supporter

    Joined:
    Jul 23, 2013
    Messages:
    7,140
    Location:
    Illinois, USA
    I think the 256 number was guesstimation from before the release of BNW, since that was close to where the issue would start to appear, and 256 (0-255) is one of those hexadecimal (binary-byte) magic numbers. (1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, etc.). I never questioned the exact number since the issue was known before I ever was active on the modding forum and the old gods of the time said "256 and yer ded, kid!".

    The thing with it manifesting on the main map is mystery icons appearing everywhere on the map. Multiple threads around the forum from before the dark times have images showing this on the main map as well as the images with the bugger showing on the strategic view.

    The 274 that are present in the unmodded game plus another 50 would be 324, which is just an oddball number for a computer memory allocation assignment. Of course, we're talking Firaxis here, and Civ5, so "oddball" is right in the game's wheelhouse -- looking right at you, ChangeJONSCulture().
     
    sman1975 likes this.
  8. Ja Mes

    Ja Mes Chieftain

    Joined:
    Dec 5, 2020
    Messages:
    10
    Gender:
    Male
    Just to make an addendum because this has been keeping me up at night for a few weeks now, I think there might be a trade-off (There are no solutions, only trade-offs, I'm told).

    From what I can tell, in strategic mode, the name of a unit is still available if you hover over the unit, like in regular view.

    Obviously, like in normal view, the unit flag is a visual shorthand for the player to quickly know what the unit is. But, as you've all obviously covered, the game starts crapping itself when there are too many strategic view flags.

    Well, we could either convince every modder to stop creating unique, good looking SV flags, or we could create a standard with the magic of SQL. I propose the latter:

    -Using SQL, delete all of the SV unit flags.
    -Create a new, standard set of flags for SV that is beneath the limit. My first idea would just be the 26 letters of the alphabet, or a different icon based on unit type (melee, ranged, etc)
    -Using the SQL LIKE Operator, which I really hope Civ5's SQL has, add our new standardized SV flag. For example, every unit that has a name that starts with "A" will have a SV icon that's an "A."
    -Make sure the mod loads after all other mods.

    While this would certainly be less visually appealing than Strategic View flags that match the normal view flags, it would likely fix the issue of Strategic View being Literally Unplayable(TM) and make a lot of mods compatible.
     
  9. sman1975

    sman1975 Emperor

    Joined:
    Aug 27, 2016
    Messages:
    1,246
    Location:
    Dallas, TX
    I’ve thought about similar solutions, but I’m not sure it’s the number of sv_*.dds files added to the game. I think it has to do with the number of records in ArtDefine_StrategicView table that cause the problem. So, even reusing the DDS files won’t cut the number of records, since every unit adds a record.
     

Share This Page