I’m making a game that uses swords and magic with a block parry dodge system. I was wondering how I could make monster AI for the game. I mainly need help on:
detecting an enemy
switching enemies when hit
pathfinding
stopping when in a certain range
basics such as anims, morphs
I can take care of the combat system myself but those 4 I have no clue where to start. I have never made an NPC AI before, especially not an advanced one such as this.
Also, if you need a reference, I was thinking of Deepwoken’s mob AI where the NPC constantly follows the player regardless of if it can find a path through or not. (for a while before giving up)
I never done advanced NPC AI. However, I got some ideas that may help with your thinking. I never played deepwoken so I don’t understand your reference lol.
Use a circle/part (your choice) and attach an event to it, handling whatsoever when something is near there. You may want to use CollectionService to tag the instances for example “NPC” tag, the event connected to it will check if it has this tag. If so, performs a action.
I don’t really know what you mean by this. I’d assume you just add some custom events to detect if you hit it?
Back to the part where I told you to attach a part to the NPC to detect an enemy is within range. Stop the code when the NPC stopped touching the part.
Those for you to figure out, go on Roblox documentation.
PathfindingService | Documentation - Roblox Creator Hub.
Or I suggest you to use some custom open source modules for pathfinding because Roblox itself does a really bad job implementing pathfinding and bugs occur occasionally (idk, thats what I heard other people say).
Go ask chat GPT, I don’t know if it will help but try it.
I think hes using the wrong term honestly. He might just be looking for a algorithm because I don’t really see the point of machine learning when you can just implement this yourself (or im just dumb)
you’re right. What I’m looking for are specific ways to make my enemy AI do the tasks I have listed. Useful help would be: example code, pseudocode, examples, or public resources.
don’t use the term AI. Since AI needs deep learning (which is something I never learned and is a advanced topic I would never want to touch). While algorithms are a way to perform what task you want them to do but in a complex relationship.