This is practically pre-release software, I recommend making heavy modifications before you use this in a full fledged game, which you should be doing anyway!
Justice, in its current form, is a script (which I consider awesome) created to add basic NPCs to your game quickly and easily. It is designed to be hacked on rather than be used without modification. It features automatic NPC generation and makes it easy to designate areas for your NPCs to target. Justice can handle hundreds of NPCs. I have tested it with 1000 with no issues at all (except for an obvious performance hit) on my local machine.
Here it is running 20 NPCs in Studio. The markers that indicate where the NPCs are going only show up in Studio as a debugging aid.
And here is a more extreme example. 500 NPCs.
(I do not recommend running so many NPCs at once, it does cause issues as demonstrated in the example.)
And, just for fun, hereâs the run where I did 1000 NPCs simultaneously.
I have discovered the reason why player servers are capped to 200. All in the name of 5 FPS science! This joke no longer works because 700 player servers are a thing now. Damnit!
NPCs will automatically wander to areas that are tagged as Justice:Pathfindable
. You can create deadzones by using the Justice:Deadzone
label in a PathfindingModifier.
Configuration is provided as a Configuration instance and associated README file.
NPC generation is a bit more in depth. The Assets
script contains everything you need to generate unique NPCs. The default assets provided are what I like to call the âofficeâ asset pack of sorts. The original purpose of this script wasnât to be released to the public, but to be kept private for an office block to provide more life to the place. Thereâs some trivia for you.
Discriminators are used to make more unique NPCs. In the default configuration, the discriminators are configured as genders. This, in turn, makes it so only certain assets can be applied to an NPC (e.g. female faces can only go onto an NPC that has a discriminator of female
). You can see this used a little bit in the default Assets
file, where various things are reserved for various discriminators. There is a special all
discriminator which, regardless of what the NPCâs discriminator is, can be selected. This is to prevent duplication of assets over and over again just so you can have them for all of your NPCs.
If you look closely, you can see that under accessories
, there is a -1
. This isnât a typo, this is a feature of Justice where if this is selected, it skips adding an accessory to an NPC. This also works for hair
too.
As a reminder, this is meant to be a hackable script. Itâs not meant to be a one size fits all ordeal, so please modify it to your needs.
Download Build 6:
Justice.rbxm (46.8 KB)
History
Build 5: Justice.rbxm (21.7 KB)
Build 4: Justice.rbxm (21.7 KB)
Build 3: Justice.rbxm (21.6 KB)
Build 2: Justice.rbxm (21.4 KB)
Build 1: Justice.rbxm (21.0 KB)
The character, Justice, is from Helltaker, by vanripper. The art is his as well.