Saturday, January 17, 2009

The future of Cheese Boys is in the Cheeseshop

For the last time: the name of my game is not related at all with the Python Package Index (also know as Cheeseshop). When I start to develop the game, I didn't know at all pypi!

In those days I didn't developed anything directly related to Cheese Boys (it's not true... I'm near to fix and finally close the Stealth mode) but my attention was moved back to another project of mine: KezMEnu.

KezMenu started as an internal Cheese Boys module, but then I decided to create a more stable, indipendent and debuggable library. So I released it as an indipendent package.

This is related to my personal "war" againts the other pygamers, because I find that Pygame community has a lot of great ideas (some developer released great games), but too often not well structured.

Problem one: start a project aiming to the sky
I mean: often I saw developer start great projects, release in a very short time a lot of good working examples and then... nothing. Projects had dropped.
Why? Obviously is always possible that this is for personal choice, but I also think because many try to get "all and immediatly" and when the difficulties went out the game was too bad structured to be funny again developing it.
Yes, because making a game is FUNNY (or so is for me).
Cheese Boys started very (too) slowly: I have a few time for free develop what I like, but every release always had a precise (but near) target. In the 0.0.1 version I didn't aim directly to get a game with the stealth mode, but only to move a Glenn sprite on the screen.

Problem two: unstructured, caothic code and not OOP
Structure the code is important, refactoring is more important. Maybe that every release of mine lead to minor or major code refactoring.
The use of the Object Oriented Programming is the key for a friendly code. I downloaded a lot of funny games from Pygame. Often I played great games and I begin to look at their source founding that they weren't readable at all (call this the Dark Side). The comment (and the pydoc strings) are very important, but not required if the code is well readable itself.
The most dangerous thins I found is the idea that releasing a game or a libray in a single file is good. Wrong!
This can be true for very simple games (and libraries), and as well this can really help sometimes in integrating 3rd party library (like I did when for the first time I included Vector2 class, or EzMeNu), this must not be a develop metodology!
Split your file! Make it a module composed by many .py sources (Light Side)!
Taking the Dark Side is simpler, and lead to immediatly results (don't think that I never evaluated to drop Cheese Boys and start a new simpler, Space Invader's like game!) but can't lead you to complex results!
One of my favorites, unfinished, game on Pygame is Gladius I, another creation of one of the best Pygame community member: PyMike. This game lead me to say "I really want to be able to create a game like this". I really liked the only release avaiable (not on the Web anymore... I have my personal copy if you wanna try).
I found this a great game, but the code inside can't lead it to be finished (Yes... sometimes Mike is one of the most powerfull Sith of the community :-)!

Problem Three: separation of concerns
If the game is becoming too big, begin to split it in general modules. Put those modules away and make they a game dependencies!
This will help other people to use you code (and maybe improve it), and the final result is the same! Today with Python the library dependencies are simple to maintain!
Use the Python Cheeseshop! Learn how to write python eggs!
You are interested? So learn how to use Python Distutils. I wrote a tutorial on it!

Problem Four: too multitasking
I mean there the programmer's multitasking, not the program's one! Develop few projects in the same time! Too often game were drop to start another...

Conclusion
There are hope for Pygame? Yes! In the last time I see many developer release good code... I hope to help somebody to pass to the Light Side and begin using the For... erh... the Cheeseshop!

</offtopic>
Ok, now lets turn back to Cheese Boys. As I reported in the title of this post one day (may be immediatly after the 0.2.0 version) I will begin splitting the game engine from the game.
The engine future is as an egg onto the Python Package Index!

1 comment:

  1. I'm very interested on your unfinished tutorial about setup.py usage
    please complete it

    ReplyDelete