Helion: A modern fast paced Doom FPS engine in C#

6 months ago (github.com)

I am curious if the author considered use of the built-in numerics library over hand-rolling types like Vector4F.

All of the methods defined here:

https://github.com/Helion-Engine/Helion/blob/20300d89ee4091c...

Are available in the kitchen sink:

https://learn.microsoft.com/en-us/dotnet/api/system.numerics...

Same idea applies to methods like GetProjection, which could be replaced with methods like:

https://learn.microsoft.com/en-us/dotnet/api/system.numerics...

Advantages of using this library are that it is uses intrinsics (SIMD) to accelerate operations. There is a lot of Microsoft money & time that has been invested into these code piles.

  • I also see the guys from Intel constantly stabbing at all these low-level types to optimize them too. There are optimizations in .NET 10 for processors that aren't even released yet.

  • I suspect it's part of the fun? A way to really learn something?

    There's also another hint:

    // THIS FILE WAS AUTO-GENERATED. // CHANGES WILL NOT BE PROPAGATED. // ----------------------------------------------------------------------------

    (Of course this could be a result of something having nothing to do with the contents of the file, but maybe the author has to meta library that can generate the types in different languages).

    There seems to be fixed-precision variants of the vector types as well which seems to be not available in the .NET framework.

    Plus, of course, you can't add your specifics needs to library types (like the fixed precision). They are closed to modification.

    I am just guessing, of course.

    That being said, it would also make total sense to use the .NET types.

  • Historically the .NET and XNA vector types have been seriously lacking for real graphics development, and they still don't even provide swizzling. It's likely that this project predates .NET numerics by many years, and anyone who has had a pet project for long enough will learn to avoid becoming too dependent on libraries and platforms that will die out.

I wonder if it can play through MyHouse.wad. Which, if you haven't seen before, is an incredible art piece.

https://www.youtube.com/watch?v=5wAo54DHDY0

If you've read House of Leaves, do yourself a favor and check it out.

Finally, a good example of a modern C# code base that is open source, and that doesn't look like the equivalent of J2EE in C#.

  • I wanted to provide link to Ryujinx repo, but I've found that Nintendo threaten them and they had to close the project :(

  • Thanks for your comment, made me want to check it out, and yea it's really clean code.

This looks interesting and I'm going to take a look later. Just a minor nitpick up front though, I think the performance graph should be a bar graph instead of a line graph. Mainly since the in-between states don't have much meaning as you can't be half way between 2 different gpus.

  • Those discussions are a bit misleading. Original Doom updates its state only 35 times a second, and ports that need to remain compatible must follow that (though interpolation and prediction tricks are possible for visual smoothing of the movement). Rendering engine is also completely orthogonal to polygon-based 3D accelerators, so all their power is unused (apart from, perhaps, image buffers in fast memory and hardware compositing operations). Performance on giant maps therefore depends on CPU speed. The point of this project is making the accelerator do its job with a new rendering process.

    Though I wonder how sprites, which are a different problem orthogonal to polygonal rendering, are handled. So, cough cough, Doxylamine Moon benchmarks?

    • "Rendering engine is also completely orthogonal to polygon-based 3D accelerators"

      Software rendering engine, yes (and even then you can parallelize it). But there is really no reason why doom maps can't be broken down in polygons. Proper sprite rendering is a problem, though.

      2 replies →

  • Even just updating the graphs would be helpful. There appear to have been several releases since 0.9.2.0, including a bump from .NET 7 to .NET 8 (and a bump to .NET 9 in dev).

    The more recent .NET versions by themselves are likely to have some impact on the performance, let alone any changes in Helion code between versions.

  • Might make sense to use a logarithmic scale for the graphs too, it's hard to tell what speed the other ones are since they're compressed so far down.

the Doom in TypeScript types project wouldn't have been possible without Nick and Helion - I owe Nick a huge thanks! He helped with some of the more obscure parts of the engine and also helped make a super small WAD that is what the game eventually ran in.

Legend.

Impressive C# performance!

How does licensing work, here... could you use this to develop an indie game and sell it?

FPSes aught to update the screen every millisecond. Why isn't this more common?

  • That would require a 1000Hz screen to even be able to output. 144Hz is the high-end today. It seems to be pointless to push beyond that.