PathFinder status
I didn't finish the Monster rewrite code. The (horrible) code is at the monsterTick branch. Anyone is invited to re-write it or fix it. I won't be working on this for the next week or two.
Reply
Thanks given by:
I eventually decided to finish this (Or at least work on it a bit) today, the monsterTick branch is obsolete, I'll keep you updated.
Reply
Thanks given by:
Is it just me or is the AI really dumb at the moment? It is drunk even when I hand it down points that are ready to be followed. (See latest commit)
Reply
Thanks given by:
Its really dumb.
Reply
Thanks given by:
Mob PathFinding is roughly working in the latest commit to pathFindingReborn. A group of zombies literally chased me and killed me while testing, it was unexpected, but it was a joyful death.
I assume it's already better than the previous AI, but as mentioned in the previous comment, something is still... dumb. It seems that the AI is having trouble even following the precise adjacent waypoints handed down to it by the Pathfinder.

There are still some easily fixable issues as well. (Such as considering grass and water solids)
Reply
Thanks given by:
AwesomeBig Grin

We might also like to rename it to cGroundPathFinder, since there are also mobs that fly. Those mobs should probably have a different path finder.
Reply
Thanks given by:
I have already tested flight, it works with the current pathFinder with a different flag.
It's all awesome except the current AI, I just feel it downgraded my Pathfinder by an order of magnitude, it won't follow side-by-side points without trouble, and sometimes the mobs just get stuck. I am sure it has nothing to do with the PathFinder because it only manipulates m_Destination. It's just that the AI is not good at reaching m_Destination even if it's a single block away.

This seems to be the code block responsible for m_Destination following (and hence responsible for the trouble):
Code:
            if (m_Destination != GetPosition())
            {
                Distance.y = 0;
                Distance.Normalize();
    
                if (m_bOnGround)
                {
                    Distance *= 2.5f;
                }
                else if (IsSwimming())
                {
                    Distance *= 1.3f;
                }
                else
                {
                    // Don't let the mob move too much if he's falling.
                    Distance *= 0.25f;
                }
    
                // Apply walk speed:
                Distance *= m_RelativeWalkSpeed;
    
                AddSpeedX(Distance.x);
                AddSpeedZ(Distance.z);
            }
Anyone knows how could that be improved?
Reply
Thanks given by:
Maybe a Vector3d is too precise? Maybe you can say instead of "Destination == GetPosition()" see if he's near the position?
Reply
Thanks given by:
I cobbled up something that works a little better.

Currently the AI hates flowers.
I have a BLOCKTYPE and a NIBBLETYPE, I'd like to know the given block is walkable or not. Right now I check if it's of type E_BLOCK_AIR. This is a bad idea because grass and flowers and such will be considered solid that way. How can I check if a given block is walkable or not?
Reply
Thanks given by:
Using cBlockInfo::IsSolid(BLOCKTYPE)
Reply
Thanks given by: LogicParrot




Users browsing this thread: 12 Guest(s)