Entity System Optimization

my GPU: GT 710
my CPU: i7-4770

rate my TD Entity System

3 Likes

Maybe try spawning in less enemies at once.

2 Likes

Looks pretty good, are they moving via humanoids or cframing?

1 Like

I assume you used loops to assign each enitity instructions, however that is not the most effective way. You should try to think of those entities as a one giant object then move it. You could sort it our using rows and things. Honestly sky is the limit

1 Like

It seems like you’re using humanoids for each entity. As other has pointed out, you should try using CFrames. If you insist on using humanoids, then you can try disabling every humanoid state that is unnecessary.

This is a bit overkill but, you can try using a number to determine an entity position, just a single number, the number represents the distance from the start, and the client will process this data to render the entity

2 Likes

I used BulkMoveTo(), if it was humanoids I would have crashed

1 Like

Nope its BulkMoveTo(), no humanoids here

2 Likes

Theres only one RenderStepped that loops thru the enemies table and uses BulkMoveTo() to move them

1 Like
  1. I would definitely not run this in renderstepped but instead in .Heartbeart
  2. Try lowering how often each NPC updates to a rate like (1/55) which would naturally divvy up the work across different frames instead of it all being done on the same frame
2 Likes

Alright, also I made it that if you start lagging the rate will be lowered

2 Likes

Im trying to make it that if an enemy isnt on screen the walk animation stops and plays once its on the screen. What would be the most optimized way to do this?

1 Like