17 ms·
Game development is a weird place. You want to be low level to get the most performance, but you also want to be expressive to be able to write an ambitious gam
by marginalia_nu 5y ago
Game development is a weird place. You want to be low level to get the most performance, but you also want to be expressive to be able to write an ambitious game. Really does invite the notion that there ought to be a better way, you get a sort of itch you can't quite reach to scratch.
I'm having a lot of the same struggles working on my search engine. What I want to do with files is often somewhere between what the operating system provides (too low level), and what a DBMS provides (too high level). So I'm having to build all these weird bespoke disk-based data structures myself. It's clear these things can be done and there is a lot to gain from doing it, but the language support for non-trivial disk based data structures is a bigger pain in the ass than sitting on a burning cactus covered in tabasco sauce.
- maccard 5y ago> Game development is a weird place. You want to be low level to get the most performance, but you also want to be expressive to be able to write an ambitious game. The vast majority of games don't need to be low level for performance. Practically nobody outside of massive AAA studios is writing architecture specific assembly for modern PCs or consoles (and even in those studios, there are very few people doing so). The majority of gameplay programmers are writing bog standard C++ that would be just as performant in C#, or in many cases a lot of the logic is written in a higher level scripting language that is orders of magnitude slower than the native C++, or even just writing all of the game code in something like C#. > Really does invite the notion that there ought to be a better way, you get a sort of itch you can't quite reach to scratch. Oh for sure, and there often are better ways to solve these problems. In my experience, one of the most common reasons for not doing things better is because the codebase is based on an engine from 20+ years ago when they _did_ have to avoid interfaces and virtual function calls for game performance, and you have "modern" systems that are built on top of those abstractions (in the same way that lots of modern networking libraries still leak details about concerns from the 80s/90s)
- marginalia_nu 5y agoDepends entirely on what you want to do. Use a bog standard engine, and you get Satisfactory. If you build your own, you can have Factorio. The former will never reach the sort of simulation complexity the latter can even on modest hardware.
- maccard 5y ago> The former will never reach the sort of simulation complexity the latter can even on modest hardware. You're comparing games rather than engines here. There is no reason at all that you can't write your simulation logic in vanilla bare bones C++ as factorio has done, and still get the benefit of using an existing engine. You get all the neat (and hard) things like serialisation, multiplatform support, networking, asset management, patching, and a bunch of other things. Sure, factorio may not need a 3d renderer, but it definitely needs and uses the rest of what I listed above.
- marginalia_nu 5y agoThe problem is you can't deal with the number of entities factorio regularly does on a stock engine. They just aren't made to deal with hundreds of millions of stateful and non-trivially interacting entities. That's not what game engines are built optimized for.
- maccard 5y agoJust because you're using unreal doesn't mean you need to have one actor per entity (for example). Using [0] as an example, there's no reason you can't implement a cache optimized simulation algorithm in C++ and pass the results out to UE4 instead of whatever layer factorio is using. To be fair, factorio is a pretty good example of when the existing options offer limited value (lock step networking, _very_ simplistic rendering, very little in the vein of "gameplay" features), but it's one of very very few. For every factorio, there's 100 2d side scrollin platforms that are written in a custom C++ engine rather than using unity. [0] https://factorio.com/blog/post/fff-209 https://factorio.com/blog/post/fff-209
- eternityforest 5y agoIs that really true though? Aside from graphics and physics, which seems to be highly reusable, where's the performance critical stuff? Lots of engines seem to be mostly using scripting languages for everything a game developer needs to do. I wonder if there's a DBMS out there somewhere that already does what you need? Seems like by the time you got to a scale where you would need custom stuff, you'd have money to redo it(Unless it's a foss thing meant to be big but not commercial, or to run on a server you're paying for yourself)
- marginalia_nu 5y agoSure. What about simulation? Like I mentioned Factorio in your neighboring comment. It does things with a custom engine that you simply can't do using "highly reusable" systems. Existing engines are great as long as you want your game to look and behave like every other game written in the same engine. It's gotten to a point where a careful observer can tell which engine a game is written in just by looking at it and feeling how much input lag and framerate variance it has.
- Agentlien 5y agoI work specifically with video game performance, mainly as a graphics programmer, and often focusing on getting things to work well across multiple platforms. In my experience the performance issues are almost always a combination of how much is being simulated and rendered, how it's being rendered, and how much stuff is kept in memory at any given time. If you can improve culling before rendering and physics, minimize the surroundings streamed in to your immediate vicinity, and optimize some of the heaviest materials and post effects, that goes a really long way. Of course, there's an endless list of caveats depending on what your game specifically is, but even in an open world game where things happen off screen the above applies. You just have very simply LODs/imposters for faraway visuals and simplified logic running at lower frame rate for characters in other parts of the world.