Hi!
I've been thinking about how to implement a "good" mob's system in a MMO, here's my very first idea:
- Using an Admin Player, create all the fixed spawn points for each mob (just walking around and using a command to create spawn points)
- When the server starts, it loads all the mob's spawning points available.
- Once the server has loaded all the spawning points, it creates one MOB per each spawning point with a % of spawn.
//It's not code!
function spawnMob(MOB m){
r = randomNumber 1-100
if (r < m.chance%){
//SPAWN
}
}
- Then, the mobs would be loaded in the world and players would be able to see / attack them
- Once one mob dies:
- the server simply spawns another mob (with a 100% chance of spawning) to another position
- The bad thing here is that there will always be mobs, so the player never has to wait for mobs to spawn.
- Every mob has a "timeToReSpawn" var, so the server waits X time till spawning another mob.
But, using this implementation, everything about npc's is decided when the world is loaded, so if a mob is just spawned twice because of a bad luck in the % when loading the server, it will only appear twice in the world (till the server restarts).
Any better implementation / idea / suggestion?
Thanks!
:)