April 20th-23rd 2012 :: 10 Year Anniversary! :: Theme: Tiny World

Back to Browse Entries

Battle For 35 Leukothea

by Rectifier - 48 Hour Compo Entry

Should work in Windows, Mac OS X, and Linux!
Mac and Linux users should install Pygame first.

I made an ASCII tower defense game, set upon a small asteroid.

An asteroid that, thanks to you, is becoming not so small.

It went well! I used Python and the Pytality console library that I made after Pyweek, which until now had not been put to the test of an LD48. And it worked really well.

The game came together much more rapidly than I'd expected, and seems pretty stable. The towers ought to be reasonably balanced between each other.

30 waves, three difficulties.

If you beat Hard difficulty, leave a comment! I'd like to know just how evil it is.

The game will try to run in either Pygame or native Windows console. If one of them fails, try the other - you can pass "pygame" or "winconsole" to it as a command-line argument to switch.

NOTE: If the windows .exe crashes immediately on load, please try the Python source link!

Arrow Keys: Scroll the map.
All other hotkeys are highlighted as [KEY] in-game.

Downloads and Links




Cosmologicon says ...
Apr 24, 2012 @ 3:08am

Ah cool, I remember your Pyweek game that used this library. You're really showing its versatility. If someone told me that they were making a tower defense without graphics or mouse control, I would say they're crazy, but you seem to have pulled it off. :)

Rectifier says ...
Apr 24, 2012 @ 6:57am

Heh, thanks!

My Pyweek game was my second foray into the land of the text console. I used the lessons from that to make this library, with the goal of it being as unobtrusive as possible during a compo. I think it succeeded - I only had to make a few small patches to it during the competition..

A little more polish and it'll be something I can actually recommend to others to use, I think!

dansludumdare says ...
Apr 24, 2012 @ 7:31am

I didn't realize I was supposed to protect the red p as well until I started losing life. Actually, I wasn't sure that I was supposed to protect the blue p either. And I thought there were 4 red ps -- didn't realize the world wrapped.

At one point I held down the arrow keys and ended up having to wait for a bit for the thing to finish handling all the arrow key events. I don't know what freedom PyGame gives you, but something like turning off key repeat or flushing events after refreshing the screen would suffice.

