How do Paradox games manage game speed to avoid lag?

0
5
Asked By CreativeCoder77 On

Hey everyone! I'm diving into C++ to build some basic games and, eventually, my first real game. I've only made turn-based games so far, and now I'm looking to tackle real-time games with pause functionality. I'm curious about how I can program a system where the game theoretically never lags, only throttles the tick speed. Is it possible to create something that's not dependent on the operating system? Currently, I throttle the tick speed if CPU usage exceeds 80%, but it seems like there might be a better solution. Any insights would be appreciated! Thanks! 🙂

2 Answers

Answered By RetroGamer45 On

I have to disagree a bit here. Paradox games definitely experience lag too, especially late-game in EU4. Older PCs especially struggle under the load.

Answered By DevScribe25 On

I'm not fully familiar with how the specific games work, but your mention of "never lags" raises a question for me. Tick speed in a game loop is crucial — you run the game's logic for each frame, and if you have leftover time to meet your tick rate, you basically just sleep until it's time for the next tick. It's all about balancing the game loop with the input and the visual updates. Paradox titles like Stellaris and Cities: Skylines use a dynamic tick speed based on CPU usage to manage performance, often making it feel like there's no lag as the game simply progresses more slowly. For example, if your CPU can handle 100 calculations per tick but then ramps up to 1000, you can slow the game down without degrading the experience too much, ideally keeping your FPS stable.

UndercoverNerd -

Totally get what you mean! Paradox games have a unique way of managing this dynamic system. If the calculations rise, the ticks slow down, aiming to keep things smooth even as complexity increases.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.