Need help with optimizing NPCs

So basically I’m making a game where NPCs are a big part of the core gameplay. I want the NPCs to be able to shoot at the player. For this I am using Y3llowMustang’s marine AI.

I noticed a problem where my FPS would be under 50 when I had a marine AI in the game. My FPS went back to 60 when I killed / deleted the AI.

I’ve tried searching on the dev forum and other platforms for others who have this same issue. I’ve also tried to optimize the code. No results…

So my question is: how do I optimize the NPCs

all help is appriciated :smiley:

1 Like

I would do something like on the server u set goal position for every npc, and if they attack u can also make a random calcul which say if they touch someone and how many damage they do, and manage every animation on the client, but u would have to make ur own system

hope it helped !

Good idea! Making my own system can and will take a lot of time. BUT I have the modules from the Marine AI and a general sense of how I would make it now. Thank you for your reply, it was very helpful for me!

1 Like

Im happy that it helped u, good luck for ur project and have a nice day !

EDIT : feel free to contact me if u need some help

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.