Jonas Tyroller Profile picture
Indie Game Developer / YouTuber My games: ISLANDERS, Will You Snail, Thronefall

Aug 24, 2025, 22 tweets

Best Code Architectures For Indie Games (Thread)

Firstly: I am a professional idiot, don't listen to me.

Secondly: Most games are pure spaghetti code so no need to feel bat if yours is as well.

If it works, it works.

Write reusable systems that are independent from each other. It reduces complexity and increases the chance that you can reuse them in future projects.

Glue your reusable system together with some dedicated glue code, whatever you prefer, game managers, event busses, signals...

Limit spaghetti length. Keep systems as small as possible.

Spaghetti needs to stay on the plate.

Spaghetti is neatly rolled up on various plates. (Wait, am I still talking about game dev...)

So you have reusable systems and glue, but you also have data. You want to keep your data separate and organized.

Happy game designer easily finds all of his data.

Angry game designer has to look for the data all over the place. He is very angry.

Having a good database is so much of a win that it's almost worth it to design it first, and then build the other systems on top.

But only after prototyping and verifying that what you want to build makes sense in the first place (duh).

When I say database, I mostly mean immutable data. Mutable data can live together with the code, or not (e.g. if you like ECS), up to you. Actually, it's all up to you but that is not the point of... eh..

There is one very long spaghetti you can't avoid.

Time

All your systems need to connect to that super-spaghetti and it often creates a mess (for some games more than others).

Controlling execution order carefully yourself and not bothering with Unity's random f*ing update and awake events can be very much worth it for bigger projects (probably, need to verify with big projects).

Separate your game into simulation and view. This makes tasks even more granular and your project even more modular, and hopefully less complex.

So kinda like building 2 games at once. Each has its own systems, its own glue, and its own data. Data for the view would for example be stuff like colors, sprites, meshes, animations.

Most importantly, stay organized, whatever that means for your game. (It means something different for every game, because every game is different and has different requirements.)

Lastly, tell me where I'm wrong and what you would add so I can do better next time. I have much to learn. Thank u.

Share this Scrolly Tale with your friends.

A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.

Keep scrolling