Search Results
6/27/2025, 10:11:08 PM
>>713817486
>all these nodevs replying
It's basically fine, and midwits critiquing it are cringe. Storyline and progress flags are basically always going to look like this as by their nature they're a loooong list of bools or enum'd status states. Every major game you've played ever has a class that essentially looks like this used to track story progress and "what's next".
Pretty much the only ACTUAL potential note is that it being untyped is POSSIBLY (but not guaranteed) bad because if you eg decide to delete a quest later, you now just have holes in the flags array and you don't get linting in your code for things hooked into the quest that you need to delete stuff: but you give up a LOT of versatility to have that typing as now you have to look a bunch of places or sub-elements to get relevant story progress and you lose the benefit "a single ground source of truth for all aspects of story progress". You therefore pretty much should only do this if you're going to have several MAJOR disparate flag types (story progress, "job" or "shipbuilding" progress in a game where eg jobs or shipbuilding are a major multi-step minigame) and otherwise shouldn't play with fire.
>but It's a megafile
hot take if everything in a file ACTUALLY is related, megafiles are good. Fuck opening 15 files and enum definitions to manage one story quest
>but it should be in a config
Configs on this kind of thing are an antipattern and you're a retard - its all the negatives of no linting, and none of the ease of code searchability for gameState[idx] when you ACTUALLY need to change shit.
>but it should be a switch statement
In games it doesn't matter: your game is not going to be slow because you didn't optimize the 2 nanoseconds you're going to save by optimizing your conditionals to run as jump tables, it's going to be slow because it's an unparallelized cache-thrashed memory-jumping mess that you don't throw in a profiler at any point before release to figure out what's ACTUALLY slow.
>all these nodevs replying
It's basically fine, and midwits critiquing it are cringe. Storyline and progress flags are basically always going to look like this as by their nature they're a loooong list of bools or enum'd status states. Every major game you've played ever has a class that essentially looks like this used to track story progress and "what's next".
Pretty much the only ACTUAL potential note is that it being untyped is POSSIBLY (but not guaranteed) bad because if you eg decide to delete a quest later, you now just have holes in the flags array and you don't get linting in your code for things hooked into the quest that you need to delete stuff: but you give up a LOT of versatility to have that typing as now you have to look a bunch of places or sub-elements to get relevant story progress and you lose the benefit "a single ground source of truth for all aspects of story progress". You therefore pretty much should only do this if you're going to have several MAJOR disparate flag types (story progress, "job" or "shipbuilding" progress in a game where eg jobs or shipbuilding are a major multi-step minigame) and otherwise shouldn't play with fire.
>but It's a megafile
hot take if everything in a file ACTUALLY is related, megafiles are good. Fuck opening 15 files and enum definitions to manage one story quest
>but it should be in a config
Configs on this kind of thing are an antipattern and you're a retard - its all the negatives of no linting, and none of the ease of code searchability for gameState[idx] when you ACTUALLY need to change shit.
>but it should be a switch statement
In games it doesn't matter: your game is not going to be slow because you didn't optimize the 2 nanoseconds you're going to save by optimizing your conditionals to run as jump tables, it's going to be slow because it's an unparallelized cache-thrashed memory-jumping mess that you don't throw in a profiler at any point before release to figure out what's ACTUALLY slow.
Page 1