Posts Tagged ‘processing’

tr-3012 postmortem

Posted by
Tuesday, April 24th, 2012 10:19 am

My entry tr-3012 is primarily a musical instrument, a drum machine with five independent looping triggers identified by robots.

This time around I did a lot better at removing code that wasn’t necessary and dropping ideas I wouldn’t have time for. I had all of these digitized robot voices recorded that my five year old loved but which didn’t really make the game any better.

One thing I regret not having time to implement was an introductory zoom from outer space into the playing grid, to make it look like the robots were isolated and adrift in space. That would have helped fit the theme better.

The tools I used:

Piccolo2D library for Processing
Beads library for Processing
Garage Band
TAL-Dub-2 audio unit plugin

I plan to add a few new features to tr-3012 later, to make it more useful as a musical instrument

– allow user-provided samples
– external MIDI sync, or at least set a tempo in BPM internally
– send MIDI and OSC events in place of/in addition to playing samples

Day 2.5 recap

Posted by (twitter: @Eliot_L)
Monday, April 23rd, 2012 4:06 am

The second day of the jam has been worse than I hoped, but better than I feared. I managed to tackle the performance issues we were having earlier by switching to the OpenGL renderer in Processing, which incidentally also fixed the huge memory leak.

So, here’s the first thing you’ll see when you load up the game:

Daniel created some really dope art today and I was happy to get it into the build along with some graphical effects like animated sprites and a scrolling background image.

Daniel’s friend Optomon also is writing us an awesome chiptune soundtrack. Here is the first part he sent over.

Here are some screenshots to show off what the game looks like now:

I ran into a ton of technical issues today but wound up working through them all. I finally finished defining all of the level geometry as arc segments, so you can run around the level and collide with the walls and ceiling too. I got basic bullets working, and they travel along an arc. The animation system was a doozie but it’s all working really nicely now. I learned more about OpenGL and it seems less daunting than before, and now I’m wishing I had more direct access to the OpenGL API from Processing!

Some things seem much easier and more efficient to implement in low-level OpenGL, such as my scrolling background. If I could have just accessed the texture directly and set GL_TEXTURE_WRAP_S to GL_REPEAT, it would have saved me a lot of trouble since I could have just animated the uv coordinates of the texture instead of having to move two images around. I spent nearly 3 hours trying to figure out how to set GL_REPEAT from within Processing before throwing my hands up.

It wasn’t a waste of time though, as I was able to apply what I learned to the animation system to flip a sprite horizontally by inverting the u coordinates and drawing them to a texture I defined manually in Processing. This saves on memory and disk footprint since I only need to load sprite assets facing one direction, and hopefully helps with performance as well.

Daniel and I both have work tomorrow, so we are going to have to submit the game as-is before the jam deadline. Right now there are no enemies and no win condition, but we plan to keep working on the game after Ludum Dare is over since the hard part (at least for me) is done. Now, on to the fun part, making it into an actual game!

We plan to submit this build before the jam deadline tomorrow evening, once we have some new music.

Day 1.5 recap

Posted by (twitter: @Eliot_L)
Sunday, April 22nd, 2012 5:04 am

We’re currently 35 hours in and have some decent progress to show. I got a full player movement and collision system working using arcs to define platforms and walls. You can now run and jump around the level, and the ‘camera’ follows you.

Here’s a screenshot of what the game looks like now, complete with debugging info on collision arcs and background tiles:

I figured out a workaround to the issue I posted about earlier thanks to the help of some twitter buddies. Thank you also to everyone in the LD community who chimed in. I am splitting arcs that cross the polar axis into two arcs, and everything works fine so far. You can see the seam of the axis, i.e. 0 degrees, and the arcs that cross it have been split in twain.

I thought you all might be interested to see how we made this level and translated it into code, so here is a screenshot of that process in action:

Daniel designed a level on paper using a compass, and scanned it in so he could paint it in Photoshop. He then sent me the image, which I measured using a handy screen protractor (which doesn’t have a setting to measure angles clockwise, WTF!) and entered into the giant blob of setup code that is our one and only level. I worked out a function that adds a ring segment based on its start and stop angles and ‘valence’, i.e. what level it’s on. It figures out the maximum and minimum radius of each arc segment based on the even spacing that Daniel set up in his design. So that has sped up the process quite a bit. You could say that without it, the process of making levels would be too protracted. Ba-dum psshhhh.

Now, for some technical rambling…

