• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

MapleStory mobbing

C# developer
Joined
Dec 4, 2013
Messages
656
Reaction score
80
Hey, how exactly does the whole mobbing part work in maple?

From mob spawns to mob respawns.. the actual code behind.. [including multi players]

Thanks!
 
Newbie Spellweaver
Joined
Jun 19, 2016
Messages
66
Reaction score
5
every map has a list of mobs built in within the source and it's loaded within the wz files or sql (not sure) upon serevr startup.
I think that odinms based sources spawn the mobs even if the map is empty, some sources make it so if the map is empty of characters then they don't even spawn.

Just look through MapleMap and MapleMonster if you wanna understand more.
 
Upvote 0
C# developer
Joined
Dec 4, 2013
Messages
656
Reaction score
80
every map has a list of mobs built in within the source and it's loaded within the wz files or sql (not sure) upon serevr startup.
I think that odinms based sources spawn the mobs even if the map is empty, some sources make it so if the map is empty of characters then they don't even spawn.

Just look through MapleMap and MapleMonster if you wanna understand more.

That's not what I meant, I meant for the actual packets and actions that are taking place from the moment player A comes into the map to the moment player B kills a mob and the mob respawns. [and all that between]

But thanks though.
 
Upvote 0
Newbie Spellweaver
Joined
Jun 19, 2016
Messages
66
Reaction score
5
That's not what I meant, I meant for the actual packets and actions that are taking place from the moment player A comes into the map to the moment player B kills a mob and the mob respawns. [and all that between]

But thanks though.
Why don't you just debug it? There are so many packets sent when you enter a map till the mob respawns
 
Upvote 0
Newbie Spellweaver
Joined
May 28, 2010
Messages
74
Reaction score
7
if only one player in the map,the monster will be controlled by player.The packets is spawn_monster,control_monster,monster_move,monster_dead,etc.

if player A in the map ,and then player B enter the map ,the monster wiil be controlled by palyer A.Player B wont receive control_monster.the other packets will broadcast to each player.
 
Upvote 0
C# developer
Joined
Dec 4, 2013
Messages
656
Reaction score
80
if only one player in the map,the monster will be controlled by player.The packets is spawn_monster,control_monster,monster_move,monster_dead,etc.

if player A in the map ,and then player B enter the map ,the monster wiil be controlled by palyer A.Player B wont receive control_monster.the other packets will broadcast to each player.

Okay and how about the mob respawning? how does it work? I mean, you kill a mob and its broadcasted to everyone, cool, but what happen next? I've seen in some other servers that when u kill mob of type A a mob of type B spawns or another mob of type A or C.. or not at all.

How exactly does it work?

Thanks a lot.
 
Last edited:
Upvote 0
Newbie Spellweaver
Joined
May 28, 2010
Messages
74
Reaction score
7
Normally when player kill a monster,the server will respawn one.

Some monster will spawn other monter when is dead.

like White Snowman,the data is in the xml,info section.
Open monster file 5100001.img.xml you will see
<imgdir name="revive">
<int name="0" value="6300001"/>
</imgdir>

Some monster like zakum.the spawning controled by server.

Some normal monster deaded will spawning elite monsters,this depend on the elite monster system is open.
 
Upvote 0
C# developer
Joined
Dec 4, 2013
Messages
656
Reaction score
80
Normally when player kill a monster,the server will respawn one.

Some monster will spawn other monter when is dead.

like White Snowman,the data is in the xml,info section.
Open monster file 5100001.img.xml you will see
<imgdir name="revive">
<int name="0" value="6300001"/>
</imgdir>

Some monster like zakum.the spawning controled by server.

Some normal monster deaded will spawning elite monsters,this depend on the elite monster system is open.

These are probably special handle mobs. Im talking about for example The Hill North of Henesys, when u kill a snail, a mushroom could spawn, and when u kill a mushroom a snail could spawn or none at all till u get some more mobs.
 
Upvote 0
Custom Title Activated
Loyal Member
Joined
Jan 18, 2010
Messages
3,109
Reaction score
1,139
These are probably special handle mobs. Im talking about for example The Hill North of Henesys, when u kill a snail, a mushroom could spawn, and when u kill a mushroom a snail could spawn or none at all till u get some more mobs.

