ID:1533776
 
(See the best response by Reformist.)


Problem description:
I'm experiencing major lag with a game that has been well underway for a month or so now. What are some of the things I can look at to try to fix this problem? Other than that, the game seems to work fine.
Best response
Try using the profiler to see which functions are using the most CPU.
I've narrowed it down to the AI routines.
Any suggestions on how to clean up ai so that it uses little to no CPU?
See my reply to this post. A lot of newer programmers tend to let their AIs loop no matter what, which is a huge huge huge waste of resources. Disable AI until they're needed, and then enable them until there are no players around. The easiest method would be to disable them by default and to enable them by overwriting the clients Move() proc to check for a monster that uses AI every step. If one is found, do a full loop and enable all of the AI within a range you specify.