.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Developer's Farm > General Bot Coding
General Bot Coding See what a pain it is to get those little mechs shooting around

Reply
 
Thread Tools
Re: Navigation using AABB
Old
  (#11)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,620
Join Date: Jul 2004
Location: Bulgaria
Default Re: Navigation using AABB - 26-03-2017

Nice. I'll be waiting to see the bot in action.
  
Reply With Quote
Re: Navigation using AABB
Old
  (#12)
Neoptolemus
Member
 
Status: Offline
Posts: 93
Join Date: Apr 2012
Default Re: Navigation using AABB - 09-04-2017

Quick update: I'm still going, but my new company didn't issue me with any kit, so I'm having to share the family laptop which my wife and kids also use. I did a lot of my coding on the train to work, but obviously I can't take the laptop with me at the moment.

I have been trying to port the code over to HL proper, but I'm getting crashes even though the code is identical, which is weird. Just trying to debug
  
Reply With Quote
Re: Navigation using AABB
Old
  (#13)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,620
Join Date: Jul 2004
Location: Bulgaria
Default Re: Navigation using AABB - 09-04-2017

Easy fix, just buy one more laptop.
  
Reply With Quote
Re: Navigation using AABB
Old
  (#14)
Neoptolemus
Member
 
Status: Offline
Posts: 93
Join Date: Apr 2012
Default Re: Navigation using AABB - 16-04-2017

Right I'm finally up and running with a new setup, so I am back in action

The pathfinding solution is now working in the bot itself, so I am trying to get some footage of the bots running around, however the path nodes hug the walls too tightly at the moment so the bots end up getting caught on corners.

It's been a little while since I worked with this, so for some reason I am having some trouble getting basic things like forward/right/up vectors for traces. In the old version of my bot I was calculating the forward direction from the bot's current origin to the next point in the path, but right now I just want the forward vector to be the direction the bot is looking in.

From memory, there is a function called UTIL_MakeVectors which takes view angles (such as pEdict->v.angles) then populates the v_forward, v_right and v_up vectors into gpGlobals. However, attempting to include this produces an unresolved external symbol error even though the IDE identifies it correctly.

Is there a better way to just get the Vector of a player's current view angle? I searched online and only found functions like AngleVectors which don't exist, and no code examples online on how to create my own

EDIT: I figured it out. I just created a wrapper function to call g_engfuncs.pfnAngleVectors Hopefully I can get the bots running reasonably smoothly now, though I will still need to spend some time fixing the path finding so it doesn't hug walls and corners so tight. Perhaps some kind of "erosion" like Recast uses to shrink the navmesh away from walls and edges.

Last edited by Neoptolemus; 16-04-2017 at 13:14..
  
Reply With Quote
Re: Navigation using AABB
Old
  (#15)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,620
Join Date: Jul 2004
Location: Bulgaria
Default Re: Navigation using AABB - 19-04-2017

From very long time I've also wasn't digging in bot movement/looking code so I can't really point out a solution, but if you have trouble compiling some function I will be glad to help.
  
Reply With Quote
Re: Navigation using AABB
Old
  (#16)
Neoptolemus
Member
 
Status: Offline
Posts: 93
Join Date: Apr 2012
Default Re: Navigation using AABB - 20-04-2017

Quote:
Originally Posted by The Storm View Post
From very long time I've also wasn't digging in bot movement/looking code so I can't really point out a solution, but if you have trouble compiling some function I will be glad to help.
Thanks!

I've had a new problem crop up which has me completely stumped: the bots can't crouch any more! I had it working great, the bots were able to climb ladders, crouch into vents etc, and then suddenly they stopped crouching. Now they sort of start walking but remain standing up.

To try and debug the issue, I commented out all code and just set the bot's forward speed to pEdict->v.maxspeed and pEdict->v.button |= IN_DUCK. The bots just start walking. What the hell?!

EDIT: Never mind, no idea how I fixed it but it works now. I really need to abstract some of this stuff and hide it somewhere safe so I don't keep accidentally breaking it.

Last edited by Neoptolemus; 21-04-2017 at 00:08..
  
Reply With Quote
Re: Navigation using AABB
Old
  (#17)
Neoptolemus
Member
 
Status: Offline
Posts: 93
Join Date: Apr 2012
Default Re: Navigation using AABB - 21-04-2017

I've finally got the bots running around in-game. Still need to do a lot of tweaking of the core pathfinding process as it still hugs the walls too tight in many cases, and as you can see the path generated is still a little drunk and weaves around a bit.

However it's surprisingly effective. I'm still working with CS 1.6 because the maps are less complex than the Natural Selection ones so the bots don't get caught up on the geometry quite so much.

https://youtu.be/Xey8cQBcG7Y
  
Reply With Quote
Re: Navigation using AABB
Old
  (#18)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,620
Join Date: Jul 2004
Location: Bulgaria
Default Re: Navigation using AABB - 21-04-2017

Looks pretty neat. Good job.
  
Reply With Quote
Re: Navigation using AABB
Old
  (#19)
Neoptolemus
Member
 
Status: Offline
Posts: 93
Join Date: Apr 2012
Default Re: Navigation using AABB - 21-04-2017

Additional bonus video of the bot running around cs_militia. I'm really pleased with how smoothly it handles ladders. Asides from the boxy pathfinding, the movement is really smooth.

In this video it manages to go from the CT spawn area, eventually landing on top of the side gate between the front and back yards of the house.

https://youtu.be/VAg_5DGod7k

By the way, the bot got stuck once he was on top of the gate, I think I set the max fall distance a little too low so he thought he couldn't jump down
  
Reply With Quote
Re: Navigation using AABB
Old
  (#20)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,620
Join Date: Jul 2004
Location: Bulgaria
Default Re: Navigation using AABB - 21-04-2017

It's funny to see how the bot looks down when is reaching a connection, I had the same issue with E[POD]bot long time ago. :}

Btw, you should add some radius to the path so the bot will move smoothly and if the place is too small just set the radius to zero. The Podbot based bots have code when you are using the autowaypointing option each waypoint is placed with as some radius depending on the place. In this way if you have multiple bots following the connection the chances to collide are much smaller and the movement will look more smooth.
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 2 (0 members and 2 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com