Those are handled by MobGens within the LifePool. If you're curious about how this works, I suggest looking into BMS and how their CLifePool handles Mob's. A map has a mob capacity for the amount of respawns. This is all handled by a formula. Based off the size of the map and some calculations with rates and modifiers, the map will spawn mobs that have been added to the LifePool's MobGen list.

Just a general idea here, this is the capacity on a field.
Code:
int v16 = 800;
        if (pField.m_szMap._cx > 800)
            v16 = pField.m_szMap._cx;
        int v17 = 600;
        if (pField.m_szMap.cy - 450 > 600)
            v17 = pField.m_szMap.cy - 450;
        int v18 = (int)((double)(v17 * v16) * pField.m_dMobRate * 0.0000078125);
        if (v18 <= 1)
            v18 = 1;
        if (v18 >= 40)
            v18 = 40;
        pField.GetLifePool().m_nMobCapacityMin = v18;
        pField.GetLifePool().m_nMobCapacityMax = 2 * v18;

Now that the capacity has been set, the field will spawn all "life" properties. Once mobs are dead and the size has decreases, a constant Update thread is registered to every Field and every LifePool from a Field. This calls TryCreateMob, which handles the respawns of a map.

Code:
int v39 = v6 + m_mFixedMobID.size() - m_mMob.size();
            if (v39 > 0) {
                m_pField.m_lock.lock();
                try {
                    if (!m_bMobGenEnable) {
                        return;
                    }
                    final List<MobGen> aMobGen = new ArrayList<>(m_aMobGen);
                    Collections.shuffle(aMobGen);
                    int v41 = 0;
                    for (MobGen v18 : aMobGen) {

Pretty much you get a size (v6 is the mobgen size unless a capacity modifier from a field limit has been set), and once the amount needs more mobs, it shuffles the MobGen's, iterates them and checks their templates and count of each MobGen, compares intervals, and will re-create the mob.

To see how it's all done, I again suggest looking into BMS's CLifePool::Init and CLifePool::TryCreateMob. Reading and understanding that will help generalize how the server handles all of this.
 
Upvote 0
C# developer
Joined
Dec 4, 2013
Messages
656
Reaction score
80
Those are handled by MobGens within the LifePool. If you're curious about how this works, I suggest looking into BMS and how their CLifePool handles Mob's. A map has a mob capacity for the amount of respawns. This is all handled by a formula. Based off the size of the map and some calculations with rates and modifiers, the map will spawn mobs that have been added to the LifePool's MobGen list.

Just a general idea here, this is the capacity on a field.
Code:
int v16 = 800;
        if (pField.m_szMap._cx > 800)
            v16 = pField.m_szMap._cx;
        int v17 = 600;
        if (pField.m_szMap.cy - 450 > 600)
            v17 = pField.m_szMap.cy - 450;
        int v18 = (int)((double)(v17 * v16) * pField.m_dMobRate * 0.0000078125);
        if (v18 <= 1)
            v18 = 1;
        if (v18 >= 40)
            v18 = 40;
        pField.GetLifePool().m_nMobCapacityMin = v18;
        pField.GetLifePool().m_nMobCapacityMax = 2 * v18;

Now that the capacity has been set, the field will spawn all "life" properties. Once mobs are dead and the size has decreases, a constant Update thread is registered to every Field and every LifePool from a Field. This calls TryCreateMob, which handles the respawns of a map.

Code:
int v39 = v6 + m_mFixedMobID.size() - m_mMob.size();
            if (v39 > 0) {
                m_pField.m_lock.lock();
                try {
                    if (!m_bMobGenEnable) {
                        return;
                    }
                    final List<MobGen> aMobGen = new ArrayList<>(m_aMobGen);
                    Collections.shuffle(aMobGen);
                    int v41 = 0;
                    for (MobGen v18 : aMobGen) {

Pretty much you get a size (v6 is the mobgen size unless a capacity modifier from a field limit has been set), and once the amount needs more mobs, it shuffles the MobGen's, iterates them and checks their templates and count of each MobGen, compares intervals, and will re-create the mob.

To see how it's all done, I again suggest looking into BMS's CLifePool::Init and CLifePool::TryCreateMob. Reading and understanding that will help generalize how the server handles all of this.

Thanks! I'll get on it soon. :love:
 
Upvote 0
Back
Top