Have a huge map which I want to populate various areas with monsters. Problem is, I can’t figure out where to put the control for the monsters. Where do I have them move and such? I was thinking just having them move when they are on screen, but already thinking of a lot of problems that will come up with that. If I have them all move all the time, seems like that’ll slow things down a good bit. Ideas?
Have them move on an area several screens wide around the player. For instance, if your screen is 20x15 tiles (assuming it’s even tile-based), have the npcs within 60x45 tiles of the player move. That shouldn’t be too much of a problem, especially if you put any computationally expensive ai in a separate thread.
That should be fine for most non-simulation games. If you have something like a script that causes some npcs to walk to a specific location on the map, you might want to retain a list of npcs that have to be updated whether they’re nearby or not.