Join #ludumdare on irc.afternet.org
LD 11 :: Weekend of April 18-20 :: Theme :: Minimalist
Sign In | Rules Wiki | Write your Journal
Get motivated to compete in the foodphoto compo or timelapse compo!

The Results Are IN!! Congratulations mrfun, mjau, hamumu, and everyone else who competed!!
Time to hand out some trophies!!


illume's Archive

The Pumpkin Pillow Prize
Awarded by Hamumu on December 2, 2007

“raise” becomming a function in py3k?

Posted by illume
Wednesday, April 23rd, 2008
Over on the voidspace blog, there is a little discussion about raising an exception in a lambda.

Because raise is a statement, it's kind of a hard thing to do. Raising an exception as an expression that is.

Which "raises" the question, why isn't raise a function in py3k?

The two suggestions on how to raise in an expression were these:
>>> r = lambda: eval(compile("raise RuntimeError", '', 'exec'))
>>> r()

>>> ctypes.pythonapi.PyErr_SetObject(*map(ctypes.py_object, (e.__class__, e)))

Which are kind of both a bit yuk.

So maybe raise could be a bit more expressive in py3k?

Bars in Beijing?

Posted by illume
Tuesday, April 22nd, 2008
A friend of mine who lives in Beijing has set up a website categorising all the Bars in Beijing.

It's still a work in progress, but he has listed over 500 bars so far. For a place as big as Beijing, you can imagine that there's going to be a lot of bars. They're categorised by location, and if they are a night club, a bar, or a KTV(karaoke) place etc.

He still wants to add photos for all of the bars, and just generally make it a nice guide to Beijing bars.

basic animation system working.

Posted by illume
Saturday, April 19th, 2008

I don’t have any gameplay yet.  Just a simple animation program, which can animate lines.

Here are the things I’ll need to do to, so I can then start on some gameplay:
- interpolate between key frames to get the frame to draw.
- box select
- copy previous key frame into current key frame.
- save and load Frames with pickle.

I’ve also been playing around with the wonderful sfxr - to make beeps.

Mini Mal

Posted by illume
Saturday, April 19th, 2008

screen_shot_1208646754.png
LOG
====
AEST GMT +10

2008/04/19 17:13:53 AEST GMT +10

2008/04/19 17:53:39 AEST GMT +10

Don’t have internet at home, but going in the competition anyway…

I saw the theme at about +1 hours after the competition started (about 4-5 hours ago) in an email when I was at a cafe checking my email on the free wireless.  I have been coming up with a basic idea since then, but not giving it all that much thought.  I was thinking about drawing lines on paper, and scanning them in… then making minimal beep noises…

But then I wrote the name of my directory for the game… mini_mal… and aha!  Mini Mal was born.  I haven’t even to the ludumdare website since the comp started, but I imagine someone else has come up with the idea for ignoring the theme ;)

So the idea so far is this… Mini Mal the stick figure, with minimal beep noises.

MOST OF THE COMPETITON I WON’T HAVE INTERNET.  Bugger.

I accidentally had skellington game framework on my computer, along with pygame, and python.  So I’m just going to do a pygame game… with basic stuff.  Luckily I also downloaded the pygame documentation and examples… also lucky the python objects have documentation built in, also lucky I have been maintaining pygame for over 3 years now.

… now my todo…

DONE - window up, and basic event loop.
- basic animation program…
- draw line, click point, click second point.
- select point.
- draw end points of lines with rectangles.  Use collision functions to see which points are selected.

- lines are in each frame of the animation.
- to not show lines in one frame, you can mark them as invisible (somehow do invisible lines differently).
- key frames.
- can add/delete key frames.
- interpolation happens between key frames.
- frames per second.  Set at 30fps.

2008/04/19 18:30:03 AEST GMT +10

I made a line class, which subclasses the Rect class.

It can draw itself, with it’s own color…  oooh.  A white picture with a black line on it.

… now to make a screenshot function I think… maybe when I have something a bit better.