I’ve been having some pretty disheartening performance issues in Processing.  It’s a prototyping tool that excels at real-time procedural graphics – it doesn’t do so well when you expect it to be blitting bitmaps to the screen at 30 FPS. As soon as I threw in some background art, the framerate dropped significantly. I tried reducing the size of the art and scaling it up in-engine but the exact same issue persisted. In a hail-mary attempt, I rolled back from the Processing 2 beta to Processing 1.5.1 so I could try the now-deprecated P2D renderer. And what do you know, it performed way better than the Processing 2 2D renderer, Java2D!

Unfortunately, since the level is laid out in polar coordinates, it’s a pain in the ass to line up raster graphics since they are all rectangles. Also, my jam partner Daniel requested that we use raster graphics so he can paint them in Photoshop.

What this amounts to, for a 1024 x 768 game like ours, is a level that is 6144 x 6144. And we can’t build platforms out of standard square tiles since the entire level is curved. So we split the image up into 1024 x 1024 slices and tiled them in-engine in the hopes that we might save on performance somewhat, since I can cull tiles if they are out of the camera’s view. This doesn’t seem to be helping a ton.

Also, the image loading needs some tuning. I was loading everything at runtime but the load time for the game was awful that way. So I switched to asynchronous loading on an as-needed basis, but now I’ve created a thundering herd, each thread requesting a 1024×1024 image from disk at once! And there are 18 of these during launch to load the images at and around the player. I think I’ll need to throw these image load requests into some sort of prioritized queue so I can throttle them. I also need to make the game update steps independent of framerate.

So overall, perf is in pretty bad shape now, and I’m apprehensive about what things will be like once we start adding animated sprites for the player and enemies. Also, it appears as if the P2D renderer may have a really bad memory leak, my swap file grew to 8 GB when I was testing the game! Bleaahhh…

I’d like to learn openFrameworks for my next game, maybe I can optimize the rendering better. There remains the option of me trying to implement my own renderer on top of Processing’s P3D (OpenGL) renderer but god knows if that will help at all.

There’s a ton of stuff to do tomorrow. i.e. turn this movement/art prototype into a game!

Good luck, and rest well, fellow jammers!

Looking for advice on arc/point collision detection

Posted by (twitter: @Eliot_L)
Saturday, April 21st, 2012 11:29 pm

I’d appreciate some advice on whether my collison system can be salvaged or if I need to rewrite it.
My game is using polar coordinates and I am defining sections of arcs like so for the level geometry:

Right now I wrote checks to see if a point at polar coordinate (r, theta) is inside the region between the greater and lesser arc that makes up a solid object, like so:

