Closed Codex2000 closed 9 years ago
I thinks this is some issue with TC MovementGenerators. Comparing to R2 I can see that movement is different: sometimes bots cannot follow master, sometimes they fall though ground. I noticed same problem with some regular mobs as well, so bots inherit this issue
however this does not happen a lot. most of the bots are indeed just underground. can't be seen.
The actual spawning logic is located in RandomPlayerbotMgr::RandomTeleport. Locations are calculated based on creature and game_tele locations in the DB. The method just picks a random one from the list and uses the following code to teleport:
if (!map->IsOutdoors(x, y, z) ||
map->IsInWater(x, y, z))
continue;
float height = map->GetWaterOrGroundLevel(x, y, 0.05f + z);
if (height == INVALID_HEIGHT)
continue;
z = 0.05f + height;
bot->GetMotionMaster()->Clear();
bot->TeleportTo(loc.GetMapId(), x, y, z, 0);
I suppose GetWaterOrGroundLevel returns correct z-coord and by adding 0.05f it is assured that the position is on the ground. Seems this check is not enough and something else needs to be added. Any ideas?
Check out:
void Creature::UpdateMovementFlags()
{
// Do not update movement flags if creature is controlled by a player (charm/vehicle)
if (m_movedPlayer)
return;
// Set the movement flags if the creature is in that mode. (Only fly if actually in air, only swim if in water, etc)
float ground = GetMap()->GetHeight(GetPositionX(), GetPositionY(), GetPositionZMinusOffset());
bool isInAir = (G3D::fuzzyGt(GetPositionZMinusOffset(), ground + 0.05f) || G3D::fuzzyLt(GetPositionZMinusOffset(), ground - 0.05f)); // Can be underground too, prevent the falling
if (GetCreatureTemplate()->InhabitType & INHABIT_AIR && isInAir && !IsFalling())
{
if (GetCreatureTemplate()->InhabitType & INHABIT_GROUND)
SetCanFly(true);
else
SetDisableGravity(true);
}
else
{
SetCanFly(false);
SetDisableGravity(false);
}
if (!isInAir)
RemoveUnitMovementFlag(MOVEMENTFLAG_FALLING);
SetSwim(GetCreatureTemplate()->InhabitType & INHABIT_WATER && IsInWater());
}
Thanks! Changed it to
float ground = map->GetHeight(x, y, z + 0.05f);
if (ground <= INVALID_HEIGHT)
continue;
Seems a bit better as there are no z = -19999.0 anymore but just have seen a bot under the ground in Astranaar.
Seems 0.05f just not enough to prevent them from falling. Changed to 0.5f and the issue seems to be fixed.
ike3 first of all you doing a good job on the bot's i was lokking forward to see them in trinity but the last couple of changes you make did not fix the problem, i was useing your latest update but still found bot's underground not sure why but it is true hope you can find i way to fix that. And Everytime i close worldserver.exe wth ctrl+c it crash with
and here are some logs there are so many errors
TrinityCore rev. 3009a75ce862 2014-10-06 07:25:09 +0400 (trinity-wotlk-ai branch) (Win64, Release) (worldserver-daemon)
That's just some skills that were added too the char that are incorrect. There seem to be a little issue with giving correct skills to a character.
There are no more bots under ground
RandomBots falling through ground. I have vmaps and mmaps enabled in trinity but they are still falling through ground most likely happend when they start to fight. Also i noticed when RandomBot is fighting and a secound mob attack him he will not fight back and completly ignore him until he die's, that's because i think you coded them to wait until hp/mana get's back to full and then fight next mob.