Galaco / kero

Kero is a Source Engine game engine client implementation written in Go.
The Unlicense
47 stars 3 forks source link

Could this be used for Ray-Tracing on CS:GO maps? #47

Open markus-wa opened 3 years ago

markus-wa commented 3 years ago

Hi :wave:

This looks like an awesome project, well done! I was wondering if it could be used for doing headless visibility/LoS checks for CS:GO. I'm mostly thinking in the context of demo parsing here.

I'm imagining something like:

  1. LoadMap("path/to/mapfile")
  2. call RayTrace(a, b)
  3. get back true / false or number of objects in between the two points
  4. profit!

would this be something that could fit into the scope of the project?

Galaco commented 3 years ago

Hi there!

Thank you! It's been a huge pain so far, and likely to be so indefinitely 😬.

That certainly is an interesting thought. Right now, it's kinda the opposite of what you're looking for. It's predominantly a renderer, with most other features unsupported. CS:GO support is, perhaps incomplete. I know there is a crashing possibility with BSP lump 35 in some CSGO maps (specifically sprp lump data), although that's more an issue with my bsp parser than this project. It's something I'll get around to eventually.

That being said, I am already slowly working through bsp and displacement collision hull parsing and loading. Once this is done, LOS checks should be relatively trivial for bsp geometry. Props will present a larger challenge; I still haven't finished staticprop loading 100%, nor touched on Dynamic or physics props, or collision models yet.

This is certainly something I'll bear in mind. Extricating the rendering functionality from map loading is sorely needed, and sooner rather than later. Thinking about being able to launch entirely headless certainly gives me a lot to think about there.

And you're very welcome to contribute anything if you so choose. Even something simple as maps that crash or fail to load or have any messed up materials are extremely useful.

markus-wa commented 3 years ago

Great to hear that'd you'd be open to supporting that. If I get some time soon I will have a look at how I could start contributing (though I don't really know anything about map files, rendering engines or anything the like :sweat_smile:)

I think for the purposes I'd be interested in it dynamic/physics props would be secondary (mostly because I guess that would require loading the state of these props from the demo files) - but of course it would be great to have all this for other use-cases :slightly_smiling_face:

Galaco commented 2 years ago

Apologies for taking so long to provide any update on this. A few months ago I integrated bullet physics into the project. I haven't exposed any kind of raytracing functionality yet, but this should be much more achievable now.

There also needs to be a little more refactoring to allow for some proper headless mode (skipping vtf, renderer & gpu submission). I don't know when I'll come back to this project, but this is sitting sitting in my mind to get done.

As an aside, I will also be looking into integrating your democs-golang project at some point soon; as it gives me a stepping stone for implementing netcode.

markus-wa commented 2 years ago

No worries, I also didn't get around to looking any further into this but it's something I really want to do at some point.

If you need any help at all with the netcode stuff let me know - my knowledge is pretty limited to just what's required for demos, but if I can help I'll try my best!