.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   General Bot Coding (http://forums.bots-united.com/forumdisplay.php?f=24)
-   -   Handling BSP Clip Nodes (http://forums.bots-united.com/showthread.php?t=10117)

Neoptolemus 22-09-2022 10:14

Handling BSP Clip Nodes
 
Hi everyone,

Bit of a long shot asking, hopefully there's still people around!

I have an issue with parsing a BSP file to produce a navmesh. The issue is that right now I'm transforming a HL1 map into a triangle mesh for navmesh generation by lifting out the vertices. The vertices represent all visible parts of the level geometry.

This is fine for the most part, except that func_illusionary entities are also visible and therefore included in the list of vertices, which means that they're treated as solid, same as the rest of the geometry. This is easy to fix by just discarding any vertices tied to a func_illusionary.

What isn't easy to fix however are clip brushes. I believe most HL maps use a func_illusionary to create something with transparency (such as a ladder or chain-link fence) and then use a brush with a clip texture to prevent players moving through it. The problem is that because these clip brushes are never rendered, their vertices never appear in the list of vertices in the BSP. I think they're represented in the clipnodes lump instead.

The result is that currently I have only two choices: have the bots treat all func_illusionary as solid, meaning bots can't walk through the curtains in cs_747 for example, or treat them all as non-solid, meaning the bots will try to walk through the chain-link fence in cs_militia and get stuck.

Has anyone resolved this issue before? I can see a reference to the BSP format here:

http://hlbsp.sourceforge.net/index.p...pdef#clipnodes

But I don't understand how you can convert a clipnode into a set of vertices. As far as I can tell, it only holds a plane normal and distance from the origin, making them infinitely wide and tall.

RoboCop 22-09-2022 15:47

Re: Handling BSP Clip Nodes
 
Hello, have you joined our Bots-United Discord? We mostly have our activity in there.

https://discord.gg/5v5YvKG4Hr

SamPlay 07-11-2022 10:46

Re: Handling BSP Clip Nodes
 
hello,
build a map from the bsptree:
- start with an aabox ( a convex poyhedron) big enough to encompass the virtual world
- split this aabox by the bsptree down to leaves ( which carry contents information);
in cases where a node plane splits the current polyhedron, build 2 faces to close the two resulting polyhedra on the splitting plane.
you will get all the faces ( associated with contents of the leaf they bound)/edges/vertices you need

tschumann 31-12-2022 02:29

Re: Handling BSP Clip Nodes
 
It looks like the Counter-Strike bot nav mesh generation code is in https://github.com/ValveSoftware/hal...ame_shared/bot (I think) - does that give any hints?

RoboCop 31-12-2022 15:14

Re: Handling BSP Clip Nodes
 
Yes well Michael Booth is credited for making CZ Bots using nav meshes...

Immortal_BLG 11-03-2023 01:50

Re: Handling BSP Clip Nodes
 
Hello

See Glidor's Quake2 modified engine to understand how to build brushes out from bsp30 file. In your code you only need to switch drawing nodes to clip nodes.
See jswigart's Omni-bot to see how to create vertice mesh from generated brushes. This mesh later can be provided for recastnavmesh for example.

I personally thanks to Glidor realized tracing against bboxes of different sizes in HL1 engine, but this is not the end, with generated brushes we can trace against any arbitrary shape even if it's angled like it does in modern game engines like source engine - I think this thing is definitely must be in HL1 modified engines, like regamedll for example

The only one i've stucked in is how to match clipping brushes with drawing brushes to stole their texture data and original size without addional hull.


All times are GMT +2. The time now is 00:31.

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