.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   General Bot Coding (http://forums.bots-united.com/forumdisplay.php?f=24)
-   -   Recast / Detour (http://forums.bots-united.com/showthread.php?t=9985)

Neoptolemus 09-10-2015 14:38

Re: Recast / Detour
 
Just a quick update. I've decided to take a different approach. I'm going to modify the existing recast demo tool (the one I linked to earlier, either in this post or the one in the HPB bot forum) so that it parses BSP files instead of OBJs, and have it retain useful information like entity positions and so on.

This will give me much greater flexibility when debugging paths and so on, as it will allow me to easily visualise the entire navmesh as it's generated, and conveniently mark data points without having to run the game and write some finicky code to draw it all within the game itself.

I eventually envisage being able to load a BSP into the application, and see the simplified level geometry and navmesh, but also all the extra bits it's generated such as door points, ladder points, hostage locations, sniper positions, cover locations and so on. I'll store this inside the navmesh itself so that it is part of the Recast library rather than the demo app, which will be purely for visualisation only.

In theory, I can perfect the generation of the navmesh and pathfinding within the application, then simply migrate the library over to the bot itself and hook it up.

The Storm 10-10-2015 13:51

Re: Recast / Detour
 
Hmm, I though that you are parsing the BSP already, perhaps I misunderstood something earlier. Anyway I also think that this is the best approach. :)

Neoptolemus 10-10-2015 16:53

Re: Recast / Detour
 
Quote:

Originally Posted by The Storm (Post 66308)
Hmm, I though that you are parsing the BSP already, perhaps I misunderstood something earlier. Anyway I also think that this is the best approach. :)

Oh yes, I'm parsing the BSP already, but from inside the game. The Recast demo is a separate application written by Mikko, who is the original author of Recast. It's essentially an OpenGL renderer with a built-in GUI that can parse OBJ files and generate a navmesh.

I'm planning on switching development to the demo tool as it makes it a lot easier for me to view debug information on the navmesh itself, so I can see all the tiles, show/hide elements of it, and it has a path testing tool too. First step is to have it parse the BSPs directly instead of OBJ files, which should be mostly a copy/paste of code from the bot.

The idea is that I can use it to perfect the navmesh generation engine, then port it over to the bot code itself and have the bots benefit, rather than develop the bot directly and have limited testing tools at my disposal :)

The Storm 11-10-2015 00:43

Re: Recast / Detour
 
Now I got it. Sounds like a good plan. Good luck then. :)

Neoptolemus 13-10-2015 14:47

Re: Recast / Detour
 
Right, finally got it parsing BSPs properly. Had a bit of a frustrating moment where it was coming out garbled, but I think it's down to the fact that OBJ files start indexing at 1. All sorted.

Just going to start working on the placement of icons for things like ladders, doors, hostages etc so we can start seeing the automatic generation of a tactical layout for BSPs opened in the program. Once there's enough of interest, I'll release a version for people to play with.

The Storm 14-10-2015 20:42

Re: Recast / Detour
 
Count me interested. :)

Neoptolemus 16-10-2015 11:33

Re: Recast / Detour
 
Just rebuilding the off-mesh connection code in Recast at the moment. Right now, off-mesh connections have to be positioned somewhere on the mesh, which makes sense except that the top and bottom of a ladder brush in the BSP won't sit exactly on the mesh itself.

At the moment, I have a clunky system where I generate the mesh, then find the closest point on the mesh to the ladder points and add them to the off-mesh connections, then regenerate the mesh. This works fine but like I said, it's clunky.

I'm currently looking to rebuild the system so it does that automatically, but the way it currently handles off-mesh connections doesn't make it quite so simple.

Once I've finished that I'll add a bit of rendering code to render little icons at the top and bottom of ladders so you can see where they are. Then I'll probably release a build so you can play with it :)

The Storm 17-10-2015 15:57

Re: Recast / Detour
 
Nice, I can't wait to see it. :)

Asperoch 19-10-2015 03:12

Re: Recast / Detour
 
Very nice! I also would like to try out the build and the bot template once it's released. :)

Neoptolemus 02-11-2015 23:36

Re: Recast / Detour
 
Hi guys,

Unfortunately I've not had time to work on this, so I'm just going to release the source as it is.

I've cut back on a lot of the experimental stuff which really didn't work, so what you have is essentially the following:

- Ability to process the current map data to generate a navmesh in Recast
- Able to export map and navmesh data to OBJ format
- Basic pathfinding functions including finding random points, generating paths and so on
- Basic steering to avoid corners and getting stuck
- Able to process ladders and include them in the navmesh
- Frustum-based vision for near-perfect simulation of player FOV
- Function stubs for events like bot killed by player, bot killing player, bot seeing player etc.

I want to keep working on this but probably won't get a chance to until Christmas. I'll probably step back from navigation and work on other stuff like bot vision.

Download the source and pre-compiled dll here:

https://dl.dropboxusercontent.com/u/...t_20151102.zip

Have fun!


All times are GMT +2. The time now is 11:34.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.