If it weren't a Ludum Dare game I'd say the enemies should be more varied -- 30 waves of the same dudes (as far as I could tell) gets repetitive. I ended up using basic towers the whole time. (I played on easy -- don't know if that makes a difference).

Love the ASCII.

triplefox says ...
Apr 24, 2012 @ 8:18am

It's nicely done. It slows down mightily in the later levels, and medium felt too easy to cheese through after the first few waves(once I could afford it I just built sniper towers and never upgraded).

I'm not sure it works as a straight TD - maybe there's another way to make expandy-shrinky-world a good puzzle or source of strategy.

Rectifier says ...
Apr 24, 2012 @ 6:37pm


There are three different kinds of wave, with different accent-symbols and colors, but once on the ground they're basically the same unit. They appear every three levels, and the difference between them is magnified on higher difficulties.

Swarm waves spawn a lot more enemies spread out over the map, but with lower HP.

Cluster waves spawn more enemies grouped tightly together, with higher HP.

The Pygame version probably has some performance issues, yeah. Emulating a console is hard! I initially supported the native *nix console with this library, but a multitude of problems eventually scrapped that for pygame-or-windows only.

My original plan was to have the poles gradually shift as the world grew, making tower placement trickier. But I scrapped that as it made the balance crazy and wasn't trivial to implement.

davidpeter says ...
Apr 25, 2012 @ 6:30am

Aw, couldn't play this! I'm on Mac OS X 10.6 with Python 2.6. I keep getting mem leak warnings:

2012-04-24 23:29:04.623 Python[48133:9537] *** __NSAutoreleaseNoPool(): Object 0x102164740 of class NSWindowGraphicsContext autoreleased with no pool in place - just leaking

Rectifier says ...
Apr 25, 2012 @ 6:33am


Huh! I've never seen that before, although admittedly I haven't tried OS X. It's pretty standard usage of Pygame. Do you get that error with other pygame entries?

Gabriel says ...
Apr 25, 2012 @ 12:51pm

Cool game! I like TD games and enjoyed the 'world growth' twist! But even though I'm not the type of player who goes for graphics, ASCII is a little too hardcore even for me... A little too difficult to tell things apart, and also the arrow movement gets a little clumsy (the shortcuts were a nice touch to compensate the tech limitation, though). Overall, pretty fun and a very good entry, I'm rating you well! And man, you did manage to make a functional and fun Tower Defense game in ASCII - maybe that's the first time someone does that? :D

davidpeter says ...
Apr 26, 2012 @ 4:10am

Rectifier: Nope, my friend entered with Pygame too and I ran his fine. Then again, he developed on OS X too. That's weird.

tjhei says ...
Apr 26, 2012 @ 1:54pm

running "python run_game.py" under ubuntu 11.10 gives: raise Exception("Your window is x=%s, y=%s. Minimum required size is x=%s, y=%s" % (x, y, width, height))
Exception: Your window is x=228, y=68. Minimum required size is x=101, y=71

johnfn says ...
Apr 27, 2012 @ 6:34am

Whoa, making a text-based TD is massively impressive! The fact that the asteroid expands is a neat twist too.

My nit-picks: The two separate bases to defend makes me feel constantly off balance - I improve one, then another, etc. Also, I'd like some maps more conducive to making mazes, as that was always my favorite part of TDs.

But those are nits. This is too cool.

Rectifier says ...
Apr 27, 2012 @ 9:13pm

You're on Linux and trying to use the native terminal, which can't resize your window for you. And your window isn't tall enough.

Either make your window tall enough, as it says, but watch out for terminal graphics problems (there's a /lot/ of them in most of the popular terminal emulators, I tested this during pyweek) - Or, as I would recommend, install pygame and use that version. It'll be correct to the pixel.

Thanks! I generally prefer mazing TDs too, but then I'd have to make sure my pathfinding can handle whatever crafty players throw at it, and that sounded far too hard for an LD48.

tcstyle says ...
Apr 28, 2012 @ 6:41pm

This game feels so oldschool and reminds me of my old quickbasic development days.
The ascii look and keyboard control works surprisingly well. The path of the enemies felt quiet random so it took three waves until my towers got something to shoot at.

How did you put all the stuff into one exe file?

Rectifier says ...
Apr 28, 2012 @ 8:23pm

You can see my py2exe configuration at https://gist.github.com/2521749 , but note that it only works well if you don't need any non-python libraries. I haven't figured out how to get an exe like that to work when Pygame is involved.

quickfingers says ...
Apr 28, 2012 @ 8:49pm

mac only here

Rectifier says ...
Apr 28, 2012 @ 8:53pm

It'll run on Mac if you have Python and Pygame!

Shadow says ...
Apr 28, 2012 @ 9:14pm

Well polished game. A bit too hardcore on the approach to the theme I guess. Loved the ASCII graphics.

jwolf says ...
Apr 28, 2012 @ 9:37pm

Neat entry! It could use a hotkey or something to switch between pol...wait, your screenshot has something...my screen isn't tall enough, apparently.

Didn't even notice the scrollbar until now. Kudos that you stuck that in, though. Many entries don't seem to have something to help resolve those issues.

R3ason says ...
Apr 30, 2012 @ 4:45am

Ah, great, fun little tower defense game! Was a bit skeptical at first, but I turned out to be wrong: ascii really works here! Controls felt really great, and I was never at a loss as to how everything in the game worked. Great job! Thanks!

Jezzamon says ...
Apr 30, 2012 @ 7:20am

Hm... I tried to run this on my mac, and got this error:

Traceback (most recent call last):
File "/Users/MYNAME/Downloads/ld23/run_game.py", line 4, in <module>
File "/Users/MYNAME/Downloads/ld23/gamelib/main.py", line 16, in main
pytality.term.init(width=screen_width, height=screen_height)
File "/Users/MYNAME/Downloads/ld23/pytality/term.py", line 117, in init
resize(config['width'], config['height'])
File "/Users/MYNAME/Downloads/ld23/pytality/term.py", line 145, in resize
impl.resize(width, height)
File "/Users/MYNAME/Downloads/ld23/pytality/term_curses.py", line 84, in resize
raise Exception("Your window is x=%s, y=%s. Minimum required size is x=%s, y=%s" % (x, y, width, height))
Exception: Your window is x=80, y=24. Minimum required size is x=101, y=71

Turns out I have a program called "Build Applet" which looks like it turns python program into Mac applications, so if you manage to figure out what was going on or anything maybe I could try and turn it into an application for you? I really don't know anything about python, so it might not work, or maybe it's really easy to turn something into an application, but whatever.

kratorspore says ...
Apr 30, 2012 @ 7:23am

Impressive work. Great ASCII graphics and gameplay

masterhyjinx says ...
Apr 30, 2012 @ 8:53am

Interesting presentation and ascii graphics. I wasn't clear on what the representation of the terrain means. I'm not a fan of these types of representations but it is definitely cool in that retro way.

Rectifier says ...
Apr 30, 2012 @ 4:50pm

Says right there in the text. On Linux/Mac, using the normal ansi console, the program is unable to resize your terminal for you. And yours is 80x24 and it needs 101x71.

That said, I highly recommend installing Pygame and letting it use that instead. You won't have this issue, and while I haven't been able to test the OS X terminal emulator, the Linux ones have a lot of rendering bugs when pushed this far.

The terrain types have a minor movement cost, but don't have much effect. The biggest reason for it was because a blank screen was totally confusing with the wraparound world.

Andrew says ...
Apr 30, 2012 @ 7:43pm

My win console was a wee bit too narrow to play properly but I appreciate the idea.

Rectifier says ...
Apr 30, 2012 @ 11:03pm

too...narrow? Looking at my screenshot, it's 800px wide. What resolution are you using? 800x600?

At 900px tall, it's admittedly a little less friendly there, but at least the things on the bottom aren't terribly important.

demonpants says ...
May 1, 2012 @ 6:12pm

Trying on Mac OS X: "Exception: Your window is x=262, y=60. Minimum required size is x=101, y=71" I made the Terminal window as big as possible and I have a large monitor. Why would the Terminal size matter?

May 1, 2012 @ 6:16pm

It IS really hard (even on easy!), but I was quite impressed. But: It doesn't fit the theme at all and there is no music and no sound. The graphics are great in their own way, the game is fun and innovative. Overall, I really liked the game, even if I only was able to play on easy ^_^

iximeow says ...
May 1, 2012 @ 6:34pm

That was unexpectedly cool. It was pretty cool to realize that the world wraps around and there's just two poles, rather than four (or more, I was freaking out about what to defend at first)

My only complaint is that it buffers key events and tries processing them even after I let up on the key. The screen moving with my hand off the keyboard was odd.

eli says ...
May 12, 2012 @ 8:29am

Had me hooked for a while! Not big on tower defense, but this was interesting and new. The changing world size and way it wrapped on screen got me. Also much easier to control than I would have thought. I'm glad you didn't list the possible keystrokes in the description, otherwise it would have discouraged me from playing.

Technically: had some resolution problems on my 1366x768 laptop monitor (game didn't fit heightwise). Luckily I was able to play because it scrolled and I didn't need the bottom part too much.

You must sign in to comment.

[cache: storing page]