- draw line with end points.

2008/04/19 19:20:13 AEST GMT +10

It can now draw a line, and select the end points - and move the line :)

Now to go and get some junk food.

- make a Lines class, that has a def handle_events(self, events): method.
- make a Lines.new_line method.  So you then click to make the two points.
- make a Lines.delete_line method, which deletes any line selected.

2008/04/19 20:38:37 AEST GMT +10

Went and got some junk food.  A few lollies, and chips.

Then I had dinner, and then came back to work on a Lines class.  Almost there with being able to draw multiple lines.  Whilst coding, I’ve been thinking of how I can structure the animation editor.  Like how I can make collections of lines play at different positions.  I’ll have to translate the positions of the lines somehow… perhaps I’ll give each set of Lines a transform :)  Then allow selecting groups of lines, so I can animate multiple groups on the same screen.

Then I’ll need a way to load and save Lines… probably with pickle.

Now to finish off my new_line, and delete_line methods.

… oh, and I need to figure out the actual game part… hrmm.  that can come later, once I’ve figured out something cool.

2008/04/19 21:30:11 AEST GMT +10

the lines can be drawn pretty easily now.

Accidentally I came across a way to have the lines join up at the vertices.

Now I have a mode where I can select multiple verts to move at once… which allows a primative form of welding of vertices.

2008/04/19 21:46:28 AEST GMT +10

been playing a bit with drawing more… it’s kind of fun.  I’ve made it slightly easier for me to do things, and also experimented with line thickness… That could also be a fun thing to animate.

So the lines could grow thick from frame to frame.

… but how to save them all.

2008/04/19 22:34:24 AEST GMT +10

I think the pygame.Rect subclasses only pickle the pygame.Rect attributes.  Oh well.

Perhaps I can replace it later with a vec4d subclass… or something.

Anyway… this is what I want to do I think:

Frames
Frame
Lines
Line

So then I think I can just pickle the whole lot, and reload it.

2008/04/20 09:09:17 AEST GMT +10

I put a basic screenshot function in there.

- Create Frames class, get basic animation working.
- Make a box select.  So you can easily move many lines at once.

Ludumdare 48h game development competition this weekend.

Posted by illume
Monday, April 14th, 2008
For those that didn't have time for pyweek (like me) - there is the ludumdare game development competition.

The ludumdare competition is similar to pyweek - it's what inspired pyweek.

The main differences are it's more "from scratch", it is only one weekend, and you have to do everything yourself - no teams. Also you can use any language - not just python, and everyone can select themes over three voting rounds.

The main idea is that One has to do all parts of game development - art, coding, sound, music etc, and to concentrate on the design of the game - rather than building engines. So it's a short burst of creativity, and junk food eating - with around 100 other people at the same time making their own games.


(img by MrFun).


LD 11 :: Weekend of April 18-20 - Currently doing round 2 of theme voting.

database ORM adaptors?

Posted by illume
Monday, April 7th, 2008
Are there any adaptors for the various python database ORM models?

For example SQLObject Storm mother ORM django ORM SQLAlchemy GeniusSQL, etc.

It seems this might be a good way to reuse some models, and code for those models.

For example, say there was a SQLAlchemy Django ORM adaptor, then pylons, django, and turbogears could more easily inter operate.

Then if an adaptor for SQLObject SQLAlchemy was made SQLObject could then use the SQLAlchemy django ORM adaptor.

I guess at this point, sharing at the database level makes more sense.


update: http://code.google.com/p/django-sqlalchemy/ seems to be a work-in-progress "project to create SQLAlchemy mapping of Django models onto a SQLAlchemy backend".

Being proactive with bugs - search, not categorise.

Posted by illume
Wednesday, April 2nd, 2008
I like to search for bugs, not so much wait for them to be reported in one specific way. Here's a story to illustrate what I mean.

As part of a new pygame release we've been improving the pygame bug reporting, and fixing system.

