How Would I Optimize My Entity System In CPU

Most of that data can be sent when the entity is created.

You are correct though, the client will need to receive updates about game state. Things like what towers are attacking what entity, entity health changes, etc. That may end up being the most expensive part of the simulation.

I suppose, however, that the tower simulation and all could be deterministic on the client, meaning the client could run the tower simulation in tandem with the server, it could pick the same targets, and health could be determined on both the client and the server without any additional communication between them. That’s very theoretical though, I haven’t implemented anything like that for this example.

That doesn’t completely eliminate the communication, however. The client would still want to sync up with the server probably when entities die, and maybe that could be done somewhat in bulk.

I did just do a test with my entity system and I was able to simulate 2,000 entities in 0.2ms on the server without updating character models, so you have a lot of extra time to play with. 2,000 entities is a lot and I doubt you’ll really need to have more than that.

So we will try to the sync the client and server which are handling towers

ok soo i am done with home work i will read everything you guys said.

Ok Soo I Switched It To BulkMoveTo And It Kinda Didn’t Change Anything:

soo found out that spline was causing me cpu leaks and high cpu soo i switched it to lerp and it has the double amount of fps then spline wild.

I am curious how you will handle the tower targeting? like first and last

This is what I said to do. Oh well, no solution for me :man_shrugging:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.