5 ms·
He quickly mentioned it, but good god, coding for a game is the hardest thing ever in the field. If you are a good software engineer, there is a good chance you
by h1fra 1y ago
He quickly mentioned it, but good god, coding for a game is the hardest thing ever in the field. If you are a good software engineer, there is a good chance you are a bad game dev. It's so different, convoluted, mostly relying on tricks, clean code will slow you down, nothing works as you expected, and you have to learn so many things around coding (the engine itself, physics, texturing, modeling, lighting, etc.)
- kamranjon 1y agoA really good book I read recently was Game Programming Patterns by Robert Nystrom - I think it has helped me, as a more traditional software engineer, to dip my toes into game development in a way that doesn't feel like a spaghetti plate full of hacks and tricks. I recommend it.
- ehnto 1y agoI do find years in enterprise made me uniquely prepared for organising my game code. I definitely see the spaghetti in there, but it's at least neatly contained in the bowls I've set out. But it's definitely the hardest software domain I have ever tackled, and if only it were just software! Game dev is realy 6 other disciplines in a trenchcoat. Which disciplines they are depends on your game and whether or not you have help.
- mclau157 1y agoNormal maps are a good example of tricks in games, why make a watery surface millions of triangles when you can just fake how light reflects off of it and trick people into thinking its got millions of triangles
- wallstop 1y ago> Clean code will slow you down Hard disagree. In fact, learning how to apply clean code and architectural patterns in game dev has kept projects manageable and on track and done nothing but level up my general software ability.
- Sohcahtoa82 1y agoGame coding makes you have to think about thinks that a lot of web devs don't have to (or merely don't bother to) consider. Optimization is paramount. To maintain 60 fps, you need to calculate your game state and render graphics in under 1/60th of a second. That's only 16.6[..] milliseconds. If you want to appeal to the high-end players with 240 hz monitors, you get less than 5 ms. When you're operating at that level of latency, every microsecond counts. You start having to care about how your data is laid out in memory so that you can optimize cache usage. You start caring about branch mispredictions. Multithreading becomes an absolute must, but locks are landmines. If you're using a garbage collecting language, per-frame allocations are kryptonite and you re-use buffers to avoid unpredictable pauses. Your profiler becomes your best friend. You're not just looking for good performance, but consistent performance. If there's a 3 ms spike in CPU time every 10 frames, your players will absolutely notice it and it will destroy the feel of your game. That 3 ms becomes a critical bug.
- badsectoracula 1y agoI think this is some mythical game programmer you have in mind because, having worked in a few AAA/AA games myself, i can clearly tell you that the overwhelming majority of programmers - including engine programmers - rarely think about any of that. Sure, someone might occasionally pull out a profiler, but only if things start becoming visibly bad. But this is an exceptional situation, not the norm. On the other hand, game engines are constantly engineered with features that go against performance: interpreted scripting languages, ad-hoc garbage collectors (for assets, not only for scripts), visual material editors[0], deep object oriented hierarchies with FAT objects (hello Unreal Engine), etc. [0] Shader compilation stutter is something a lot of gamers notice and dislike and a common explanation for its existence is the number and complexity of shaders current games use. But one thing very few seem to notice is this is only the case in engines that allow designers/artists to create materials with visual editors that generate shaders without understanding the implications. In engines that do not allow that (such as current id Tech) and artist have to create their materials using a low number of predefined shaders you rarely hear about this issue.
- bentt 1y ago
- kjkjadksj 1y agoIt is kind of funny how much effort is put into graphical fidelity both in terms of software and in the hardware to run the software. And then, the true battle tested objectively good games that have dedicated communities are games like supersmashbros melee, old school runescape, tf2, etc. It is like an arms race that doesn’t even need to be played. Whatever is released gamers have shown they are fine with if the mechanics are great. Crysis tried to stand out back in the day as the greatest graphical experience and about all it was good for was a benchmarking tool. No one talks about playing crysis anymore. Meanwhile people are still playing on Bloodgulch as we speak. Still playing dust2.
- dahart 1y ago> It’s so different, convoluted, mostly relying on tricks, clean code will slow you down There’s a seed of truth here, but at the same time, I’ve heard this mostly from people who learned certain programming patterns in school or in enterprise application development, and never learned embedded systems engineering, or just plain didn’t start with game development. You might be referring to issues with specific game engines, or you might be referring to writing only scripts and plugins for an existing game engine, as opposed to writing a game engine, I don’t know, but generally speaking game coding absolutely can and should be clean. It’s just a different kind of clean than you might expect, if you’re used to thinking in terms of C++ inheritance or functional programming or design patterns you learned elsewhere.
- Mona4000 1y agoIt's the opposite. What passes as "good engineers" nowadays is just mindless zombies that can be easily replaced by AI. Gamedev requires actual problem solving skills.