▲ | hnthrowaway0328 2 days ago | |||||||||||||||||||||||||||||||
Can absolutely relate and understand. I taught myself C++ by writing games with SDL2. The first game -- snake took about a couple of hundred lines and I put everything in one .CPP file. And I felt pretty good. The second game, well, I forgot what it is, not Tetris nor Breakout, but it was complex enough that I realized that I need to put code into header files and source files. The last game of that project was a Ultima-spinoff. I even used the same sprite sheet. The complexity completely drowned me. I was constantly asking myself how should I arrange things properly so I don't need a lot of global variables that every file can see, because naturally the Game class needs to see and know all other classes, and the Renderer class needs to see and know many other classes too, etc. Eventually I dropped the project. A few years ago I picked it up again and figured out something that is close to Entity - System (not ECS just ES). I didn't complete the project but then firmly believe that it was the right architecture, and I was simply too burnt out to complete it. This year I learned about ECS from pikuma. I think it's over complicated for small-medium games. Anyway I'm trying to say that I agree that writing a 10,000 line project is way more complicated than 10 1,000 line projects. | ||||||||||||||||||||||||||||||||
▲ | wavemode 2 days ago | parent | next [-] | |||||||||||||||||||||||||||||||
Unrelated to the central point of your comment, but I've also found that a simple entity system is usually perferable to ECS for smaller games. ECS aids performance, but performance usually isn't what you're struggling with in a small indie game. You're mainly just struggling to organize your code, and just need something simple to help manage complexity. | ||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
▲ | jart 2 days ago | parent | prev [-] | |||||||||||||||||||||||||||||||
Adopting an existing well-established style guide is a good way to make these sorts of questions go away. https://google.github.io/styleguide/cppguide.html |