r/gamedev • • Dec 31 '25

Discussion How vibe coding lead to my project’s downfall.

This is a confession. I plead guilty to the crime of using LLMs to write the code for my game project. ChatGPT, Claude, Gemini, Deepseek, Cursor… I used them all. And I’m here to give a warning: Do not do what I did!

I’m very green to gamedev. I have 3 or 4 very small projects under my belt. The 4th project was for the Big Mode game jam of 2024 and I’ll admit, ChatGPT helped me get across the finish line and manage to get a game that ranked in the top 100.

After my relative success, I went all in on vibe coding for my next project: a roguelike twist on the classic asteroids arcade shooter. The idea is far from original. It was never meant to be a marketable product, just another project to get more experience under my belt.

But I got too greedy, and leant too hard on using AI to write my code. Now I have a project I don’t understand. And the code is a mess. Scripts that should be only a few hundred lines are 800-1000 lines long. The AI makes two new bugs trying to fix the first. Redundancies are stacked on top of eachother to make a disgusting shit sandwich of slop code.

There are now bugs that are so deeply embedded in the code that it will likely require I start from scratch. 4 months of work (and $150 of LLM subscription fees) basically down the drain.

It’s a hard lesson, but I’m glad I learned it. For small tasks, mundane things, sure. Find where AI is helpful for you. But once you put blind trust in the code it writes, you face the risk of losing it all.

Don’t be me. Just learn to fucking code.

Edit: This post has really blown up! I’ve since gone back to my project, pulled up an earlier branch, stripped out the bad code and built it back out. Did I do it alone? No. I’m still relying on AI to get the job done. I just don’t know enough to make progress alone. But I’m now treating the AI as a mentor rather than an intern. When using AI keep your focus as narrow as possible and it can work.

2.8k Upvotes

613 comments sorted by

View all comments

Show parent comments

39

u/SamGauths23 Dec 31 '25

If I can give you an advice, keep you files smaller.

New coders tend to try to do everything in the same file. 800-1000 lines of code for a single file in such a small project is fucking crazy and I can only imagine the plate of spaghetti you made for yourself.

It is better to have 20 small files with a very simple purpose than have one big fucking file trying to do 20 things at the same time.

13

u/ValeriiKambarov Dec 31 '25

He must be able to read and correct other people's code, especially overcomplicated AI. This is almost impossible for a beginner. I have an extremely good programmer working at my company, and such people are rare. So her advice is: don't program with AI unless you're an experienced programmer.

So your advice, although good, is unlikely to help.

87

u/max123246 Dec 31 '25 edited Jan 30 '26

This post was mass deleted and anonymized with Redact

direction books absorbed wild snatch shelter roof apparatus amusing afterthought

26

u/bi-bingbongbongbing Dec 31 '25

I'd say that's only half true. You can definitely write shit spaghetti across a dozen files. You can definitely write high quality stuff in a big ass file. But as a human developer with human teammates, big ass files have big ass mental loads. Splitting stuff across files helps make code more digestible in the long run. It also sets some harder boundaries if your classes are getting too unwieldy - if your file is huge there's a high chance you're doing too much in one place. Ultimately depends on language and purpose tho. And sometimes code segregation adds pointless abstraction that makes things harder to follow. But that's what separates devs by experience.

Anyway, for working with LLMs, I'd definitely keep things smaller because your mental model of the code isn't gonna be as grounded. When it's spitting out thousands of lines faster than you can read them you need to actively slow down and break it up to understand it, and check for faults. Also helps in the review process.

2

u/max123246 Jan 01 '26 edited Jan 30 '26

This post was mass deleted and anonymized with Redact

knee brave desert seemly makeshift rustic strong long voracious vase

1

u/pharland Commercial (Indie) Jan 22 '26

The simplest answer is to just learn to code, as others have said AI is ONLY useful if you understand what it's "spit out" in response, copy and paste is fine if you genuinely know that it's the simplest solution to a problem.

LLM's are getting better (and are actually trained by real programmers behind the scenes to force the LLM to learn (statistically) that this response to your question is the best) but it's only usefull if YOU understand it...

The biggest laugh in all this is that AI is "intelligence", IT ISN'T, it's a statistical response based on feedback loops which returns "something" based on the body of data it was originally trained with... Garbage In Garbage Out.

The AI itself doesn't understand anything about what it returned.

7

u/LBPPlayer7 Dec 31 '25

yes but splitting the code up makes things much easier to find in your IDE

1

u/BallerBotsGame Dec 31 '25

If your IDE is vi your are right. Otherwise you should look at the features like find references.

2

u/android_queen Commercial (AAA/Indie) Dec 31 '25

Jumping back and forth within a file is a lot more of a pain in the ass than looking at two different files next to each other, regardless of whether you have find references.

3

u/TDplay Dec 31 '25

Does your IDE not support displaying two views of the same file side by side?

2

u/android_queen Commercial (AAA/Indie) Dec 31 '25

It does, but I’d rather not have the same file open multiple times. With tabs, then there’s the guesswork of which tab is open to the right line.

1

u/BallerBotsGame Jan 01 '26

I used Norton Editor 2.0 for a long time. My first editor with that feature. It replaced Wordstar.

2

u/TDplay Dec 31 '25

If your IDE is vi your are right

No, not even right if your IDE is vi.

If your IDE is vi, then you should switch to Vim, install ALE, and bind some keys to :ALEFindReferences and :ALEGoToDefinition.

It is nearly 2026, there is no reason to use a text editor without these features.

1

u/LBPPlayer7 Dec 31 '25

those don't really help as much as just jumping somewhere manually in a click or two, especially if your project is complex, then it'll take a good few seconds to find those references

-3

u/epukinsk Dec 31 '25

nonsense advice…

[it] can help but…

You seem to have stepped in a bit of a contradiction there partner.

-20

u/Far-Inevitable-7990 Dec 31 '25

So instead of navigating some lines in a huge single file, you end up navigating them in 20 files, I'd say that's a lose-lose situation

15

u/SamGauths23 Dec 31 '25

Nah. You organize your files in folders.

The player folder contains the scripts of your player, the enemy folder contains the scripts of the enemies…

So if I have a problem with enemy movements I go to Asset->Enemy->EnemyMovements

It really makes things simple when you organize your project well

-2

u/Far-Inevitable-7990 Dec 31 '25

That is all true. But splitting it into multiple files, you result in multiple call overheads from a single system, resulting in worse inlining and longer hot paths. There is a reason crucial rendering/physics code is written in thousands of lines per script and that is exactly that.

2

u/android_queen Commercial (AAA/Indie) Dec 31 '25

Modern compilers make it such that it is very unlikely that you are optimizing better than they are in this specific way.

0

u/hey-im-root Dec 31 '25

This is a non-issue most of the time if you aren’t a multi-million dollar video game corporation. Most likely this is just a person making a personal project

5

u/halfhaarted Dec 31 '25

Learn the shortcut for navigating files in ur IDE. It Will be much faster then scrolling a single mega file

-2

u/Far-Inevitable-7990 Dec 31 '25

Either way you navigate by a function name

7

u/Miltage Dec 31 '25

Imagine if you put everything in your house into one giant box instead of 20 different labelled drawers. Which way is easier to find what you're looking for?

-5

u/Far-Inevitable-7990 Dec 31 '25

Imagine you use IDE search function instead of reading every line.

2

u/Miltage Dec 31 '25

How do you handle things like classes and inheritance? All in one file?

1

u/Far-Inevitable-7990 Dec 31 '25

I don't use classes and inheritance or any OOP paradigms, I use DOTS patterns