releasing the warmup i were working on

please comment your oppinions about http://pygame.org/project/1261/?release_id=2198

this game is still not that polished (on stuff like collisions and keyboard handling), neither follows PEP8 norms... but i think it can have some interesting clues (like using ship rotation, sprites from subsurfaces from spritesheets, and text from charactersheet pictures) for people may want to code shmups...

it were previously coded on sdlBasic, an interpreter i reccomend to all people still struggling with Python and Pygame (like me...), which can be helpful for pre-prototyping games for Pyweek. (imho)

(log in to comment)

Comments

Just as a heads-up, this won't run for me on Mac OS X ... it appears that the version of Pygame installed by easy_install is built without support for loading PNG images.

Hey, that's great, nitrofurano! It's surprisng how menacing rectangles can be with the right atmosphere!

I have an issue with the sound effects. There's like a 1-second delay before they play. It's extremely noticable. If I fire a shot from the bottom of the screen, it doesn't play until the shot is already off the top of the screen. Is it just me? I tried it on two computers, both running Ubuntu 9. It's nothing in your program per se; I get it consistently with pygame.

Also, I'm very curious whether and how you applied your color harmony suggestions to this game.

thanks! :)  but don't forget i'm still very newbie on Pygame... (not a surprise if i can't do something working for pyweek 9 competition...)

i were using pygame 1.9 on python 2.6, afaik - maybe older versions of pygame has this lack of png support - i run this game without any problems as it is - i don't know this easy_install (i installed from the usual pkg installers from those imagedisks - which versions are you using? - try updating as i did) - my surprise is, on a MacBook, it runs faster on MacOS-X (10.4) than on Ubuntu (9.04)

it's sad, because PNG is an awesome format for pictures on Pygame: it's open, supports alpha channel, has a good compression, etc... - there are some experiences i did were PNG converted from SVG, just loved it - it's sad all versions of Pygame doesn't support that...

anyway, i weren't applied any colour harmony - everything is random, besides the character set and ship are black and white - the random were intentional (what an excuse! ;) ) on this game

the colour balance were got from a hierarchic feeling of colour shapes: a monocromatic background with a random colour, the rectangle enemies are all random (sizes, shapes and outlines - it loads from a png, but the sdlBasic version is really made from directly drawn sprites - i done this way on Pygame because i really struggled with that) - the huge problem about colour harmony is when you have an unbalanced feeling of shapes with similar size, and unbalanced

i were planning to do a game loading palettes from sites like colourlovers.com, but maybe i need to deal with exceptions for when you get them online or not, and having them temporarily stored

the difference of the random colour used on background between title and action screen is the title is between 85 and 170 (each rgb channel), and action between 0 and 255

yes, the sound is delaying 1 second - is it because i'm using .ogg files? :/

and thank you all about your feedback!

i started this game around 15 months ago, on sdlBasic - the warmup were recoding it on Pygame... ;) (and try to realize which were the main differences between sdlBasic and Python-Pygame, and how can i get working on Pygame what i were coding on sdlBasic from 5 years now)

an encouragement for MacOS-X users:

http://img233.imageshack.us/img233/1496/picture1mlt.png

(the command in the terminal the sdl window hides is that usual 'python run_game.py')

surelly you are also having the same issues from PyMike's BubbMan2DX - it also uses PNG and OGG - and the sound seems delayed in 1 second also there

easy_install is part of setuptools which automates the process of installing python packages, allowing you to type "easy_install pygame" and (in theory) get the latest version installed automatically. Unfortunately it seems that for some reason it was installing the Mac OS 10.3 pygame package; replacing it with the 10.5 version seems to have fixed the problem.

Anyway, the game works now and seems to be running pretty smoothly. The sound effects are also playing fine for me.

@adam - i didn't know it, i use OSX very rarelly (i'm really very far about trying Fink and all that stuff... - and my OSX - and everything else related to OSX and hfsplus - is squeezed into an 8gb partition... - almost all the rest is ext3... ) - thanks about the tip! :)

This game is scary. Buzzing sounds, everchanging rectangles and background, strong and chaotic colors... it makes me uncomfortable. It's interesting to see how you used chaotic colors and changing shapes as tension, but I found it too chaotic to enjoy it as a game, in my opinion (though maybe that was your intention). I think it has more value as an experience rather than as a game.

yes, a bit like this - the game is purelly experimental - i'm also trying to pursing this kind of experimentalism on indie games - of course some games like Rez and those from Kenta Cho or Oohara Yuuma were strong influences for me, and i'm curious to see what can be done beyond - indie experimental games has the freedom we can't see on mostly commercial games, and i think this issue is to be explored at most.  From one side (humbly saying) i got surprised on how soon i could do a game like this, just with joining some code pieces i had somewhere, and on other side, i feel there is a lot of things missing there, could be great exploring which progresses may it show...

