Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Error] Monster walking behaviour #39

Closed
ThisMushroom opened this issue Jul 10, 2018 · 9 comments
Closed

[Error] Monster walking behaviour #39

ThisMushroom opened this issue Jul 10, 2018 · 9 comments

Comments

@ThisMushroom
Copy link
Contributor

Overview:

  1. Add new SpawnArea with any kind of monster (e.g. Giants (Lorencia))
  2. Make SpawnArea as a single cell spot (x1 == x1 && y1 == y2)
  3. Make SpawnArea spawning 20 monsters
  4. Reinit database for spawn area initialization
  5. Walk to the spawn area
  6. Observe empty spot

Observation:

  1. Monsters are walking towards 0,0 coordinates of the map.
  2. Some monsters remain standing/walking around the spot area.
  3. For DirectHit spell system monsters that remain standing/walking are acting correctly when being hit.
    3.1) If you want to hit them with DirectHit spell - hit them - they will die, you will get exp/zen. No drop.
  4. For AreaHit spell system those monsters that remain standing/walking are invisible.
    4.1) If you want to hit them with AreaHit spell - try to - the will act like being hit but no damage would be done. Therefore as we can see from debugging - system doesn't detect monsters around you in the specified skill range.

Ideas:

  1. Yup, monsters are walking thats obvious. - Need to implement correct work of walk range (like the definition of how far they can move from initial spawn area (for the single cell spawns) and new Point distance (for area spot that is bigger then walk range). Moreover implement logic to prevent monsters from leaving the SpawnArea.

2(+ 3-4)) Didn't debug it well yet, just shortlooked. But first ideas and observations were:

  • If you take Evil Spirits and start casting somewhere in the corner of the map near 0,0 (as close as you can) - you will hit those monsters (but you cannot see them). Why do I think they stand at 0,0 - because of EXP trail from monster to caster after being killed (not alway working) + you get exp and zen.
  • It may be problem with server-client sync and maybe somehow bucket system bug.
    When on server side monsters walked to 0,0 but on client side they are displayed on other places. (take a look at the map in the admin panel - all monsters are on correct places but ingame - they are not).
    Why we can hit them with DirectHit spells - because client send the data about monster and it is ok to calculate hit.
    Why we cannot hit them with AreaHit spell - because non-target spell use being sent to the server and the server should determine monsters being hit int the spell range around the caster.

PS. I would investigate it deeper this eve and add comments about to make it more detailed.

@sven-n
Copy link
Member

sven-n commented Jul 10, 2018

Thanks again 👍 You're probably the first one who tried to learn and perform a skill on the OpenMU server 🥇
I wondered that it even worked somehow, btw :)

Just a wild guess:
The walking to 0,0 could be an issue in the packets (WorldView.NewNpcsInScope). There is a start and end coordinate in the meet packet, which are different when the monster walks. Maybe the walk target is not initialized yet here, or IsWalking is not correctly assigned:

```csharp
            if (supportWalk?.IsWalking ?? false)
            {
                packet[11 + monsterOffset] = supportWalk.WalkTarget.X;
                packet[12 + monsterOffset] = supportWalk.WalkTarget.Y;
            }
            else
            {
                packet[11 + monsterOffset] = npc.X;
                packet[12 + monsterOffset] = npc.Y;
            }
```

The evil spirit skill could cause some area skill hit packets for these monsters at 0,0 when they're visible (or in range) on client side. Currently there is no check on the server yet to prevent such hits.

About the walking in general: Monsters are allowed to walk outside of their spawn area. At the original game (global server) it was possible to lure monsters across the whole map.

@sven-n
Copy link
Member

sven-n commented Jul 10, 2018

I made some fixes for area skills... they should find the monsters in range now - provided they are inside a bucket which is in range. Time to sleep now 😴

@sven-n
Copy link
Member

sven-n commented Jul 11, 2018

I found the issue... As soon as a Monster is doing a "RandomMove", it moves towards 0,0. The reason is, that RandomMove doesn't set the WalkTarget.

sven-n added a commit that referenced this issue Jul 11, 2018
The X and Y are set to the WalkTarget in BucketAreaOfInterestManager.MoveObjectOnMap.
See also #39.
@ThisMushroom
Copy link
Contributor Author

ThisMushroom commented Jul 11, 2018

Another thing "not so far from moving" is monster respawn. Seems to be packet isssue.

If one create a small spawnarea (or point spawnarea for better example) -> as soon as you kinn those monsters you will not see new spawned monsters but on the map at the admin panel you can see them.
If you switch map (e.g. spawnarea near Devias gate) and than go back to Lorencia -> you will see those mobs.

sven-n added a commit that referenced this issue Jul 13, 2018
The OldBucket has to be null before adding it to the bucket of the map.
Otherwise, the players ObserverToWorldViewAdapter will return early,
because it thinks it already observes the oldBucket (='where the object
came from').
See also #39.
@sven-n
Copy link
Member

sven-n commented Jul 13, 2018

Fixed the respawn issue. However, I noticed something related again. When monsters attack, they don't seem to be in the correct coordinate or looking at the right direction.

@ThisMushroom
Copy link
Contributor Author

Tested the fix.
At the first look - fix works. But over time - same issue occure. There are simply no visible mobs.
If we assume that map in admin panel works perfect - next thing become interesting: "invisible mobs" are not moving at all. (Just newly respawned mob dot appears but they are not moving).

@sven-n
Copy link
Member

sven-n commented Jul 13, 2018

Oh, that's strange...
I can only imagine it's related to walking. Can you test if this issue occurs when they don't walk at all, by deactivating the walk timer and random move?

Anyways, thanks for the test :)

@ThisMushroom
Copy link
Contributor Author

ThisMushroom commented Jul 13, 2018

Tested only ingame.

Deactivate Walk timer + random move = no issue.
Deactivate only Random move = issue occures as it was before, but it took much more time to get mobs spawn like "invisible mobs"

@sven-n
Copy link
Member

sven-n commented Jul 25, 2018

I think this issue has been fixed with #47.

However, I noticed something related again. When monsters attack, they don't seem to be in the correct coordinate or looking at the right direction.

I'll create an issue, if that's still occuring.

@sven-n sven-n closed this as completed Jul 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants