r/opensourcegames • • 13d ago

Just released an alpha version of the game i was developing. Its a fun math demo and very familiar to those who have play minecraft - 3DGameOfLife

https://github.com/CameronWeller/3DGameOfLife-Vulkan-Edition
6 Upvotes

3 comments sorted by

4

u/RadicalRaid 13d ago

A lot of the code is completely unreadable. Let alone the complete lack of coherent code styling, mixing conventions of C#, C++, C, Python, and I'm sure others as well. Even within the same functions and method code styling is all over the place.

uint32_t a = h[0], b = h[1], c = h[2], d = h[3], e = h[4], f = h[5], g = h[6], hh = h[7]; for (int i = 0; i < 64; ++i) { uint32_t t1 = hh + (rotr(e, 6) ^ rotr(e, 11) ^ rotr(e, 25)) + ((e & f) ^ (~e & g)) + k[i] + w[i]; uint32_t t2 = (rotr(a, 2) ^ rotr(a, 13) ^ rotr(a, 22)) + ((a & b) ^ (a & c) ^ (b & c)); hh = g; g = f; f = e; e = d + t1; d = c; c = b; b = a; a = t1 + t2; } h[0] += a; h[1] += b; h[2] += c; h[3] += d; h[4] += e; h[5] += f; h[6] += g; h[7] += hh;

If this is written by a human, what is even going on? What's the logic behind it?

I think it's pretty clearly written by AI. And I feel like this is where the problem lies with AI and Open source games: AI can produce (superficially) functional results, nobody is questioning that. But the big reason I, and I imagine a lot of other people, are here is to learn how things can be smartly implemented. The result in a way, is secondary. The devlogs for Factorio are infinitely more interesting than a random incoherent implementation that mostly outputs what the prompter wanted, yet has no educational value.

Though I will say, the write-up on the game of life and such is pretty neat, but also something most game developers are probably already familiar with. Still, it's a nice write-up!

One of the reasons, aside the morality of it all, I refuse to use AI is that it'll introduce code that is basically too incoherent for humans to understand without investing a bunch of time into understanding it. And I believe that is at least partially by design. Because, if the code it outputs is not that understandable by even veteran senior engineers then you also have to depend on AI to "fix" it, which comes in handy if you're the people selling AI, doesn't it?

Anyway, not to shit on the project too much, it looks like a fun experiment! But I just wanted to share something that has become, in my eyes, a problem in the open source community in general.

All the best!

1

u/The_Basic_Lifestyle 9d ago edited 9d ago

Totally understandable. I appreciate you looking this far into it at the very least. As these models make better and better code its inversely going to make worse and worse human readability. At the very least ill be prompting it to make the codebase more readable. Sorry as I am only a hobbiest who cant program well. I must say the game works surprisingly smoothly for what it is. Being able to program right into vulkan from scratch makes incredible efficiency.

1

u/The_Basic_Lifestyle 6d ago

I just updated it please take a look and tell me if its more parsable on your end.