ch00beh

✨ software pretengineer ✨

i'm here to dumb ass and chew bubblegum and i'm all out of bubblegum

name gen: @onomancer

capybara dating app: @capybr


mogwai-poet
@mogwai-poet

which consists of people looking at a screenshot of code that is straightforward and getting angry that it's not more complicated.

I'd just like to posit here that a straightforward solution is an excellent default and you should have a really solid argument for the advantages of a complicated solution before you choose it.


tef
@tef

every time there's a "look at this gamedev code" post, it's usually from a cs graduate, often fresh.

for them, code is a means to demonstrate knowledge

they've never been tested on "making things maintainable" or "exploratory programming", but they have had to spend exam after exam writing code to show that they know fancy tricks. the idea that code can be boring is almost anathema.

this habit continues well into their career: you don't have to look further than a technical interview or code review to see more senior programmers setting up elaborate games to show how clever they are.

that's why when they bump up against gamedev code, be it 5000 if statements, or three state machines lovely crafted into a powerset to handle events, it just feels wrong. the code works, does what it needs to, but no-one gets to feel smart about it. what gives?

"i get it, you've only seen code in a textbook"


lifning
@lifning

i haven't looked at Balatro in particular yet, but 1000 times this.

all the big-O properties of algorithms you learn in college are irrelevant in the world of indie game development. unless you know you're doing a very specific computationally-ridiculous thing as your game's gimmick, your favorite data structure is the Vec/ArrayList. it's simple and it's cache-coherent and it lets you write the game part of the game.

"but I'm supposed to use a linked list if I'm making a lot of insertions and deletions" yeah buddy, enjoy all the allocs and frees that come with it. you'll know you need something different when it becomes an issue and you can replace it then.

refactor your code as you need to in order to stay motivated to keep working on it, but the best data structures and algorithms to use for a game are the ones that get it finished.

think of how many more copies Balatro would've sold if its code were more mathematically pure and elegant!


ch00beh
@ch00beh

ok but like making fucked up little one-liners makes me feel alive and therefore keeps me motivated /s


You must log in to comment.

in reply to @mogwai-poet's post:

in reply to @tef's post:

I'm reminded of this one time I saw someone try to launch a crusade against some game based on the filesize of the game's code minus any assets. The logic was literally "they raised all this money on Kickstarter to make not even a megabyte of code."

I also think (without having every done any game dev) that plasticity of code is uniquely important to game dev. Someone who builds CRUD servers for a large company such as myself is operating under fundamentally different constraints, timelines and goals than an indie game developer does. It shouldn't surprise that "what good code looks like" is different

in reply to @ch00beh's post:

tbh i did judge the balatro code a bit but more as a self-reflection in that i personally could not handle maintaining 1000 if statements and i'd like to have turned it into yaml or something because my brain is smooth πŸ˜”