I’m relatively new to both developing games and posting on the Dev Forum and development for my first game has hit a brick wall. It’s one of those moments where you think something that is actually super complicated is actually relatively simple, and in hindsight, it probably shouldn’t have been the first game that I tried developing. Regardless, what’s decided is decided and I’d like to develop a habit of sticking through with a game to completion before moving on, which is why I’m making this topic.
I don’t want to reveal too much about the game’s details, but the problem I’m having is concerning the implementation of AI enemies and pathfinding. My planned game is basically a zombie survival game, where there are multiple different types of enemies that act and react completely different from one another. Here are the basic categories:
- The most common type, humanoid zombies of different sizes and speeds with different amounts of health that deal different amounts of damage. These enemies would behave like most zombies you’ve seen would and would chase the player and melee attack them. Ideally, they would use the pathfinding service to navigate their environment in order to make them more versatile and dangerous than the average zombie.
- A stationary type that would shoot projectiles at the player. May make it so that some projectiles track, if possible, which may require the pathfinding service, I don’t know.
- Another stationary type that would only react when players are in proximity to it. No part of it would move whatsoever. One of its reactions would be to spawn enemies of any category.
Ideally, these enemies would get more and more numerous as the game session progressed until everyone died, like in most survival games. When I first thought all this up, I knew about changing humanoids and basic pathfinding as explained in most YouTube tutorials on the pathfinding service, as well as how to make humanoids track other humanoids. I was fully aware that I would run into problems but I was kind of taken on a ride and now I have completely no idea what I’m doing.
I ran into problems with the initial pathfinding implementation (PathfindingService run in a loop, basically), which you can see discussed in this topic here, and got recommended the open-source module SimplePath as a solution. The module was great, but I still ran into issues, particularly with AI with different movement speeds. I was then told that those issues could be fixed by doing pathfinding on the client, which I didn’t even know was possible at the time. I quickly looked up how to do clientside pathfinding and got very, very few results. I’ve only seen a few topics talking about clientside pathfinding and of all the ones I’ve seen, none of them actually discuss how to do it, rather only that it can be done. I found only one YouTube video discussing a way of doing it and got in contact with the developer who made it, but at that point even if I could twist and shape his system into supporting my needs I would’ve been shooting completely in the dark, moreso than if I was just taking stuff that I knew and using it in new ways (no fault on the part of the developer).
That’s all why I decided to make this topic. I just want as straight of an answer as possible as to how to design this system to be as efficient and effective as possible, and resources that I can look at that will teach me this stuff in a way that I understand.
tl;dr: I want guidance on how to design a system for hundreds of “zombie” NPCs of different types (tracking, shooting, stationary), how to implement pathfinding in that system, and where I could possibly learn about it in a way that I can understand.
DISCLAIMER: If this topic is in the wrong section, please feel free to direct me to the appropriate section to post it in