I’m currently in the process of brainstorming how to create a game I have in mind.
It will involve the usage of mass NPCs, no pathfinding required. Simply use of the humanoid.MoveToFinished event. Essentially the idea is players can buy NPC’s that will attack the other team. The game would consist of 3v3
I was hoping to in theory have a total of 200 max possible Humanoid NPC’s on the battle field at a given time. The map is very simple with not a lot going on. The game’s focus will be on the NPCs battling.
My question is, what do I need to read up on for maximum performance regarding using Humanoids. I want the best efficiency I can get and maximize performance. Any tips or information would be greatly appreciated. And in this scenario, likely what is my maximum amount of Humanoids I could possibly use if well optimized overall before I start seeing noticeable lag? Thank you.
Humanoids (and the npc) do not need to exist on the server. (since its visual)
It is probably fine if you disabled every state you dont use, even with 200 of them.
I tested on an empty baseplate with 512 drooling zombie (no script inside) without disabling any state and there is no frame drop.
Although the ping went up 20 ms.
What happens if you ordered them all to walk to a point? I was reading, body mover is better to use? I’m not really sure what that even is. I’m an old developer so it’s been years since I was working with this stuff.
you could use ray marching basically it loads things only when you close to them lets say i have a ray of 250 studs i can only see that part if im 250 studs close at min
How you do this is you use a ray with raycasting then say if ray touch then add a humanoid into the object with this script then do the opposite thing for the else.
I’m going to be using an RTS style camera for this. It’s also going to be a somewhat small battle field. Big enough that you need to scroll across it to see everything, but a full scroll could be done in around 3-4 seconds (depending on sensitivity)
In my case with this camera, how would that work? Or would it be best to not use this.
And when you say pop a humanoid into it. Are you saying that instead of Humanoids I use a single part with velocity moving. And then send a ray towards that part, and then change the part into a humanoid? Or am I not understanding this?
What if the player looks away from the part? Do I turn him back into a block, how do you detect that? Do I have a script constantly sending out ray trace every 0.02 seconds?
What I don’t understand is, how do I know if the camera is viewing the object? I’ve never used raytracing, but if you’re just sending a point to an object, how do you know if the point is in the camera view?