Snoozey Posted April 25, 2012 Author Share Posted April 25, 2012 Lets say 3 monsters are attack on site. Player A runs through and they all start attacking him. He knows he is going to die so he runs out of the map. The monsters will sit and wait at the exitPlayer B walks in. Player B is stuck because npcs are waiting.Anyways to make the monsters go back if a player leaves a map? Link to comment Share on other sites More sharing options...
Urumil Posted April 25, 2012 Share Posted April 25, 2012 My idea is to respawn a map everytime when a player attracts more than two NPCs and another player wants to enter this map. Link to comment Share on other sites More sharing options...
Snoozey Posted April 25, 2012 Author Share Posted April 25, 2012 @Gamzee:> My idea is to respawn a map everytime when a player attracts more than two NPCs and another player wants to enter this map.Problem with that is lets say player A is kill npc A. Then NPC B sees player A. Player A is ok with fighting 2 npcs. Player B walks in, map resets. Link to comment Share on other sites More sharing options...
fernz123 Posted April 25, 2012 Share Posted April 25, 2012 Maybe if it checks to see if anyone is on the map, if not then it reloads Link to comment Share on other sites More sharing options...
Urumil Posted April 25, 2012 Share Posted April 25, 2012 @Fernz:> Maybe if it checks to see if anyone is on the map, if not then it reloadsYeah, I forgot to mention that. Link to comment Share on other sites More sharing options...
Joost Posted April 25, 2012 Share Posted April 25, 2012 Respawning the map as a solution for this will result in a broken as fuck game. Imagine 3 elite NPC"s that can only be killed once every 24 hours. (Or once every hour, i dont care). You kill one, leave the map, all 3 respawn, you go back in, kill one, go out, all respawn.Or in examples where there are items on the map that are supposed to spawn every X minutes/hours you can just force the items to respawn.Making the monsters walk back would also require a lot of work. Link to comment Share on other sites More sharing options...
Snoozey Posted April 25, 2012 Author Share Posted April 25, 2012 @Joost:> Respawning the map as a solution for this will result in a broken as duck game. Imagine 3 elite NPC"s that can only be killed once every 24 hours. (Or once every hour, i dont care). You kill one, leave the map, all 3 respawn, you go back in, kill one, go out, all respawn.> > Or in examples where there are items on the map that are supposed to spawn every X minutes/hours you can just force the items to respawn.> > Making the monsters walk back would also require a lot of work.I was afraid of that, well it is out of my hands then. There is no way I could tweak AI :/ Link to comment Share on other sites More sharing options...
Ruins of Hell Posted April 25, 2012 Share Posted April 25, 2012 Currently, NPC movement is only done if there are players on the map (makes sense, don't waste memory calculating what players won't see!)I guess one solution would be similar to the above, but you wouldn't "respawn the map". Rather, when a player leaves the map, you could "respawn" _alive_ NPCs (the server already sets their HP to full, so this wouldn't change game mechanics a lot).* * *Here's an example. I'm not sure if it works, but even if it doesn't, you get the gist.Find:```' Now we check if there were any players left on the map the player just left, and if not stop processing npcs```and replace:``` If MapNpc(OldMap).Npc(i).Num > 0 Then MapNpc(OldMap).Npc(i).Vital(Vitals.HP) = GetNpcMaxVital(MapNpc(OldMap).Npc(i).Num, Vitals.HP) End If```with:``` If MapNpc(OldMap).Npc(i).Num > 0 Then Call SpawnNpc(i, OldMap) End If``` Link to comment Share on other sites More sharing options...
Joost Posted April 25, 2012 Share Posted April 25, 2012 clever Link to comment Share on other sites More sharing options...
Snoozey Posted April 25, 2012 Author Share Posted April 25, 2012 Appears to work :] If it breaks or I notice anything odd I will report back.Thanks again soul. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now