OK, here's what I'm doing. I'm planning a browser game, but I wanted a realtime aspect to it. Basically, the player can roam around a city map and encounter random NPCs and enemies. What I want to know is, is there a way to have a script running constantly, separately from the user's browsing, that would control things like NPC movement (move them once every second or so, etc.)?
So the user would be playing the game (on a certain area of the map) and there would be something analogous to a game client (like WoW) controlling the NPCs, etc, but controlled on the server side. (This is shared hosting, btw. If I need dedicated or whatever, that's an option as well.) I really don't want to have the user's browser send a request every second asking for the locations of all NPCs all across the entire world. I'm just trying to figure out an alternate way to go about doing this, while still having a realtime aspect to it.
If it's just not possible, then that's fine, I have alternate non-realtime plans for gameplay. If anything above is unclear, I will try to elaborate as much as possible.