The old(and current) system used the mailing list as a bug reporting system. We still use this system, but have added a few other methods. People simply report bugs and patches to the mailing list. Then developers search through the mailing list, and noted when they were fixed, on the mailing list. Because the pygame mailing list is quite large often a lot of people would view, review and fix the bugs. It also informs people how to report a bug - because people on the mailing list see it happening every now and then.

Having bugs in the mailing list is nice, because I can type BUG into my mail programs search function to find bugs. Or I can type PATCH to find patches. Or I can have my program filter emails with bug, patch from specific mailing lists to bug, and patch folders. When a bug is fixed, or people want to discuss it, you can just tell them in the email.

Some times people also email me directly about bugs - which is pretty easy if they don't want to join the mailing list, or put it into a bug tracker. People also leave bug reports in our web based documentation commenting system - and not only documentation bugs.

However bugs often got reported in all sorts of other weird places. People talk about bugs in OS distribution bugzillas, random blogs, and also random forums. As well as people talk about bugs on irc. There are also SDL specific bugs reported in their bugzilla (pygame depends on the Simple DirectMedia Layer).

So rather than waiting for people to submit their bugs in a particular way - we now go and search for them too. On the pygame bug page, I have collected together a selection of links to different OS specific bug trackers. So it's easy to see how the OS distribution specific bugs are going. (ps freebsd, and gentoo have been the best updating their packages of pygame to version 1.8 so far).

Searching for bugs, rather than waiting for people to report them, and categorise them is the way to go. Luckily we have search engines which can search the internet for bugs easily.

So now, rather than typing BUG into my mail program, I can type it into a general search engine. Since mailing lists, bugzillas, forums, and blogs are all mostly indexed - my searches for bugs and patches work just fine.

We also have a web based bug tracker - a pygame bugzilla - for those who like to file bugs away in a database. Since some people prefer to submit, and track bugs that way.

update: This World of Reuse blog post asks if this proactive approach to bugs is scalable for larger more widely used projects like firefox. I commented on the blog how it could be added to any sized project, but the comment is still in the moderation queue. I found the world of reuse blog post with my "pygame bug" searching.

bugs - search, not categorise.

Posted by illume
Wednesday, April 2nd, 2008
I like to search for bugs, not so much wait for them to be reported in one specific way. Here's a story to illustrate what I mean.

As part of a new pygame release we've been improving the pygame bug reporting, and fixing system.

The old(and current) system used the mailing list as a bug reporting system. We still use this system, but have added a few other methods. People simply report bugs and patches to the mailing list. Then developers search through the mailing list, and noted when they were fixed, on the mailing list. Because the pygame mailing list is quite large often a lot of people would view, review and fix the bugs. It also informs people how to report a bug - because people on the mailing list see it happening every now and then.

Having bugs in the mailing list is nice, because I can type BUG into my mail programs search function to find bugs. Or I can type PATCH to find patches. Or I can have my program filter emails with bug, patch from specific mailing lists to bug, and patch folders. When a bug is fixed, or people want to discuss it, you can just tell them in the email.

Some times people also email me directly about bugs - which is pretty easy if they don't want to join the mailing list, or put it into a bug tracker.

However bugs often got reported in all sorts of other weird places. People talk about bugs in OS distribution bugzillas, random blogs, and also random forums. As well as people talk about bugs on irc. There are also SDL specific bugs reported in their bugzilla.

So rather than waiting for people to submit their bugs in a particular way - we now go and search for them too. On the pygame bug page, I have collected together a selection of links to different OS specific bug trackers. So it's easy to see how the OS distribution specific bugs are going. (ps freebsd, and gentoo have been the best updating their packages of pygame to version 1.8 so far).

Searching for bugs, rather than waiting for people to report them, and categorise them is the way to go. Luckily we have search engines which can search the internet for bugs easily.

So now, rather than typing BUG into my mail program, I can type it into a general search engine. Since mailing lists, bugzillas, forums, and blogs are all mostly indexed - my searches for bugs and patches work just fine.

