Steady FPS drop even in menus or when paused, disappears with yesmen.

  • We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

NickoBlack1

Recruit
Sep 11, 2022
4
11
Hello! So, been playing the new update for awhile, when I noticed a constant 20 fps drop regardless of what I was doing. Playing around a bit, if I switched characters in the same game, the fps drop would completely disappear. In addition, when in debug mode, if I had yesmen turned on the fps drop would also disappear. It might have something to do with the size of my realm, since im running a pretty large empire. Any help would be appreciated! I attached an error.log
 

Attachments

  • error.log
    3,7 MB · Views: 0
  • 2Like
  • 1
Reactions:
Is that save started under 1.6.1.2 or the current patch?

If the former, please revert to that game version in the Steam betas tab for this game. If the latter, please post that save in Bug Reports here, thanks!
 
Started the save under 1.7, heres my latest save. I save pretty often, so I have a lot more from as the game progressed too. I was using community flavor pack, nameplates, and a debug toggle mod although I was able to reproduce the issue without mods. Should also mention that switching characters makes the lag go away.
 

Attachments

  • latest.ck3
    37,9 MB · Views: 0
Did some more testing! After playing around a bit I decided to vassalize everyone with yesmen, then turn it off, and the lag completely disappeared. It seems there are more people possible to be vassalized, but I only did all the ones in the suggestion and it disappeared. I attached an after save to show off the difference, wondering if anyone else can replicate the issue.


Eventually was able to find a fix for the issue. Some code in 00_character_interactions.txt. Attached a version of the file I made that fixes the lag.
 

Attachments

  • laggone.ck3
    38 MB · Views: 0
  • default_00_character_interactions.txt
    44,1 KB · Views: 0
  • nolag_00_character_interactions.txt
    39,7 KB · Views: 0
Last edited:
  • 1Like
  • 1
Reactions:
Thanks for that great work! Did you report this in Bug Reports, as I suggested?
 
Did some more testing! After playing around a bit I decided to vassalize everyone with yesmen, then turn it off, and the lag completely disappeared. It seems there are more people possible to be vassalized, but I only did all the ones in the suggestion and it disappeared. I attached an after save to show off the difference, wondering if anyone else can replicate the issue.


Eventually was able to find a fix for the issue. Some code in 00_character_interactions.txt. Attached a version of the file I made that fixes the lag.

where do you add this, I have the bug too it is very annoying to play
 
All the fix does is remove all the opinion modifiers when vassalizing, so the lag is caused by modifiers ?? This should simply be fixed by Paradox because taking out the modifiers is just plain and simple cheating now.
 
  • 2Like
Reactions:
Rather than removing the modifier, like the above fix does, you can change it to this instead:
Code:
modifier = {
    desc = offer_vassalization_interaction_aibehavior_vassal_opinion_tt

    trigger = {
        scope:actor = { number_of_powerful_vassals >= 1 }
    }

    add = {
        value = 0

        scope:actor = {
            every_powerful_vassal = {
                if = { # Neutral opinion
                    limit = {
                        save_temporary_opinion_value_as = {
                            name = vassal_opinion
                            target = scope:actor
                        }
                        scope:vassal_opinion > -10
                        scope:vassal_opinion < 10
                    }

                    add = 1
                }
                else = { # More extreme opinion
                    add = scope:vassal_opinion

                    # Round down to the nearest 10
                    divide = 10
                    floor = yes
                    multiply = 10
                }
            }

            divide = number_of_powerful_vassals
        }
        divide = 5
    }
}

The main performance issue is all the opinion triggers. The above snippet replicates the original functionality by removing them and using maths instead, which makes it much faster and removes the stuttering.
 
  • 4Like
  • 2
  • 1
Reactions:
Ah, that's why I got the stutter... Btw it has been more than a week already, when can we expect the patch?

Also, this works, thank you
Rather than removing the modifier, like the above fix does, you can change it to this instead:
Code:
modifier = {
    desc = offer_vassalization_interaction_aibehavior_vassal_opinion_tt

    trigger = {
        scope:actor = { number_of_powerful_vassals >= 1 }
    }

    add = {
        value = 0

        scope:actor = {
            every_powerful_vassal = {
                if = { # Neutral opinion
                    limit = {
                        save_temporary_opinion_value_as = {
                            name = vassal_opinion
                            target = scope:actor
                        }
                        scope:vassal_opinion > -10
                        scope:vassal_opinion < 10
                    }

                    add = 1
                }
                else = { # More extreme opinion
                    add = scope:vassal_opinion

                    # Round down to the nearest 10
                    divide = 10
                    floor = yes
                    multiply = 10
                }
            }

            divide = number_of_powerful_vassals
        }
        divide = 5
    }
}

The main performance issue is all the opinion triggers. The above snippet replicates the original functionality by removing them and using maths instead, which makes it much faster and removes the stuttering.
 
Rather than removing the modifier, like the above fix does, you can change it to this instead:
Code:
modifier = {
    desc = offer_vassalization_interaction_aibehavior_vassal_opinion_tt

    trigger = {
        scope:actor = { number_of_powerful_vassals >= 1 }
    }

    add = {
        value = 0

        scope:actor = {
            every_powerful_vassal = {
                if = { # Neutral opinion
                    limit = {
                        save_temporary_opinion_value_as = {
                            name = vassal_opinion
                            target = scope:actor
                        }
                        scope:vassal_opinion > -10
                        scope:vassal_opinion < 10
                    }

                    add = 1
                }
                else = { # More extreme opinion
                    add = scope:vassal_opinion

                    # Round down to the nearest 10
                    divide = 10
                    floor = yes
                    multiply = 10
                }
            }

            divide = number_of_powerful_vassals
        }
        divide = 5
    }
}

The main performance issue is all the opinion triggers. The above snippet replicates the original functionality by removing them and using maths instead, which makes it much faster and removes the stuttering.
Thank you so much. I made a new mod and uploaded it to the steam workshop crediting you!