The Node system is pre-generated and then raycasted on the server 45 degrees on all directions per node, and if it hits a “non-node” then it returns nil.
For ledges it’s handled manually and are named separately from regular nodes.
I don’t use the CanTouch property, as it’s extremely unoptimized and can run unexpectedly. (I mainly use a lot of raycasting for my NPCs and it doesn’t draw too much FPS since it’s:
iterating every second for the Tagged NPC, to check whether it’s in the players range
Either use GetPropertyChangedSignal or AttributeChangedSignal for some checks (no iterations)
Calling Anchored whenever the target distance is out of reach, idling, unloaded area, etc.
I know you could optimize NPCs on roblox way more efficiently, but for what i’m trying to reach it’s alright. (And works for raycasting without glitching too much)
@YTFTAshPlays , me an my small developing team we’ve been planning on creating a Left 4 Dead 2 remake on roblox, i am resposable for modelling the characters and environment, but i’ve been searching to how the left 4 dead 2 ai works also how the gib system works and for some examples inside the developer forum.
Your ai system is perfect and has a really close result to Left 4 Dead 2 ai. I would be really grateful if you could open source that system for my team, if you dont agree its alright.
The goals of this remake is:
reach a population number of 50+ zombies on stable 30+ fps with semi-realistic and detailed characters made on roblox CSG
Realistic and well built environments
and a high detailed gib system that uses the same idea of Left 4 Dead 2 gore system with roblox realtime CSG
Here is some examples to how the character’s and zombies will look like, also with the infecteds design style from Left 4 Dead 2
Note: these models were made by a guy called DeliverCreations!
Sorry i’m not too comfortable sharing my projects for public use, but I will give some insights on what I used for this.
Node mapper by sleitnick Node Mapper for Pathfinding (I downloaded the plugin and configured its internal modules for personal use)
Custom made raycast that only detects the front of an npc when they move (for vaulting, climbing, etc)
Another raycast system for creating the nodes themselves (not yet refined) using a type of grid system where the nodes are always 4 studs apart and raycasted each node 45 degrees. And if it returns a filtered node using raycast’s filtering system then it writes it down using an ObjectValue. If none then return nil.
(The nodes are not manually placed, but they can be if you need tighter spaces)
Client animations always to improve server performance and combat animation delay/lag when the animation fires.
CollectionService ← most important and hopefully you already know what it is
Block regions and areas, uses workspace:GetPartsInPart() it prioritizes the amount of weight / players in a region and if that has more players than the other regions it will add a number to an attribute, that specific region will get more AI priority. (Without having all the npcs to find the nearest player, they will moveto that region until near a player)
Kill NPCs that are far from the players reach, whether the player has passed a certain checkpoint or not if they do then kill all the NPCs from a further region and spawn new important ones nearby.
I also don’t know why you would need 50? Unless you’re trying to make something grand the original L4D games only used around 30 common infected for a horde (Default)
if you’re trying to achieve the similar amount of FPS without lowering triangle count from L4D with 30 or 50 zombies, it is extremely possible but it requires a more planned map to do occlusion culling.
How a region works: (to reduce calculations and find the nearest group of players) ← if there were a group of players