thebigsleepjoe / TTT-Bots-2

Player bots for Garry's Mod TTT
Creative Commons Attribution Share Alike 4.0 International
10 stars 3 forks source link

[BUG] Ladders are problematic #15

Closed Cynosphere closed 9 months ago

Cynosphere commented 9 months ago

Game version/server type

Describe the bug

Screenshots

Bot trying to pathfind off a ladder through a wall instead of The walkable surface through the wall Bot stuck crouch jumping trying to dismount a ladder

Additional context

Navmesh has manually created ladder nodes (via navmesh.CreateNavLadder) as func_useableladder is not recognized by the navigation editor. ttt_bb_teenroom_b2.nav.zip

thebigsleepjoe commented 9 months ago

Func_useableladder has been historically problematic with the bots due to its different functionality than func_ladder (which is already strange enough). I will create a demo level to draft a solution and see what our options are. I appreciate your conciseness.

thebigsleepjoe commented 9 months ago

Do you have a script to automate navmesh creation for these types of ladders? If not, how did you apply the function you mentioned to create the nav ladder?

I'm currently using your navmesh to troubleshoot (thanks for providing that by the way), but it would be helpful to know how you did it down the road.

Cynosphere commented 9 months ago

It generates a ladder center to the vectors specified. I just manually took two points close to the nearest snapping point when nav_snap_to_grid is 2, rounded them up, subtracted the difference on the axis for the normal and divided it by two. Took the Z axis for the bottom of the ladder for the second vector's Z. Width is also the difference on the normal axis.

Sorry if my explanation isn't the greatest, its hard to formulate my method into words

thebigsleepjoe commented 9 months ago

Thank you for your explanation. I have made a minor adjustment to fix the issue of the characters getting stuck on these types of ladders. This solution seems to work well on the provided navmesh. However, since these ladders are a legacy form that is not well-supported by Garry's Mod, it's not a perfect solution but it's good enough for now.