Tuesday, August 31, 2010

Ludum Dare 18 and PyWeek 11

Well, Ludum Dare 18 and PyWeek 11 both went down last week. That's a great deal of speed development! I attempted to participate in Ludum Dare, as it was over the weekend, and I thought maybe I'd try something small for PyWeek despite the fact that the development window is much larger. Of course, things didn't go as planned.

Everything started out reasonably well on Friday night. I saw the theme - Enemies as weapons - and brainstormed. I sat on the floor with my toddler and drew up some prototypes in crayon on his very large drawing pad. Being a huge fan of strategy RPGs, my mind jumped straight to Disgaea. So my first prototype was simply a strategy RPG where you don't have any weapons, but you can pick up your enemies and smack other enemies with them. The enemies, I thought, could have a rock-paper-scissors-like relationship. But alas, I figured it would take too much time, and I'm not sure how enjoyable it would be.

Brainstorming with the whole family!

My second idea came from the lament of one of my fellow participants. He said the theme dictated the necessity of enemies, severely restricting the type of game that could be made. So I started to think of ways to make a game without enemies in the traditional sense. It occurred to me that enemies don't necessarily have to be biological, or even physical. A claustrophobic person (my first thought since claustrophobia was a finalist theme), for example, would see tight, enclosed spaces as an enemy. From there I figured that I could consider various afflictions as enemies, and think of ways to use them as weapons. Weaknesses and strengths, in effect. So developed my idea: a puzzle game where the player would guide four characters to the goal. One character was red-green colorblind, another was yellow-blue colorblind, one was anorexic, and the last was obese. The first two could pass through obstacles or activate switches corresponding to their colorblindness, while the light character could do things like pass over thin ice, and the heavy character could do things like depress stuck switches.

The idea seems kind of contrived looking back, but I ran with it. I managed to get a few hundred lines of Python and Pygame code in and a bit of rudimentary art, but alas, it was not to be. Turns out having a toddler and an infant to take care of is pretty time consuming. I think next time I will choose a much simpler game idea just to get something out there. The puzzle game would've taken all my time just to get a playable first level, and I'd have had to wait until afterwards to add more. It certainly didn't help that I was learning Pygame along the way, and I hadn't actually made a game for years. So it was really nice getting some practice in. My PyWeek project never really got off the ground, as my toddler got sick (double ear infection - ugh) and then I got sick. Oh well. I'm not too attached to my Ludum Dare game idea so I won't finish it, but I do look forward to getting back to work on those game ideas that have been kicking around in my head for ages.

Friday, August 27, 2010

Getting started with C++ game development

There is considerable debate among indie game developers about whether C++ is ideal for beginner game development. There are quirks to using C++ that make it more difficult for the beginner to learn to program, issues related to compilation, syntax, and style. However, it remains an extremely popular choice due to the amount of libraries and support available.

If you're just starting out in programming and you've chosen to use C++, then you almost certainly need a book, and preferably even a class if you aren't particularly self-disciplined. For an introduction to C++, I'm not sure you can top the most recent book by the man himself, Bjarne Stroustrup, the creator of C++:
Programming: Principles and Practice Using C++

Alternatively, if you already know how to program and want to get acquainted with C++, then the following book is always highly recommended:
Accelerated C++: Practical Programming by Example

You aren't exactly required to be an expert in C++ before you begin developing games, but generally the more you know, the better. Some very useful libraries may be beyond your comprehension, and you'll end up reinventing the wheel several times over -- usually very poorly. Speaking of libraries, let's move on to those. To get started with PC game development, there aren't any better places to start than SDL, the cross-platform library that can handle graphics, sound, networking; if it's useful for game development, SDL (and family) can do it. One developer that goes by the name lazyfoo has developed an extensive set of tutorials on setting up and using SDL. I can't recommend these enough:
Lazyfoo tutorials

He hasn't added any new ones for a long time, but he does keep them up to date. Also be sure to check out his articles for additional info. The alternatives for SDL include SFML and Allegro. SFML is newer, and while it is not as mature, it is gaining popularity among those who heavily prefer object-oriented programming. Allegro, like SDL, is mature and has an active community of users. One point to consider is that its use is largely focused on games, whereas SDL is commonly used for all sorts of applications.

That should be enough to get anyone started with 2D game development. Displaying a bunch of images on screen and getting them to move how you want is quite literally all the technology involved in just about every 2D game there is. Future posts will go more in depth, show off some code, and delve into 3D programming as well. Best of luck to you!

Obligatory Welcome Post

Hello fellow hobby game developers!

This is your friendly, neighborhood welcome post on a new blog that will hopefully have some useful content at some point. We shall see about that though. For the record, at my day job I frequently use C++, with the occasional Python and Bash. In my spare time I've written a few PSP games in Lua and less than that in C, and on the PC side a few toy games and applications in C++ and Python. Nothing major so far.

I frequent gamedev.net, and here I hope to post my thoughts, comments, and impressions on various indie game development news, events, and competitions and the indie game scene in general. Wish me luck!