Download

Independent frame rate for logic and rendering

I googled now for some time and couldn’t find any clear hint/answer to this question. but i know what rendering is separate from game logic (what is good and should make what i am asking here possible).
So the question is more general not directly C++ related but i think it’s the right place to ask. How/is it possible to run game logic simulation (world tick i guess) on one frame rate for example 20 fps, and render the whole scene with interpolation for example on 120 fps (if the hardware is capable of) or just uncapped. i found similar questions but only about physics but it’s not what i am asking for (or interested in, afaik PhysX has own threading and stuff) also some more indepth engine architecture description would be good. for example to know how exactly stuff is threaded and such (and where it’s processed so you can better understand what can/will block you).

Hello, and welcome to the forums!

If you wanted to have certain login run at say 20 fps, you could set the Tick interval for the Actor that does the logic to something greater, with SetActorTickInterval.

Or, you could add a custom Tick function alongside the builtin Actor tick.

That would be a lot more simple than another thread, but it may result in hitches if the “logic” is resource-intensive.

Hi! thanks but it seems to be just a higher level construct for timings (like i check this actor every real game logic tick but fire this event if N time passed an so on). as i understand right now the game thread is always 100% saturated? if you don’t limit fps. (i may be wrong ofc thats why i am asking here). originally i was asking if is it possible to ease the game thread and fully saturate render thread on data present (you can interpolate between states meanwhile the game thread will produce new data(states) for example )

also afaik you can just use timers to create tick groups (and disable ticking on actor at all) to achieve similar effect like SetActorTickInterval .

I honestly am not very sure. My guess is that the game thread wouldn’t be completely saturated, because it would still be hung up by the render thread.

I think Timers would be a viable option.

Focused on physics engine frame rate, but relevant reading.

1 Like

yes i read this like 10 year ago. but thanks!