Impose a limit on total number of units

Discussion in 'Community Patch Project' started by arthurF, Jan 8, 2019.

  1. cozye

    cozye Chieftain

    Joined:
    Sep 9, 2017
    Messages:
    10
    >sweden
    >birka
    >muslim
    my sides
     
  2. arthurF

    arthurF Warlord

    Joined:
    May 31, 2017
    Messages:
    212
    I wish I knew what you guys were going on about. My post was about how long it was taking for the AI turns. This is a processing (CPU) issue. Nothing to do with the graphical representation. The limit on number units thing was to reduce the instructions the AI had to go through each turn, which on large maps, some time after 1600, on immortal setting or above, starts to really friggen chug.
     
  3. cozye

    cozye Chieftain

    Joined:
    Sep 9, 2017
    Messages:
    10
    I think it's probably just the way the software was written. Poor memory management and all that. Having a single graphical unit probably helps save memory? Less animations to process = less steps?
     
  4. StevenV

    StevenV Chieftain

    Joined:
    Jun 28, 2016
    Messages:
    82
    Location:
    Hungary
    Hi,

    there is two solution, which you could try to reduce the number of units.
    • easy: Set the min city distance from 3 to 4. This will result a 20-50% less city / map. If you have less cities you can expect less units. I tried it in my last game and works pretty well. You need to change only a few values in an SQL file. I dont remember which one, but I can find if needed.
    • more complex: play with the Building.sql and decrease/delete the granted supply numbers in buildings like barrack / wall / stable / etc. It is more complex because there is many building you need to pay attention, not to mention the UB. However, you have more control.
    Eventually, you could combine these two solution. :smoke:
     
  5. Aristos

    Aristos Lightseeker

    Joined:
    Dec 11, 2001
    Messages:
    3,855
    Gender:
    Male
    Location:
    Deep inside...
    Use the following code inside a mini-mod of your own (SQL):

    Code:
    /*
    Unit Movement Animation Duration
    The animation time required for a unit to visually move between tiles.
    The default VEM values are 25% of vanilla (quarter duration = four times as fast).
    */
    UPDATE MovementRates SET
    TotalTime            = 0.25 * TotalTime,
    EaseIn                = 0.25 * EaseIn,
    EaseOut                = 0.25 * EaseOut,
    IndividualOffset    = 0.25 * IndividualOffset,
    RowOffset            = 0.25 * RowOffset;
    
    /*
    Aircraft Move Speed
    The speed of aircraft movement.
    The default VEM values are 400% of vanilla (four times as fast).
    */
    
    UPDATE ArtDefine_UnitMemberCombats
    SET MoveRate = 4 * MoveRate;
    
    UPDATE ArtDefine_UnitMemberCombats
    SET TurnRateMin = 4 * TurnRateMin
    WHERE MoveRate > 0;
    
    UPDATE ArtDefine_UnitMemberCombats
    SET TurnRateMax = 4 * TurnRateMax
    WHERE MoveRate > 0;
     
    ryanmusante likes this.
  6. ryanmusante

    ryanmusante Regular Supporter

    Joined:
    Jan 4, 2018
    Messages:
    1,089
    What is the best way to merge yours with this SQL? Are the AnimationPaths redundant?
    Code:
    -- Aircraft rebase animations.
    UPDATE MovementRates SET TotalTime = 0.01
    WHERE Type = "AIR_REBASE";
    
    UPDATE AnimationPaths SET MissionPath = 0
    WHERE Type = "ANIMATIONPATH_AIRFADEIN";
    
    UPDATE AnimationPaths SET MissionPath = 0
    WHERE Type = "ANIMATIONPATH_AIRFADEOUT";
    
    --AttackRadius must be multiplied to ensure, that bomber do only 2 circles above the target as with the default speed
    
    UPDATE ArtDefine_UnitMemberCombats
    SET AttackRadius = 4 * AttackRadius
    WHERE MoveRate > 0;
     
    Last edited: Jan 27, 2019
  7. Stalker0

    Stalker0 Baller Magnus

    Joined:
    Dec 31, 2005
    Messages:
    8,486
    Or you can just turn on quick moves for everything, wouldn't that be even better for performance?
     
  8. Aristos

    Aristos Lightseeker

    Joined:
    Dec 11, 2001
    Messages:
    3,855
    Gender:
    Male
    Location:
    Deep inside...
    What if you want some animations? Quick moves is perhaps the one thing that civ 6 got right, as it really is QUICK moves, not NO moves, as in civ 5... those sql lines basically perform exactly like the Quick moves function in civ 6, with the added benefit of also quick flying the planes (which in civ 6 are extremely annoyingly slow, good that the AI is so smart that it does not build any airplanes to make for a better player experience... :rolleyes:).

    @ryanmusante : after quick look, I think the lines I use are more generally encompassing, and they work well.
     
  9. ryanmusante

    ryanmusante Regular Supporter

    Joined:
    Jan 4, 2018
    Messages:
    1,089
    So basically, Quick Moves by default is closer to .01 where they move so fast you can hardly see origin and destination of units?
    Code:
    UPDATE MovementRates SET
    TotalTime            = 0.01 * TotalTime,
     
  10. Stalker0

    Stalker0 Baller Magnus

    Joined:
    Dec 31, 2005
    Messages:
    8,486
    This is where my knowledge of the system fails. The thread was talking about ways to speed up performance, and some of that is graphical...aka animations. I personally would think that fast animations still consume the same resources as slow one, so your not really seeing a performance improvement. With quick moves, which removes the animations, it frees that part up.

    I could be completely wrong about that, but that was the thought.
     
  11. Aristos

    Aristos Lightseeker

    Joined:
    Dec 11, 2001
    Messages:
    3,855
    Gender:
    Male
    Location:
    Deep inside...
    Civ 5 is known to render the animations off-screen, meaning they coded the engine so stupidly wrong that it renders ALL animations in the game, even those that the player does not see because they are off the screen and/or under the shroud... :crazyeye:

    Therefore, ANY increase in animation speed becomes an increase in performance. That's why the turns are so much faster in any given game the moment you turn off animations (an extreme case of animation acceleration).

    AFAIK, they did not repeat that mistake (at least that one) in civ 6.
     
  12. vyyt

    vyyt Deity

    Joined:
    Jan 28, 2005
    Messages:
    2,340
    Location:
    Czech Republic
    I could be reading this wrong, but isn't the QuickTurns mod (which turns off the animations of AI units unless at war intelligently) the most elegant and efficient solution?
     
  13. ryanmusante

    ryanmusante Regular Supporter

    Joined:
    Jan 4, 2018
    Messages:
    1,089
    I posted from the sql included with quick turns, the" faster aircraft animations" portion. Because quick turns is a merger of both.
     

Share This Page