cmangos / issues

This repository is used as a centralized point for all issues regarding CMaNGOS.
180 stars 48 forks source link

[Suggestion] About creatures falling underground #38

Closed cmangos-bot closed 8 years ago

cmangos-bot commented 11 years ago

Created by @ghost on 2013-01-01 10:42:13


Doing some research this days I found a bug... Some creatures do not have correct x,y,x and fall under the map

Is is possible to implement a sort of system like for player case, this time for creatures, that check the ground level of map, minimum for each point of it where a certain creature is spawned and if the x,y,z from database doesn't correspund with the minimum of the ground level, server to move the creature upper.

Also would be nice to have the option from the server to write down an sql file with the move that the server have done so we can move it after to the proper location.

Respect

cmangos-bot commented 11 years ago

Comment by @rsa on 2013-01-01 11:35:45


Some creatures do not have correct x,y,x and fall under the map

it's impossible in current code. spawn point corrected to map/vmap height...

cmangos-bot commented 11 years ago

Comment by @cyberium on 2013-01-01 12:09:27


Yes i thing coordonate of origin point is good. Only some height might be badly computed due to mmaps approximation revelated recently. We not sure how to handle theses case. I have a little patch may correct that but its a workaround only and may consume more cpu cycle. I probably will propose an option to enable it in future.

cmangos-bot commented 11 years ago

Comment by @ghost on 2013-01-01 12:20:51


that would be great...

I accidentaly found 1 npc and 2 mobs that were falling underground in the barrens... I believe that there are many more that do same thing in other zones...

At least to make this patch in such way that it can create a file with a sql modification of the xyz or at least to give us a shoot about the creature Guid/id, map/zone.

Respect

cmangos-bot commented 11 years ago

Comment by @tarwyn on 2013-01-01 01:07:10


If you make changes, be sure to test them in areas with caves underneath the world, such as Searing Gorge. Often, mobs that fall through the world wind up crawling in caves where they don't belong; in those cases it might be more difficult to find a correct location for the mob.

cmangos-bot commented 11 years ago

Comment by @Schmoozerd on 2013-01-02 12:09:22


It is extremely difficult to really "know" which plane is the correct one to chose from.

I am not sure if npc spawn positions are updated, and in my opinion this would be relatively useless to do (the DB guys just should create proper coordinates..)

What i personally think would be the better way: Create another tool, that can read map, vmap mmap data, and display this data visually. Also for such a tool it would be very neat to get the actual client map also displayed (maybe too difficult)

If such a tool existed, it would be relatively simple to use it to check and fix spawn coordinates.

The problem with ie randomly moving mobs that get very crazy paths might be fixable with two ways: 1) check the path-length to see if a random point is reasonable (ie (2d)length must be <= 1.5*distance) 2) we need a better system to get random points in multiple plane case - with current code it is just impossible. One problem that exists is: Assume you have a place with multiple floors, and you are not on the bottom GetRandomPoint on a position that would be "much" higher than current z-position. Hence the UpdateZ code will pick the height of the floor beneth the floor we are currently in, and hence the z-value will be horrible wrong. A possible solution for this might be some "light" concept: assume you had a sun in the floor you are currently in, higher than you are (at best at the ceiling) - valid points are points that are shined upon by the light.

This is all not very easy, and infact i am pretty sure that most of these problems surfaced with the mmaps, because mmaps made them just noticable.

cmangos-bot commented 11 years ago

Comment by @faramir118 on 2013-01-02 02:49:07


@cyberium: Because the pathfinding-generated move-spline keeps the creature moving in the right direction, things works fine until the move-spline ends. When the move-spline ends, the unit's position could be under the terrain due to the mmaps terrain approximation.

iirc your patch fixes the move-spline positions by using map/vmap data to find a more accurate position for each point in the path. If you change it to only correct the position of 2 points, it should work just as well and be a lot more optimized: 1) The end position. 2) Any position that results from interrupting the move-spline.

@Schmoozerd There are some things built into Detour to walk the navmesh and find a random, reachable point. Look at dtNavMeshQuery::findRandomPointAroundCircle

cmangos-bot commented 11 years ago

Comment by @cyberium on 2013-01-02 09:21:08


@faramir118 Where your idea is good for optimisation part, it will not resolve sheep/creature going through map until movement finished. So we'll still see creature moving through it until they finished to move. If i do that i'll call it a workaround to a workaround :) I think the better is to have any input from real server about cpu impact for the complete point computing then decide. That patch must care about correct Z too so i'll try to see if we can have benefit from dtNavMeshQuery::findRandomPointAroundCircle.

cmangos-bot commented 11 years ago

Comment by @cyberium on 2013-01-02 04:50:29


I wonder how to get interrupted point of a path?

@tarwyn if you have other specific place where you are sure i cant found flying mob please show me them :)

cmangos-bot commented 11 years ago

Comment by @faramir118 on 2013-01-02 06:13:48


MoveSpline::ComputePosition

MoveSpline::Finalized will tell you when the spline is finished or interrupted

cmangos-bot commented 11 years ago

Comment by @cyberium on 2013-02-27 04:30:21


@faramir118 I think i solved lot of case about that at least in case of random movement generator. If you have time please review theses 2 patch Using more mmap data to avoid undermap situation -> http://cmangos.net/thread-53.html Improve Random movement generator -> http://cmangos.net/thread-54.html

Phatcat commented 8 years ago

Closing after speaking with @cyberium