Hello,
Ok so basically my game has hundreds possibly thousands of fully animated humanoids with scripts and gears such as guns which will raycast individually how do i make them not lag cos i wanna make like an army commander game so we will have alot of bots with guns (and by that i mean like a LOT)
- Br, iSyriux
If they all have the same humanoid stats, you could make a folder with the humanoids in workspace, and then put the army men in another folder, and for each army man in the folder, insert the humanoid if the character’s humanoidrootpart is close the the army man’s.
Ok, so this is funny because I just finished my game that uses hundreds of humanoids at the same time, and let me give you a valuable word of advice, DONT USE HUMANOIDS!! Use animation controllers with the rigs and TweenService on the HRP to replace MoveTo(). If you have fully decided on using humanoids however, definitely disable all of the states you do not need on it via humanoid:SetStateEnabled()
This seems like something that would benefit from some sort of live content streaming. Are all the humanoids going to be close together in the game, how many of these humanoids would you expect a single player to be able to see at any one time in game?
Hello,
For @BizarreBazaar, how would I possibly be able to achieve this? Could you explain further in-depth?
For @Moonvane, how would I use animationcontrollers? Wouldn’t the rigs lag even more without humanoid?
For @McThor2, yes, the humanoids will be close together, lined up in rows and columns like an army
[color=“8a8a88”]Image from Clone Wars[/color]
This is the important question and will decide everything:
Will each NPC have its own brain, meaning will each one have to chase the the closest player to it and move to it?
Or will each one move exactly forward all next to each other in an army, no differences between NPC1 and NPC2?
Hello,
Each NPC will move according to the unit organisation, and until it gets close enough to another npc or player, the npcs can decide to attack as a group and do another formation as a group, or if the threat is small enough, only a few or one npc will attack.
I know this sounds incredibly complicated and difficult to pull off, but I’m willing to .
I’m not going to say that’s impossible but making 1000 NPC that complicated and that incredibly optimized will be incredibly difficult.
There’s tons of threads around on this forum where tons of players have made attempts of doing so.
Being honest, the better way would to be in workspace, active steaming enabled. min is the minimum radius of studs around that the player that parts load, max is the maximum distance. a recommended would be around 500+ for the max.
Okay so I made a custom rendering and global targeting system for my game that funnels all the targeting for all the NPCs into one script and any NPC that is far away from the player is stored in ServerStorage. What is inherently laggy about humanoids? Is the statechanged connection of a script or the humanoid states in general?