it's a cumpliment seeing you tell my game is scarry, thank you! - japanese horror movies are scarry as well, and they are brilliant, not unregretting John Carpenter and Dario Argento, of course! :) - if we can provide this kind of emotion from a game, that's wonderful! :)

and that about 'uncomfortable' can be related as a spirit state - sometimes we need something more calm and logic, other times stuff more noisy and chaotic - i think it's like the tastes or needs we have about listening music or watching movies...

another interesting thing is, how far 'risky' can be your game, even if people hate it, imho, more people may cite it as a different game, or with elements can be useful on other games, as happened vice-versa all the time, of course - i think doing indie games is wonderful because this - just take a look at sobe indie game blogs like http://www.indiegames.com/blog/ and http://gamasutra.com/ - is interesting how some games appearing there are always trying to break all the rules, and i think it's wonderful that's happening...

but, of course, i'm never unregreting polished pixel art, polished tunes, polished 3d meshes, etc. - i think everything is a contribute to the game development history, and each one among us has their very own oppinion, and constantly changing depending on the games we are constantly knowing and experimenting - overally we are pleasing and nurturing our souls playing and developing them! :)

Hey nitrofurano, I glanced at your source code, and I have a tip for you that comes up every PyWeek. Make sure you use os.path.join for filenames. Where you have sndtmp=mixer.Sound("data/shot.ogg"), it really needs to be sndtmp=mixer.Sound(os.path.join("data","shot.ogg")). Otherwise it won't work on Windows. If you use the Skellington, you can also just say sndtmp=mixer.Sound(data.filepath("shot.ogg")).

Erm, "data/shot.ogg" does work on windows - perhaps it fails on Mac or something?<BR>

I know everyone says that is a problem, but using the "/" specifically I haven't had a problem in a long time...

Oh, sorry. I was, in fact, just repeating everyone else who said it's a problem. I don't have access to Windows so I don't know. I guess it's not a problem after all. Nevermind!

@Cosmologicon - what Skellington is? i forgot msWindows and ReactOS uses backslash instead of '/' - i also don't have access to Windows

@nitro: he means the PyWeek Skellington

Forward slashes will work on Windows for most things you're likely to be doing in game code, but I wouldn't like to rely on it.

Backslashes will definitely not work on Linux or MacOSX.

Even if it's not strictly necessary, I would still recommend using the os.path functions in platform-independent code.

This is about my previous comment about sound effect latency. I tried reducing the pygame.mixer buffer (a suggestion I found in a previous pyweek entry) and it seemed to improve things. In fact, it was best when I reduced it all the way to 0. You need to call pygame.mixer.pre_init before either pygame.mixer.int or pygame.init, and set the 4th parameter to something lower than the default of 4096, like this:

pygame.mixer.pre_init(22050, -16, 1, 0)

However, the pygame documentation warns that sound dropout may occur. So I don't know if this is really the best solution. Does anyone know more about this issue?

I've successfully used some quite small buffer sizes (16 or less). Never thought to try zero, though -- I'm surprised it works at all! Possibly it's actually substituting some minimum size when you do that.

Yeah probably. The documentation says "The buffer size must be a power of two (if not it is rounded up to the next nearest power of 2)." I don't know what the minimum legal value would be, then. On the other hand, I don't understand why a low value would cause sound dropout. For all I know, 16 may cause much less sound dropout than 0, and not make any noticable difference in latency, in which case 16 would be better.

In slow machines a short buffer produces scratchy sounds; by example with pygame 1.7.1, a win XP pentium3  800 , with ( if I remember well ) 1024 for buffer was scratchy; after increasing the buffer to 4096 the sound was normal.

A search in the pygame list ( at gmane.org, by example) will show more than one hit in the relation buffer size-scratchy sound
Thanks for the tip, claxo. I tried it out and got scratchy sound by setting the mixer frequency to 44000Hz and the buffer to 256. At 22000Hz, a buffer of 256 was slightly scratchy but not too bad. And at 11000Hz, even a buffer of 0 had no problems. And according to one hit on the pygame list, it also depends on your OS and audio driver settings. I guess if I want synched-up audio (I don't know why I never noticed it until now) I'll have an option to adjust the buffer size.
GCEwing - I have yet to see a forward slash not work on windows.  Can you give an example where it fails?  I have been programming python for some time, and windows is my primary platform - I always use forward slashes.  Where does this go wrong? 

The only time I can think is if you are using os.system or some other command that turns into an external command, rather than being executed from python.