We also have had for a while a pygame bugzilla - for those who like to file bugs away in a database. Since some people prefer to submit, and track bugs that way.

hi, what is it? oh pygame 1.8 is released.

Posted by illume
Saturday, March 29th, 2008
Dear you,

I was walking down the street the other day and pygame 1.8 was
accidentally released.

oops.

Well anyway. Have a nice day. http://pygame.org/whatsnew.shtml
http://pygame.org/


* pygame.mask for pixel perfect collision detection
* pygame.scrap for clipboard support
* new and improved sprite groups, including layers, automatically
selecting fastest update mode(full screen or dirty rect updates), and blend modes...
* blending support for filling and blitting surfaces. ADD, SUB, MULT, DIV etc.
* saving surfaces as jpeg and png
* buffer access for Surface and Sound objects
* numpy, and numeric support for pygame.surfarray and pygame.pixelarray
* PixelArray, which can be used instead of numpy - without the dependency.
* smooth scale function written in mmx assembly with C fallback.
* More functions release the GIL for multithreaded use.
* lots of speed ups to many functions via better python wrapping.
* color thresholding, bounding box finding for images, and surface averaging.
* massive documentation updates (which have been available on the website for a while already).
* pygame.time.Clock.tick() is more cpu friendly.
* updates to example programs.
* new windows, and mac installers.
* hardware acceleration updates for overlays and opengl.
* porting work to different platforms.
* heaps of bug fixes including SRCALPHA blitting fixes, 64bit fixes, sound system fixes.

Plus there have been lots of changes to SDL itself since the last pygame release. http://www.libsdl.org/release/changes-1.2.html.

* lots of stuff really... but those are some of the nice things. Read the what's new page for full details http://pygame.org/whatsnew.shtml

chairs,


ps. Balloons and robots are cool.
pps. see readme for credits. Thanks to all the people who helped out :) Time for much beer drinking now I think.

py3k Decimal?

Posted by illume
Sunday, March 2nd, 2008
From the Cobra language, comes the idea of using Decimal numbers as the default. It's 2008, so let's use decimals by default!

This is an error that python has... Add 0.1 together ten times, and you do not get 1.0.

>>> 1.0 == 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1
False


Maybe py3k should use Decimals by default instead? Or is this planned already?

Python float performance is really bad anyway, so we might as well make it a little more accurate right?

Floats are such a cause of errors in code, it'd be nice if math was more accurate by default :) It requires a fair bit of knowledge to understand all the quirks of floats, but less to understand the quirks of decimals.


cu.

Great from scratch blender animation tutorial

Posted by illume
Thursday, February 14th, 2008
I've gone through this great blender animation tutorial.



It's really well made, and teaches you blender from the beginning - explaining everything as you go.

It was a "Blender summer of documentation" project where someone spent a whole month working on it. It was also based on an older tutorial which was itself really good There's a downloadable PDF version (180ish pages) if you prefer to read things that way - otherwise it's broken up into many separate html pages. It's also got .blend files you can download at every step if you wish - so you can skip steps.



So if you want to go from knowing nothing about blender, to being able to construct and animate a basic 3d character - this is the tutorial for you.

Introduction to Character Animation - with blender

Using pygame without a windowing system.

Posted by illume
Thursday, February 7th, 2008
This cookbook entry shows how you can use pygame without a windowing system.

http://pygame.org/wiki/HeadlessNoWindowsNeeded


Useful for scripts that run in webservers, or little command line utilities.

Sometimes you just don't need a GUI. Like maybe you want to do some 2d drawing in your opengl application.


The cookbook example is just a thumbnail generation example(using pygames fast mmx assembly using smoothscale function) - but you can do lots of other things with pygame too - like drawing lines - or graphing.




Lamina - using pygame GUIs with opengl.

Posted by illume
Tuesday, February 5th, 2008
David, the author of the upcoming Pitchers Duel baseball game has made a nice little module for pygame and opengl.

It allows you to use some of the GUI libraries with PGU. In the examples, it uses the excellent PGU, and Ocemp libraries.

