I am making a wave defense type game that uses a lot of enemys. At first, i was using Pathfinding to generate the movement for each enemy but then i realized it was expensive and wasnt efficient and made weird stuttering, i am just looking for different ways to make somewhat smart enemy movement. BTW, there are multiple places these enemys spawn in.
Are the paths the enemies can follow already predetermined like a typical tower defense game, e.g. Bloons?
No There are not. Its basicly a square with spawners at each corner of the map
It depends on how complicated your map is. If it’s just an empty square, you might be able to get away with just making the enemies walk towards their target and jump if they get stuck on something. To detect if they are stuck, you could use raycasting or maybe check the monster’s speed to see if it’s too low.
If your map is more complex, you might have to use pathfinding. If it is causing performance issues, you might want to try using it more sparingly.
The stuttering from pathfinding might be because you’re recalculating paths far too often. If the walkable enviroment never changes, you’ll probably want to only calculate paths once every few minutes.
Also, you can greatly increase the effeciency of pathfinding by having multiple NPCs use the same path object.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.