Jump to content
Returning Members: Password Reset Required ×

Potential positional D-Sync on mobs - client versus server


Recommended Posts

Posted

Howdy, we're in the midst of implementing a feature whereby a special monster splits upon death similar to Diablo Loot goblins. Each new iteration after a split moves faster and farther away from the player than before. Below is a small gif demonstrating the behavior for some context:

https://streamable.com/qf7qns

(Don't mind the green artifacting - it happened during the gif encoding process.)

One thing we've noticed is that it can be quite common for the position of the monster client side to be desynchronized from the actual position of the monster server side. We believe this may be related to sending a MsgWalk packet for the monster entity soon after or during a MsgAction Jump (137) packet for the monster entity.

If that is the case - does anyone know of a way to ensure that positions do not become de-synced and or to re-synchronize the monster location? Alternatively, if we prevent MsgWalk packets from being sent for X ticks after a MsgJump packet - would that remedy the situation?

Thanks for any advice!

Posted
Yeah, looks like the animations aren't keeping up and it just kinda skips around like a player who's speed hacking. I'm not really aware of a solution, but I can at least double that suspicion. I wonder if you can apply other movement types to monsters that are normally granted to players via XP skills.
Posted
After further testing by adding map effects to better visualize where the NPC is suppose to be serverside it would appear that somehow in some instances the NPC was MsgWalking more than 1 coordinate which resulted in one of the situations where it would desync.
Posted

Okay just for parity and to help anyone that may encounter similar frustrations in the future -

This entire d-sync issue was faulty logic on my end. MsgAction (with Jump 137) has a deterministic end destination sent in the packet. The monsters original X Y and the destination X Y are sent in the same packet. However, with MsgWalk, all you supply is a direction this means it is your responsibility to ensure the monster direction is correct and that you update the coordinates to be exactly 1 pace difference on the server side.

I made two mistakes:

First, I was using the wrong direction variable as the monster AI had two modes (One when a player is in kill range) and one where the monster simply walks in the opposite direction of the player. (I was accidentally sending the direction it jumped when it was in kill range of a player which is not necessarily the same as the opposite direction of the player.)

Secondly, I was sending the MsgWalk packet to the client regardless of whether the monster had actually moved due to an oversight on my part. There are instances where the monster could not conceivably go any further opposite of the player. (Loot goblins in Diablo behave similarly in that you can coral them into a wall to prevent their movement.) It was in those instances that if you send MsgWalk to the client it will display the monster traversing terrain it is not suppose to traverse.

Anyway, tl;dr two fuck ups on my part and it is now behaving correctly.

Spirited I actually tested the following as well:

I wonder if you can apply other movement types to monsters that are normally granted to players via XP skills.

Here is what I found:

MsgAction Action 137 -> Normal Jumps, with the animatiuon.

MsgAction Action 130 -> "Guard Jump", instant teleportation no jump animation (At-least not for the monster model we were using.)

MsgAction Action 156 -> "Ninja Step", a Normal jump whereby at the conclusion of the jump an "after image" of the monster was left behind. 1h5vFnN.png

NinjaStep looked pretty cool but unfortunately did not fit the situation we were trying to use it in. Definitely keeping it in our back pocket for the future though.

Posted
Ahhh, good breakdown of the problem. Glad you figured it out! And thanks for looking into the other movement types.
Posted
I've already done this like a year ago :D, Diablo 3 loot goblins, where when they die they'd explode and spawn more goblins. I like your approach and trying to be creative.
Posted

I've already done this like a year ago :D, Diablo 3 loot goblins, where when they die they'd explode and spawn more goblins. I like your approach and trying to be creative.

Hey, I have a bunch of friends that play on your server but I hadn't heard them mention this before - just to be clear we weren't trying to rip off your idea. I'd love to see a clip of your loot goblin sometime.

Also, we introduced a token that can be obtained from these "Rifts" or portal events and that can be used for some exclusive rewards, but conquer is notoriously difficult to produce good drop loot for because you don't really want to reward sockets too often or too early. What kind of rewards are your goblins dropping? Ours drop gold (of varying amounts), meteors and dragonballs in addition to the aforementioned rift tokens.

Posted

I’m not at home right now i’m actually on vacation so I can’t show you a recording of it, but my loot goblin actually stole loot from players actual drops, then when a player approached they try to escape.

the goblin itself has stats as in movement speed, health, evasion rate and even the loot it has collected. when it encounters a player they start to flee, every time they took damage they dropped some gold leaving behind a gold trail and when they died they exploded killing nearby players and drops the loot it has picked up. it was also a nice touch to have it broadcast goblin laugh sounds when it was spawned on a map. i’ve show cased this goblin AI without the goblin models because i didn’t have any so i allowed the goblins to take the appearance of other regular mobs nearby (same concept of metdove).

Most of these ideas are kept for my upcoming project Exodus. what i did on primal was a proof of concept and only for fun and testing how far i can manipulate and push the client.

Posted

I’m not at home right now i’m actually on vacation so I can’t show you a recording of it, but my loot goblin actually stole loot from players actual drops, then when a player approached they try to escape.

the goblin itself has stats as in movement speed, health, evasion rate and even the loot it has collected. when it encounters a player they start to flee, every time they took damage they dropped some gold leaving behind a gold trail and when they died they exploded killing nearby players and drops the loot it has picked up. it was also a nice touch to have it broadcast goblin laugh sounds when it was spawned on a map. i’ve show cased this goblin AI without the goblin models because i didn’t have any so i allowed the goblins to take the appearance of other regular mobs nearby (same concept of metdove).

Most of these ideas are kept for my upcoming project Exodus. what i did on primal was a proof of concept and only for fun and testing how far i can manipulate and push the client.

Wow that is fantastic, certainly better than what we came up with. Especially having them take the appearance of nearby monsters like meteor doves. Well played! I am excited to see your future project.

Posted

I’m not at home right now i’m actually on vacation so I can’t show you a recording of it, but my loot goblin actually stole loot from players actual drops, then when a player approached they try to escape.

the goblin itself has stats as in movement speed, health, evasion rate and even the loot it has collected. when it encounters a player they start to flee, every time they took damage they dropped some gold leaving behind a gold trail and when they died they exploded killing nearby players and drops the loot it has picked up. it was also a nice touch to have it broadcast goblin laugh sounds when it was spawned on a map. i’ve show cased this goblin AI without the goblin models because i didn’t have any so i allowed the goblins to take the appearance of other regular mobs nearby (same concept of metdove).

Most of these ideas are kept for my upcoming project Exodus. what i did on primal was a proof of concept and only for fun and testing how far i can manipulate and push the client.

Wow that is fantastic, certainly better than what we came up with. Especially having them take the appearance of nearby monsters like meteor doves. Well played! I am excited to see your future project.

“Little by little you shall see, the perfect power within me.” - Cell - DragonballZ

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...