I am currently in construction of making a tatooine themed RPG map, which I plan to use NPCs as a major part. What's the max limit of NPCs the engine can hold in a map?
Mkay, get ready for a lot of informations...
NPCs are counted as entities. The maximum number of entities is 1024. When you go above this number, the game will crash.
However, you need to leave at least 32 entities free for all 32 players to spawn. You also need to leave room for each spawn point, saber clash effects, weapon spawns, item spawns, ammo, func_ entities, target_ entities, and more. (Func_group and Light entities do not count, though. They are compiler-only.)
So the real question should be how many entities to leave free in your map. I would say to leave at least 80, but preferably you should have over 130 free entities if you plan on doing some spawning.
If you want to know how many free ents you have, here's how I do it (I'm sure there's a better way, though)...devmap your map, turn on noclip, bind a key to "npc spawn mutant_rancor" and start spawning. Count how many you can spawn until the game crashes. When it does, that's your number of free entities.
Keep in mind, though...the more entities you add in your map, the harder it will be for lugormodders and makermodders to modify it.
For those of you who love NPC spawning, yes, this DOES mean you can spawn 900+ npcs without crashing the game. Good luck finding a map with few enough entities to do that on, though. There are some, but they are rare and typically not very good.
EDIT: Little tip for ya: if you want to save on target_scriptrunners, you can put a "usescript" key on a trigger instead. It works almost the same, and can save a ton of entities when coupled with some creative scripting.
NAB, you can also just run a local server on lugormod and do /mapents count o_o.
Thank you, I always wanted to know a better way to do that. XD I imagine there is no universal method aside from rancor spawning, though. :(
There is one extra complication however, the game can only handle up to 16 UNIQUE npc's at any time, after which the game will crash. (Unique being different kinds of npcs, not multiple of the same)
This limit can be raised by mods, easilly, but be aware of that limit in case the mod you're running did not raise it.
1. Func_ entities absolutely DO count in the total entity count in the game (and func_doors without targetnames each spawn an additional entity, trigger_door, that also counts in the entity count). 2. I'm not sure there is a limit to how many NPCs total there can be in a map, but I have noticed that after around 14 different types of NPCs lower-end clients start crashing, so I would try to keep to that limit (vehicles included).
Oh, and I don't think /mapents is a command on the lugormod available from JK3files. The latest version can be found at... idk if I'll get in trouble for advertising. E-mail me if I'm right about mapents. [EMAIL="email@example.com"]firstname.lastname@example.org[/EMAIL].
NPC spawning like some other features ingame will never work as people always predict. Seen servers crash simply by changing to another base map.
Maybe if your making say an SP map or something sure bots can be a major part but a massive RP themed map needing npcs? Wouldn't players do better. :lookaround:
KhyronJinn;48020251. Func_ entities absolutely DO count in the total entity count in the game
Ya, that's what I said...func_group is the only exception, it gets treated as a mini-worldspawn. I did forget about func_doors without targetnames creating the trigger_door, though.
Lots of fine details, there are...
NAB622;4802175Lots of fine details, there are...
Yeah, don't even get started with trigger_asteroid_field... lulz.