Big Dice Games Presents: Woody Tigerbaum's Twisted Marble Factory

A Journal of Developing a Game in a Week for PyWeek5

Author: Dave LeCompte
Contact: pyweek at bigdicegames dot com

Contents

Saturday, September 1st, 2007. 9:00 AM

There are five candidate themes announced - I'm not entirely excited by any of them.

I have an idea I like for "Twisted", but it doesn't really fit the other themes very well. I've got an idea I'm lukewarm on that could fit "turmoil" or "ticking", but it relies on art ability that I don't really have. Another idea might work for "twinkle", or maybe for "Tyger, Tyger".

Saturday, September 1st, 2007. 12:30 PM

I've gone to the store to stock up on snack-ish foods. I've printed out a PDF of Ken Perlin's noise function (the "Improving Noise" one, which claims a 10% performance improvement and some other niceties).

My favorite game idea so far is the "tubes" design (which I'll describe later). I have come up with the following ways to tie it in to some of the themes

Saturday, September 1st, 2007. 5:00 PM : CONTEST STARTS

The theme is TWISTED!

I am totally stoked; that's the theme that gave me the idea I most wanted to work on.

Basic idea: balls are moving from the top of the screen to the bottom of the screen in tubes. You can twist the tubes (sort of like braiding). At the bottom of the screen, there are bins with labels (RED: 5 GREEN: 2) - your goal is to fill the tubs with the correct number of balls in the time allotted.

Saturday, September 1st, 2007. 6:37 PM : First Runnable

I sketched out a rough layout of the basic playfield. I put it into a basic OpenGL draw loop, and took a screenshot of the app. I wanted to upload it to the PyWeek website, but there's an error with the database, I guess.

ScreenShots/07-09-01-firstWindow.png

Saturday, September 1st, 2007. 9:00 PM : Feeling Sleepy

I made some sketchy drawings of tubes and balls. I've got some minimal code to show balls moving, as though through the tubes - the tubes don't animate - it'd be cool if they did. I grabbed this screenshot:

ScreenShots/07-09-01-ballsAndTubes.png

I need to reorganize the code substantially in the morning and rewrite much of what I've just written.

Some stuff to shoot for in the morning:

I'm hoping I can get all that done by noon - if so, I'll have "first playable" less than 24 hours into the contest.

Sunday, September 2n, 2007. 10:30 AM : Balls Following Tubes

Last night, around 11:30, I wrote some code to generate "candy cane" tube art. This morning, I rewrote a lot of the logic I was hacking together yesterday.

There's now a "board" class, which contains a lot of "logic pieces" (e.g. "straight tube" or "twisted tube"). The logic piece controls the movement of the balls, and handles the drawing of the balls. When a ball exits one logic piece, the piece reaches up to the board to find the neighbor logic piece, and hands the ball off to the neighbor.

Sunday, September 2nd, 2007. 7:00 PM : First Playable

After getting the balls to follow tubes, I took a break for lunch and brainstormed some additional "logic pieces", like:

After coming back from lunch, I implemented the pipe-twisting code, and was pleasantly surprised how enjoyable it is to push marbles around. I made some jokes in IRC about "losing my marbles" - certain configurations would allow marbles to disappear. I cleaned those bugs up, and moved on.

I googled "Wood Photoshop Tutorial" and found http://www.myjanee.com/tuts/wood/wood.htm which allowed me to make a passable pine texture. I proceeded to make a simple crate texture, which didn't satisfy the folks in IRC, so I took another pass at it. Lesson learned - the 2 minute version might be just barely functional, but the 10 minute version is well worth the investment of 8 minutes.

I went on to do the tedious work of create the shipping label textures. They don't look great right now - they definitely need a second pass, as per the lesson above.

I added in the logic to have the balls reduce the value of the crates requirements and the game was playable. I was surprised that at its simple level, the game's actually engaging to the point that I enjoy clicking and moving the balls around - I may not need to add in all the gadgets I came up with, above.

I made a ZIP of the game in this state, and people have suggested a few improvements:

I'm considering each of these - I definitely planned to have easier levels; the current game is perhaps a 7 or 8 on a difficulty scale from 1 to 10, which is a pretty nice spot to start tuning from - I can make the game a little harder to reach my "difficult" setting, and pull it back a lot for the tutorial and introductory levels.

Monday, September 3rd, 2007. 10:00 AM : Polish Begins

Some of the things I want to tackle, in no particular order:

Monday, September 3rd, 2007. 7:00 PM : Lazy Day

I didn't get much done today.

Some things I did work on, though:

Py2EXE seems like it's still causing the Skellington harness problems, so I ended up getting rid of the Skellington-enforced structure. Sorry, Richard.

Brass Rings: Per the feedback (above), I wanted to add additional gizmos to both sell the vaguely Victorian-era theme of the game, plus give the users a reference to know where to click. This ended up not being terribly hard to add in, and I think it works:

ScreenShots/07-09-03-02-transparent-pipes.png

Transparent Tubes: also in the above figure, you may be able to make out that the tubes are now made up of alternating stripes of 90% opacity and 0% opacity. (Contrast with earlier, which had 100% and 0%.) If you can't see it, it's all right - the effect is much stronger ingame, with the balls moving. I think this addresses the complaint that the balls aren't very visible in the tubes.

Music: I fiddled for far too long today inside FL Studio (which I first came to know as Fruity Loops). I came up with a piece of music that is kind of fun to listen to. Actually, I have two related pieces of music, one at 140bpm, which is my base music, and an additional piece at 150bpm that has some synthesized voices saying "twisted", "tubes", and "it is not a truck". (Thank you, Senator Stevens for inspiration!) I'll probably just alternate between the two pieces so that people can hear them both.

Cheat Button: I wanted to skip ahead to the end of the level, so I added in a button to drop a white ball in the first crate. This isn't much, but it helps.

Monday, September 3rd, 2007. 10:30 PM : Small Progress

Ok, I added in some logic to keep the balls from bunching up on the screen. The new behavior is that each board has a maximum number of balls on the screen at once, and won't try to launch a new ball until a calculated length of time has gone by and the balls are below the maximum (the combination spreads the balls out and doesn't cause an initial slam when the board is empty).

Also, the balls are drawn from a weighted probability pool. This allows for some customization of each board.

To recap what remains:

Colophon

This document was authored in ReStructured Text, and converted to more interesting forms using The DocUtils/ReST package.