Closed gongpha closed 11 months ago
Is there a way to run these examples, or to test it out locally? I downloaded the branch, but don't see anything different...
I will add them later. I'm not sure that should I replace it entire Quake1 Example. Because it might break your player update. Since the clip node collision shapes (must be used for player body) are somewhat extruded due to the simplifying process. The player body collision box must have a change.
I still recommended using collision shapes from a Map file rather than from the bsp one if you already had a map file when importing maps for your game. Because they're more optimal and clean. This extraction method is more likely used in case you only had a bsp file. for example, playing maps from PAK files.
Sounds good. I agree about the changes needed to collision for the player. I think the original collision code is very different than modern engines. Not sure how useful either. It would have been nice if it was possible to extract exact clip
brushes from BSP only and not have to rely on map
files.
Using -wrbrushes
when compiling map files will embed brushes into the BSP, so for the purposes of being able to use only BSP and not have to ask users to provide MAP files, it would be a good option. Then this engine would still be able to extract clip brushes from the BSP...
I tried compiling a map with -wrbrushes
option added. But it gave me an empty BRUSHLIST lump . . . idk why (ericw 0.18.1)
-wrbrushes
is a really interesting option though.
To respond to your question on https://github.com/godotengine/godot-proposals/issues/6695 - I didn't realize the clip brushes were stored exclusively in the clip nodes. Makes sense, though, as they don't impact point raycasts, so they don't need to be close to geometry -- only larger stuff collides with them. I believe the clip nodes are pre-extruded to match the player collision box (and I think there's another set or 2 for larger stuff). Planes are also added on edges that aren't on axis as well (so you can stand on the top of a pyramid, for example). Effectively, the planes are extruded such that the player movement can be done as a ray cast. You'll have to move them back on each axis (payer is 32 units wide and 56 units tall, so I think you'd move them back half that, so 16 units on the horizontal and 28 on the vertical. Not sure if vertical is centered). Then, if you're getting collision from the regular brush data as well, figure out what's redundant and remove it.
Also, you'd want to filter the clip stuff with appropriate layers/masks so only players and monsters collide with it and not bullets.
Small world. PS @gongpha you should join (UPDATED) https://discord.gg/qMRaS7f6kJ if you're interested in Quake stuff, it's were all the gibheads hang out.
@victorbstan the link was expired.
Updated link if you're interested.
I added the usage of clip nodes in Quake 1 EX. Also changed the collision and behavior of the player.
Surprised that the new collision player shape is neither a player bound box nor a smaller box. But only a single point . . . which resulted in me changing the stair shapecast to a raycast for checking stairs.
Surprised that the new collision player shape is neither a player bound box nor a smaller box. But only a single point . . . which resulted in me changing the stair shapecast to a raycast for checking stairs.
Looking forward to trying it out. I know there's maybe a larger size expanded hull shape for larger monsters, but I'm curious what this implies for making custom games... as the original quake game only supported two types of monster shapes (roughly)
You can use any monster size you want. At least they mustn't be smaller than the player hull size (32x56x32 or 1x1.75x1 in godot unit).
More, If you're planning to import maps for custom games, I suggest you avoid using clip nodes for collisions if possible. Because not only they were extruded. But they can cause some hassle in the development process. Imagine if you worship clip nodes by causing you to have to adjust every entity collision box to fit the clip nodes. This can slow down the development process.
There're replacements here :
Use BSP tree for collision. As they weren't extruded. But it won't include clip brushes for sure. The workaround to include clip brushes in the BSP tree is to promote them to entities in TrenchBroom. And config them in the class script for filtering who can collide.
Use the plugin's traditional importing method -- import MAP and BSP together to keep the original data for conversion and more optimal and faster collision shape parsing.
EDIT :
-wrbrushes
data for collisions in BSP files that are newly compiled as BSPX inside the plugin. I didn't experiment with it yet. But should be a nice method for maps in custom games.Rebased
Added ambient sounds when walking into bsp leaves.
Here, this PR will add the ability to extract BSP/Clip nodes from a BSP file for proper collision shapes instead of extracting them from a MAP file.
AFAIK, The BSP nodes are elements of the BSP tree, which is commonly used for rendering map geometries and detecting an exact collision e.g. hitscan from firing a gun. The clip nodes are used for detecting entity collision majority e.g. moving player. And they also have oversized collision shapes from simplifying a detail from map geometries for faster collision checking.
And more, this extraction could lead to PVS implementation like visleaves in the future.
Before a MAP file requirement, I've been trying to import BSP/Clip node data for performing collision shapes rather than baking trimesh (concave) shapes from the BSP triangles. Because they're slow and don't work at all on area nodes (used in trigger entities), even though the backface collision is enabled to fix this issue, that'll make the performance goes worse. Therefore, the MAP brush shapes were required for proper collision shapes. And, that's why it needed a MAP file every time we do importing process. (And that was also a reason why this plugin was named "Qmapbsp" ^^;)
Here are some more results :
BSP node shapes (exterior)
Clip node shapes (exterior)
BSP node shapes (interior)
I believe that they should be fitter on infinite planes. But these are easy to visualize their shapes though.![Godot_v4 0 3-stable_win64_6hVBWIZKwT](https://github.com/gongpha/gdQmapbsp/assets/13400398/22a873ca-9a2c-4d0b-b289-a0f1887a0697)
Clip node shapes (interior)
E4M4 (both were imported)
Clearly differences between BSP and clip nodes