Progether / JAdventure

Java text adventure game.
https://progether.github.io/JAdventure/
GNU General Public License v3.0
308 stars 244 forks source link

generic npcs should respawn after x amount of time #207

Open projectdelphai opened 9 years ago

projectdelphai commented 9 years ago

So if I kill a brotherhood member, after I cross say 20 tiles or once sufficient time has passed, a new brotherhood member should appear.

paddatrapper commented 9 years ago

Seeing as most things happen on a move-by-move bases I think a move based solution would be the most effective. Though where to implement this - LocationManager, Location or the move command in CommandPrompts is an issue...

projectdelphai commented 9 years ago

Maybe after the move command, call a trigger that would see if enough time has passed and if it has, respawn the necessary npcs.

Muirrum commented 5 years ago

Maybe we could count moves as ticks? Then after so many ticks regen the NPC from the file.

ETA: If it's still planned to be server/client, then maybe the server should handle ticks, just to keep them consistent across multiple clients.

paddatrapper commented 5 years ago

For server/client, a global clock makes sense. If that can be implemented in the standalone too, that is great. Otherwise a move counter as ticks is consistent with the rest of the standalone game

Muirrum commented 5 years ago

I think the only way to implement ticks in a fair way would be after each loop of the gamePrompt() function. If I knew better how the server is started up then I would know better where to put the serverside Tick Controller (TickController.java?)

Muirrum commented 5 years ago

I'm going to start implementing this on my fork. Will probably put the TickController in the base package unless someone has a better idea