Better methods than a Render Pool?

My game consists of a lot of moving parts, both literal and figurative. I am using something I’m calling a Render Pool (Though this may go by a different name) to ensure that these are all recieving some kind of update per-frame. It is laid out as such;

RenderSystem.RenderPool = {
["First"] = {};
["Last"] = {};
["Entities"] = {};
["Character"] = {};
["Menu"] = {};
["UI"] = {};
["LowCost"] = {}; }

From here I then call a BindToRenderStep with something such as;

RS:BindToRenderStep("Last", Enum.RenderPriority.Camera.Value, function(dt) 
    for pos, obj in pairs(RenderSystem.RenderPool.Last) do

Different objects have different update actions, and some are more costly than other, meaning I do a quick calculation on the object’s-side to see if it is allowed to update on that frame.

Is there a better method to use than this for large scale update() calling?


That’s the method I use for these situations. Don’t know of a better one, and this works well and scales decently enough.

I do this differently. I do the calculation on the render loop side, so there’s no function overhead on objects that fail their conditions. I only call :Update() on objects when they’ll actually be updating.

1 Like

Ah, perhaps I should rephrase slightly.
Each object does update, however their more costly calculations get locked off until there has been an adequate space between their last check. As each object is added incrementally, this breaks them up so that they don’t all try and calculate on the same frame.

1 Like

Oh, that makes a lot more sense. My bad.

So, to make sure I’m understanding you now:

You update the simple calculations at 60FPS (or whatever max frame rate you’re getting) and do the costly work at a lower FPS, with each object staggered so they update at different frames.

1 Like

Yeah, and because everything is scheduled in an easily predictable fashion;
I know the Character is going to be updated before the Camera but also that Character has a costly raycast,
there shouldn’t be any stuttering mid-frame.

1 Like

Sounds great. I know you came here looking for a better way, but I think you have it covered already.


Thanks :slight_smile: Have been very worried for a lil while I was missing something big, this has put that at ease :slight_smile:
Muchas gracias!

1 Like