However I think the general method can be applied to other GUIs fairly easily. It does the drawing on off screen surfaces, updating opengl textures as needed.

It even has a zooming demo... where the gui zooms. I like things that zoom.

pygame dev updates. 620 projects on pygame.org.

Posted by illume
Saturday, February 2nd, 2008
We have a new windows maintainer - Lenard Lindstrom. He's been submitting patches to pygame for a while now, and as agreed to help get pygame 1.8 out the door.

As part of his work, he has made compiling pygame on windows a lot easier.
"""I automated the dependency build process using a single standalone Python program, build_deps.py. All that is needed is to obtain the necessary libraries and MinGW/Msys tools. The builder will first reconfigure MinGW for msvcr71.dll. Then it will build all the libraries and install them into the Msys directory structure. All this can be done from the Windows command prompt. Expect it to take several hours though. Next the Pygame config.py script is run from the Msys console. Make sure the Python directory is in the Msys PATH. Finally setup.py can be run from the command prompt to build and install Pygame itself. All the necessary libraries will be copied to the pygame package."""


Brian Fisher has also joined the pygame dev team to help squash bugs, help people on the mailing list, set up an automated build compile farm, and generally help out on things. Brian also been submitting patches for a while now.

Marcus has finished his Numpy migration work - by changing the soundarray module so that it can use Numpy or Numeric to generate sounds from python.

There has also been a few more bits of functionality added around the preparations for release.

The pixel perfect collision detection uses the Mask data type. However now Mask can now also be used to find bounding rectangles around joined pixels.

pygame.transform can find edges in an image, get the average surface of many surfaces and also threshold an image by color.

Only a couple of things remain on the todo list before release now... Mac OSX clipboard support, and the Mac OSX installer. Both are being worked on, and tested. The Mac OSX installer mostly works - however we want to make sure it's perfect before we release it.



620 projects are listed on the pygame.org website now. Some very interesting stuff pops up there. Everything from a VNC 2 flash video converter, to soccer games, to games where a big kid bashes up hundreds of little kids, to a graphing program. All sorts of things, mostly done by one person too!

