Game: Pygame Prototype
08/21/14
I've tried to make a wuxia-inspired game before.
Well, I've tried several times. I wrote a design document for it for a project proposal in the Game Development class I took (the team decided on another team member's idea). Freshly out of school, I attempted to make an engine that I would build this game on (don't do that). And then, about a year ago, I attempted to approximate the game idea step-by-step.
- Blank Screen that flickered on before program exited
- Blank Screen that lingered for a couple seconds
- Blank Screen that user can exit out of
- Rectangle drawn on screen that user can exit out of
- Arrow-key controlled rectangle on screen
- Click-controlled rectangle on screen
- Gravity on rectangle
- Rectangle stops falling below screen
- Mouse position creates arc that rectangle will jump along
- Platforms
- Collision detection fixes
- (Unfinished next step) Load in file from JSON
I abandoned it at that last step. Which was also a huge step that wasn't the right next step. In fact, a lot of the time I complicated the next step considerably by trying to optimize in some way.
Pre-optimization is a problem I constantly tackle with. "Don't optimzie until you profile" is a concept I'm familiar with, but I still get stuck following the rabit hole. I built a physics system that translated meters to pixels and vice versa (allowing y to increase upwards instead of down and giving things units that made more sense). This added a bunch of complexity and was not even close to necessary yet. I forced in a component system too early before really thinking deeply about what I was doing.
The component system worked, though it was riddled with order of operations issues. Amazingly, all the things I put in made things work, but their incorporation had consequences that I could've avoided if designed them differently later when they were properly needed.
Eventually the design made further development too much, and I accepted the need to abandon the code base. I left the repo on github as pygame_toy. It still works! Though you need to get pygame installed to run it.
It was more of a tech demo than anything else.
Still a great learning experience. I'm going to focus really hard on keeping things simple and thinking deeply about how my design is doing that (via decompling code, avoiding redundant code, etc.). I'm starting again in C++ with SDL, and I'm following a similar yet very different path than that of the pygame toy.
I'll tell you more about that next time, Stephan.