Adding + Removing Nodes every frame

I’m trying to separate my rendering from my game logic, and I was wondering if it is bad to detach all children and re-add them once per frame? What would the penalty be for this sort of thing? I imagine it could be like 100-200 objects per frame doing this. This includes models with animations.

I can explain more if this seems idiotic and you’re wondering why

Yes, please.

Yes, it’s very very bad. Performance-wise, it’s literally just about the worst thing you can do short of also recreating your meshes.

You force a bunch of stuff to be unnecessarily recalculated every frame.

Hmm it seemed more elegant this way. It’s a network game so the server only really runs the physical/logical part of the game, then spits out whatever the result was of that update. For example there are arrows. On the server these have a trajectory, and other data. I don’t really need to render the actual arrow model on the server. All the clients care about for the arrow is the position and rotation. So I don’t want to use the “Arrow” class on each client because it will contain tons of functions they don’t care about and will be confusing. I definitely think it’s good to separate out the objects state and rendering from the logic of it.

Do you think it would be better to have every network entity generate an ID, then on client side when it receives an arrow state or whatever, it can just check if it already made that entity and if not add it then? And also check the current entities, if any need to be removed.

Yes, that’s waaaaay better.

There are even examples you can look at for real time networking already built…

They use my SimEthereal networking library for real time syncing but the architecture of any networked game would be similar.