Tagging was added to the pygame website a number of months ago, and now all of the projects are slowly forming into more groups. Here are some of the more popular tags:
  • platformer
  • arcade
  • 2d
  • action
  • pyweek

    Some tags for individuals who have put up lots of projects.
  • philhassey
  • pymike
  • mallett



    It is still xmas on the http://pygame.org/ website until we get this release out! (Unless we release next xmas, and then it'll have to be xmas on the website for a while longer.)
  • hOur Factory - Melbourne Australia.

    Posted by illume
    Thursday, January 17th, 2008



    hOur Factory is a Melbourne arts festival of sorts that I'm involved with.

    Unlike most arts festivals, or parties hOur Factory lets interested people vote, and chose the theme. hOur Factory is an exhibition of arts, a warehouse party, and a film night all held in a big space on March 1st.

    It will have a gallery opening feel, and then move into performances, and music.

    Depending on the theme, I might be working on a project with 28 monitors and a whole lot of webcams. The idea is to form them into a sphere like shape, and have the monitors pointing outwards. So it could act as a spherical mirror of sorts. However the possibilities are quite large. It's going to be made from cheap $5 webcams, and recycled monitors that we hope to get for free (since so many people are throwing out their old CRT monitors).

    I should be using pygame to drive the displays... maybe doing some real time effects on them if there is enough processing power.

    I already have six CRT monitors, but I will be looking to borrow more. I've got a few old PCs that I'll be using with linux to do the processing.

    Once the theme is chosen for hOur Factory, then people will start writing about what their projects are on the hOur Factory website. If you know anyone in Melbourne who might be interested in being involved in an arty project - please let them know about it.



    cu,

    Which game idea to choose? The weight sits balanced at the moment.

    Posted by illume
    Saturday, December 15th, 2007

    Here the weight held up by a chain rests on a see-saw.

    I still haven’t really thought up an idea for a game. Here’s one idea, but it’s kind of lame. maybe lame enough to use… the player shows the chain to different celebrities pictures from google images, and sees their reaction.

    Maybe something to do with setting off a chain reaction in a plastiscene world. With weights, chains and see-saws. Or maybe just hitting celebs with chains to see their reactions. Not sure.

    A very strong chain.

    Posted by illume
    Friday, December 14th, 2007

    As you can see I had to make my chains very strong. Strong enough to carry this 700kg weight made out of plastiscene. To do this I needed to reinforce the chains with wire. I some how have lost my pliers, so needed to make a trip across the road to the pliers shop.

    What’s your reaction to this?

    Posted by illume
    Friday, December 14th, 2007

    Bleten. My game for the ludumdare 48h 2002

    Posted by illume
    Friday, December 7th, 2007
    This is a game made to the theme of sheep. This game is about sheep poo, and grass. You play the part of a sheep, against a friend sitting at the same keyboard as you. You must eat the grass on the opponents side of the screen, whilst pooing on your grass so it grows quicker. It's a resource game really. You need to make the trade of between blocking the other sheep, eating the other sheeps grass, and pooing on your grass. My Evil sheep picture for the intro. I think the sheep is possessed by satan. Maybe. Or maybe it's just angry all it's lambs have been taken to be eaten. Not sure why it's angry really. As you can see I didn't have time to draw any good looking sheep - so there's just stick figure sheep. Stick sheep that poo. You can download the source for python+pygame here. http://rene.f0o.com/~rene/stuff/bleten.tar.gz http://rene.f0o.com/~rene/stuff/bleten.zip Ludumdare is where people make games from scratch in 48 hours. A single person does all the artwork, code, sound and everything else in the game to a theme. It's what inspired pyweek except you can use what ever programming language you like, there are no teams - one person does everything - and it only takes a weekend, not a week.

    A Book “Beginning Game Development with Python and Pygame”

    Posted by illume
    Friday, October 12th, 2007
    I haven't read this book about making games with python and pygame yet, but I think it seems like a good one for beginners. The free chapter is fun to read. Which is the essence of making games I think. It should be entertaining to make a game, and to read about making games.

    This book looks like it covers most basics of programming a game - with python and pygame. Like it's title suggests it is for beginners, which is great.

    PyGPU - hardware graphics programming using the GPU and python.

    Posted by illume
    Friday, October 12th, 2007
    Have a look at PyGPU http://code.google.com/p/pygpu/

    With it you can code the GPU using python. It translates code from python into GLSL (the opengl shading language).

    It's amazing what type of algorithms you can quickly write using the GPU these days.

    There are papers describing it's implementation and other information here: http://www.cs.lth.se/home/Calle_Lejdfors/pygpu/ It takes a similar approach to psyco or pypy... in a way. But is different from both of these.

    Very cool.

    Girl start project teaching girls programming with pygame.

    Posted by illume
    Friday, October 5th, 2007
    I saw this on the pygame mailing list the other day about girlstart.org ...

    "... Project IT Girl, a program that teaches 60 high school girls in Austin, Texas, about how they can change the world through the use of technology. This year, Project IT Girls learn basic programming through designing and developing their own unique educational games written with Python and **Pygame**! ..."


    Looks like a cool project.

    Ya! A Galcon T shirt.

    Posted by illume
    Friday, October 5th, 2007
    After the Galcon T shirt design competition, Phil has decided to send me one of the winning designed shirts for helping out with testing.

    You can see some of the winning designs here: Galcon t shirts.

    Galcon is a multiplayer, and single player game kind of like risk, but with space ships. It's made with python + pygame by Phil Hassey.

    – Ninja out.

    Posted by illume
    Wednesday, September 5th, 2007

    All posts, images, and comments are owned by their creators.

    Galcon   Watermelons   Dynamite   The Hairy Chestival
    All content of imitation pickles (c) 1999-2007 - Phil Hassey  "we care"