class Arc {
  //Not a true arc, more of a segment of one or a "Block Arc", but it's much easier to type.
  float startAngle;
  float stopAngle;
  float maxRadius;
  float minRadius;
  boolean collidesWith(PolarCoord point) {
    return !( startAngle > point.t ||
              stopAngle < point.t ||
              minRadius > point.r ||
              maxRadius < point.r );

(Full class is here.)

It appears my math doesn’t work out for arcs on certain intervals. Previously I had encountered issues with this code not working when a radian was less than 0 or greater than 2*pi, so I wrapped my radians between 0 and 2*pi which fixed it. But I need to define some arcs that start around, say, the radian equivalent of ~270 degrees and end at ~45 degrees, making the shape of the letter C and crossing the 0 degrees mark. This kind of arc breaks my collision check above.

So I’m thinking, I can either fix my math for the check somehow, or abandon this method completely. Unfortunately I can’t find many resources on how to do this type of collision check properly. I couldn’t even find what these arc segment shapes are actually called.

In addition, I’m seeing occasional tunneling issues and would like to switch to doing an arc segment + line segment test for continuous collision instead of just an arc/point test.

The alternative I thought of was to define my arcs based on a vector at the center and an angle, and use the dot product to the player to do my collison checks, similar to the FOV check described here.

But it will take time to do that and I’d rather salvage this code if possible. If anyone has any advice, please let me know.

Off to a good start

Posted by (twitter: @Eliot_L)
Saturday, April 21st, 2012 1:49 am

My first Ludum Dare Compo was the previous one, LD #22. I had a good time and I learned a ton, and have used what I learned to make several physics-based games in Processing for various jams afterwards. However, I felt that my LD22 game suffered due to my poor art skills, so I decided I wanted to team up for the jam this time with a talented artist, for maximum awesome.

I’m working on a jam entry for LD #23 with my friend Daniel. He had an idea for a metroidvania where you traverse a rather small planetoid, where the curvature is actually visible.

We’re cutting the metroidvania part and trying to make a 2d action platformer set on a very small planet. The idea is that everything conforms to the planet’s curves, even your shots.

Here are some concept sketches of the planet and possible level designs that Daniel drew, along with some of my own drawings explaining how I will set up the collision volumes (using 2D arcs) and orient sprites.

I was pleased with how much progress I made on coding tonight, especially since I have never written anything like this before. I am using a generic template I made for writing games in Processing that I am calling QEngine. I will be publishing this game on the TinyWorld branch of the QEngine git repo.

As you can see from this screenshot, I have set up a class to define an arc section in code, and draw it for debugging purposes. These will be used as collision volumes, and I will draw a sprite in the same location. I couldn’t find what the real name of this sort of shape is, it’s a sort of wide arc, or arc with a circle segment removed from it. Microsoft calls them “block arcs” in their software but I couldn’t find any references to that being a widely used term.

I vaguely remembered reading about polar coordinates, and after looking them up again concluded that they would be a perfect way to store the position of objects in this game. It should be simple to move the player around and test for collision with arc segments if everything is stored in polar coordinates. And I even found some easy trig to convert to cartesian coordinates when needed (i.e. for drawing.) Here’s a screenshot of collision in action – the player (the white dot) is inside the upper left arc segment, which is why it’s red:

To move the player, I just add or subtract from his radial coordinate (vertical position) or angular coordinate (horizontal position). I love that math is providing such an elegant solution to what I thought might be  a pretty hairy problem! It’s times like this I’m glad I’m writing the game mostly from scratch in Processing since I have the flexibility to do stuff like this with ease.

There is one bug that I know of currently, I’m not accounting for the fact that there are multiple representations of a single angle in radians, so if you rotate the player past 360 degrees, the collision basically stops working. But I think this should be fixable if I can find a function to normalize the angle or whatever, if not I can always force it to wrap around with some custom logic.

Yay math! Yay game jams!

Here’s a hopeful sign-off for a productive day tomorrow. Good luck everyone!

Toukaerb (warmup game)

Posted by (twitter: @eelfroth)
Sunday, March 18th, 2012 10:27 pm


I made this fairly simple game to familiarize myself with the new environment I’m using. It is a more constructive interpretation of classic Breakout: instead of destroying blocks, you create them. See how many blocks you can make before losing your ball or getting it stuck.
But there’s an alternative way of playing this: try to get the ball stuck deliberately, using as few blocks as possible.

It’s not doodle-based in any way, bit I’m submiting anyways. Maybe, on a more abstract level, you could consider the game itself a doodle… ah, nevermind.

Controls: mouse or arrow keys. Space or mousebutton resets.

Play it in your browser (source included)

A form of monotheism – postmortem

Posted by (twitter: @secret_tomato)
Sunday, January 8th, 2012 7:38 am

Having been away and sick I didn’t get a chance to write this, but I’ll do so now(with a little over 24 hours to spare)

Let’s get started then. Not with the beginning, that’s what is expected, let’s go for a random order.

“A form of monotheism” a silly name, thought of in the last 30 minutes as a better-than-nothing name. It surprisingly works and fits the mechanics of the game. You’re an exterior force with equal control over everything in the game world. You can chose sides, be impartial, have some work for the benefit of others and so on.

The original idea was to have the player be some fellow that clones himself amd tweaks said clones to accomplish some end (repopulate the planet, fight off aliens/ zombies/ in-laws) but someone already  had that idea. Can’t remember who.

The second idea was to make a platformer and beat the theme into it with a stick. Since I forgot to make a platformer framework before the compo, I decided that’d take too long so I dropped it.

Back to square 1.

I wanted the player to start with one individual, and have the ability to spawn more and breed a populaton.  That took too long, so I ended up spawning a whole bunch right from the start.

Species and similarity

What you’ll notice is that creatures are divided into specias: humins, cats, rats, and llamas (the llamas were supposed to be centaurs but I gave up on that) . Each individual also has an empathy-o-meter/ similarity-rating, the color under them. The more you interact with an individual the more that changes. New creatures get one based on their parents.

Breeding and killing

Creatures of different genders and the same species will produce an offspring if they are similar enough AND one or both of them are assigned as breeders. This is mostly to avoid population floods encountered in early testing.

You might wonder why breeding and killing are in the same subcategory. Because they both depend on similarity. If two creatures are too dissimilar they’ll want each other dead(regardless of species). If you keep a similar population confined and breeding you’ll notice that eventually they’ll start killing each other to keep ‘strange’ ones away. Much like history isn’t it?

Social commentary much?

Yes. The only time when you can be sure things won’t be killing each other is when there is only one left. Hence alone. After I finished the game I was left disgusted. I unwillingly made a game about racist intolerant cartoony critters that strip the land of resources and kill eachother because the color under their feet is different. You know: like real people. The relative accuracy of my ‘simulation’ was even confirmed by someone who actually bothered studying these things.


The good is working with processing and making html5. A lot easier than I thought.

The bad was not getting to add sound effects, which I knew how to do, and making a cheap hack to loop music. Uneven distribution of resources and a lot of other gameplay and balance tweaks.

The achievements: The end game, when you have a single individual left, a single species left, or one individual of each species. A total of 7. I don’t think anybody got any.


Want to give it a try? knock yourself out:

Actually I have something to send… :D

Posted by (twitter: @RawBits)
Sunday, December 18th, 2011 8:11 pm


In the middle of the bad things I’ve been through the weekend. I decided to keep my game simple and tought that I could make a game out of my work. I’m alone at the night every thay and keep telling Windows that he should work becouse he used to. But I have leaved out the programming and stuff like that and added the fun parts and some problems to solve and watch out for.

Basically you sit in front of the monitor and try to find a way out of randomly generated 2D mazes to get score. But you have 4 stats – awakeness, stress, hydatation and bladder – as well to watch out for. If they reach their limit than you loose – fall a sleep, going mad, get dehydratated or be in shame at work place. These stats can be easily controlled with a mouse click. You can make coffee to drink to stay awake or water to get hydrated and you can go to the toilet.

The problem is their effect on eachother. Becouse if stress go high, then you are getting tired quicker and start to see hallucinations that couse more stress. Bladder goes up from water and coffee too, but you need to drink to reduce stress and to avoid dehydratation. And while you can make more coffe, you can’t replenish the water resource.

Hallucinations are coming when you are doing your job, but gets more intensive when you go alone to the toilet or the make coffee. So watch out. The ghosts are building up your stress…


The game made entirely in Processing becouse I needed to learn it. So This was my first time I’ve wrote a line of code in it. Sadly other things have gotten in my way, so the game is about half finished. It need some features and some graphics. There isn’t even support in the code for sound – I’ll add it tough. But the main engine is working pretty well.

This concludes to myself that I’m f***ing awesome and have to work hard on things like game making. Instead of the DAQ programs for foundries and the likes…


Anyway have fun with it. The source is up with the release. Feel free to use it. To play the game, click on the first screen, use wasd to move in the mazes and try to go out at the bottom as many of then as you can. Click on the coffee or the water to drink. If you run out of coffee, then click on it once more to get another one. (This minigame isn’t working yet!) To go to the toilet, click on the Bladder stat. (This is a similar minigame and it’s in the state like the other with the coffee…) There are no scores, but I wanted to do it like “how many mazes in wath amount of time, but maybe there are more possibilities than this. I’ll consider them too.


Here is the entry: Try it out!

I can’t wait to know if I’m in…

Posted by (twitter: @RawBits)
Wednesday, December 14th, 2011 6:36 am

Hi LD#22!

Tonight maybe I can talk to my boss and get to know if I’m in this round or not. My work here at the university is done from my part and if my boss say that I don’t need to be here next week, then I can tell my fater to help me move back home on friday or saturday. So I can make something in the short amound of time I’ll have.


BattleToys for time critical developing:

Gimp, sfxr, Processing and if it’ll have sound, than some freeware tracker.


Oh brother I can’t wait for my boss… XD

Looking forward to LD#22

Posted by
Saturday, December 3rd, 2011 10:54 pm

Looking forward to LD#22. Day job release date of Dec 2nd was missed and moved to Dec 19th, so it will be fun to have more than one thing to stress about that weekend.


Personal FOSS libraries (Piccolo2D,, various Processing libraries)

Getting data out of unsigned applets

Posted by (twitter: @secret_tomato)
Saturday, August 27th, 2011 12:38 pm

After finishing my game I noticed that I had plenty of spare hours left so I decided to add a scoreboard. Unfortunately that meant communicating with a web server, which to my knowledge meant I had to sign the thing.

Signing applets involves some console work, but most importantly it involves an annoying popup asking people to let the thing run. In my mind that’s nearly as bad as a installer and I didn’t want anything of the sort, besides I tried that on a previous project (which come to think of it was also a 48 hour game) and that resulted in people not playing it a all.

From some android work I’ve done I remembered I can call links to pages even if the app has no permissions(the browser handles the links), and I wasn’t too surprised when I found out that an unsigned applet can do the same.

Basically what I did was call


(processing function, no Idea if it’s the same in reglar java) where ‘asdfg’ was an encrypted version of the score.  This coupled with making each score unique prevented floods on the scoreboard.

The function spawns a popup window, and I’ve noticed that even if chrome blocks it, it still preloads the score page causing the score to go through. This may or may not be a security issue.

If anyone knows a better, or just different way to have an applet share its internal data I’d love to hear it.



Who else used Java or Processing?

Posted by (twitter: @StaticVoidGames)
Tuesday, August 23rd, 2011 7:29 pm

Hey all!

I can’t figure out a way to search the games by the technologies used to create them, and I’d love to see what else other people have created using the same languages as me.

It’s really inspiring to see the awesome things people can do, so if you used Java or Processing, I’d be really happy to take a look at your game!

Edit- Here’s a link to my game, available as an applet, web start, runnable jar, and OS-specific executables: Escape from Monster City

So,Here it Goes…

Posted by (twitter: @5310)
Thursday, August 18th, 2011 11:13 pm

Hullo, I’m Scio. Nice to meet you :bows:.

This is actually my third Ludum Dare, but so far I have been totally asocial and never even introduced myself, let alone post the games, of which there was only one that was even remotely playable. Don’t ask.

But motivated by the trivial coincidence of this being LD #21 and being 21 years old myself, I have finally braved an intro. I am quite proud of that.

Let’s see if I can make a game too; shouldn’t be too hard. No pressure…

I will be working with the following tools, depending on how far I manage to go of course:

  • The ever lovely LÖVE, if making a desktop game. This’ll mean lua.
  • The ever…scripty…Processing.js, if making a web game. This’ll make it sort of javascript, sort of Processing.
  • Inkscape, GIMP, and Mypaint for graphics.
  • Blender for CGI: I won’t be making a 3D game.
  • Sfxr (yay) for sound effects, and possibly Neil if daring to make music.
  • My snazzy, Compiz-y desktop running Ubuntu Lucid Lynx.
  • Certain other non-computational implements.

I will, almost certainly, not be able to make the competition deadlines, so I’ll focus on Jam instead. And I will try to come up with something fitting the winning theme, but if I can’t…I’ll just choose another one I like and roll with it >.>

As for participation: I will silently stalk the IRC, and try to visit the Hangouts if my connection holds. I don’t have enough bandwidth (or courage) to livestream my work, but I will set up gLapse which was thoughtfully made for this very occasion!

Furthermore, I promise not to get too nervous and go into zen-procrastination-mode like I usually do during rushes.


[Also: Did I go overboard with the tags?]

Looking forward to LD#21

Posted by
Wednesday, August 17th, 2011 8:49 pm

Looking forward to LD#21, though (as usual) I won’t have much time to spend this weekend, am going up north to the lake.

I was hoping Looping would win for the theme, now I’m leaning toward Immortality.


Personal FOSS libraries (Piccolo2D,, various Processing libraries)

Expression of interest

Posted by
Tuesday, December 14th, 2010 12:10 am

Finished LD14, started LD18 but didn’t finish, had work on that weekend.

This weekend is looking clear, except maybe a few breaks for Christmas shopping. I’ve been getting into Processing, so I’ll probably try using it this time. It’s super-quick to get things up and running so I find it very motivating. And it’s suitable for my new netbook, serious 3D seems to be out of the question.

Tools may include, sfxr, musagi, and anything else I need.

It’s been a fairly shitty year of professional game development for me, just need a politics-free creative weekend to get the love back.

Late non-entry: Compactor

Posted by (twitter: @OMGWTFGAMES)
Tuesday, April 21st, 2009 5:35 pm

This isn’t an official entry, since it’s way too late. You can see what I was trying to achieve and why I missed the deadline here and here. I thought I’d post what I’d made, just for fun. This is the product of about two laptop battery charges (~2.5 hours), and one hour to polish, fix the odd bug and package .. so in total it’s about a ~6 hour game made using The game takes 1 min to play, and I’d say most people will be able to beat it on their first or second try.

Chances are, everyone is far too busy judging the record number of on-time entries this year .. but if you are curious, you can see the details and play the game here.

[cache: storing page]