by gh123man · 4y ago · 0 comments
Some of the interesting bits of the engine are open source: https://github.com/gh123man/Portal-Raycaster
Sorry to be pedantic, but I think you mean the opposite? Big reward for modest effort?
Then the ratio is indeed high!
I play a lot of games, from PC to console to mobile to handheld to VR, I really don't get these kinds of takes. Until games from indie to AAA fix their existing loading and stuttering and microstuttering and various other issues, clutching pearls over GC non-determinism seems so silly. There's no GC to blame for why you can stare at a static scene with a can in a console AAA game under development for 6 years in a mature engine and see its shadow flicker on and off. I find it hard to believe we'd be in a much worse situation if GC languages were even more prevalent. Part of this is that there's already a lot of sources for non-determinism in a C++ engine that can cause issues including frame slowdowns. Of course with effort you can eliminate or bound a lot of it, though the same is true for GC'd languages. Real-time GCs have been a thing for decades but sure you probably aren't using one, nevertheless you can often tweak a non-real-time GC in useful ways if you need to -- or as is mentioned every time this topic comes up, do the same thing you'd do in C++ by allocating big pools ahead of time and reusing things (i.e. not making garbage). Memory management is not the hard part of making a game, though the more complex and demanding the game or constraining the hardware the more you'll need to consider it regardless of language, and change up what's idiomatic when programming in that language.
Not that it matters, because any positive t is going to mysteriously always be too much, but the 1ms number is really underselling ZGC. Maximum of 1ms pause times was the goal, in practice they saw a max of around 0.5ms, an average of 0.05ms (50us), and p99 in the above-linked article of 0.1ms (100us). A more interesting complaint would be the amount of memory overhead it needs. Tradeoffs are everywhere.
Reading such gameport took >1ms, and you wanted more than one reading per second :)
On that count alone I would never-ever consider it in hobby/games project of any sort.
It doesn't matter what features a programming language has, if it takes seconds if not minutes to compile even relatively small projects (less than 50-100k LoC).
Personally, I'm now doing hobby projects in Rust because it just feels right. But I've done entire systems in assembly, so I am a bit of a control freak. YMMV.
And if you're not doing that, you're either wrong, or have a terrible project structure (comparable to including literally every header in every source file in C++)
Now try that against D, any .NET language, Nim, Swift, Go, or any other GC language that supports value types and unsafe programming.
I suspect LÖVE / LÖVR would perform better than Java for games, but haven't tested or verified myself.
---
[0]: https://love2d.org
[1]: https://lovr.org
1. Prevents memory corruption
2. Have way better compilation time than C++ and Rust, absolutely horrid compile time for both.
3. Have all sorts of developer-ergonomics features (like being able to write functions in arbitrary order (compared to C/C++))
4. Have built in reflection (none in C/C++)
5. IDEs/autocomplete/refactoring tools etc, just generally work better for C#/Java/etc.
Garbage collection is probably close to bottom on the list why I would use GCed language when making an indie or hobby scale game
I would never consider using Rust simply because it takes too long time to compile even for relatively small projects.
Especially not for hobby or indie scale game projects.
People should learn more about what is in the toolbox.
It’s a trade-off; performance in games is more important than correctness anyways so I tend to agree with you here.
https://unrealcommunity.wiki/memory-management-6rlf3v4i
https://docs.unrealengine.com/4.27/en-US/ProgrammingAndScrip...
But historically games have been boundary pushers, and a GC's overhead isn't really desirable in that space.