Handling Mass-Amount of Roaming NPC's
Apr 12 2010, 9:55 pm
What is the best way of handling a large amount (500+) of NPC's that wander around, looking to attack a player or an object (windows, doors, etc)?
Apr 12 2010, 10:37 pm
Don't have them do anything unless there's a possibility of there being something of interest. The best way to handle this is to split things up into areas and don't call the AI routines until a player enters the area, and then stop it when the last player leaves an area.
Alternatively, if there are far fewer players/objects than NPCs, have the players/objects be the one searching for NPCs to activate.
Note that if you HAVE to have the NPCs wandering regardless of player presence, that's okay, so long as you aren't searching for things every step. The resource hog is going through the list, not taking random steps.
Apr 13 2010, 7:48 am
In response to
Thanks a bunch Garthor, I'm going to try going with the alternate route of having the players doing the scanning. This was my initial thought but having someone suggest it being a possible solution is very reassuring.
Copyright © 2013 BYOND. All rights reserved.
Terms of Service