Game Programming at scriptedfun

Game Programming for Beginners: Video Tutorials, Source Code, and Articles

Subscribe via e-mail!

Enter your email address:

Delivered by FeedBurner

PyWeek 4

From the PyWeek website:

The next challenge is PyWeek 4, which will run in the first week of April.

Register NOW!

The PyWeek challenge:

  1. Invites entrants to write a game in one week from scratch either as an individual or in a team,
  2. Is intended to be challenging and fun,
  3. Will hopefully increase the public body of game tools, code and expertise,
  4. Will let a lot of people actually finish a game, and
  5. May inspire new projects (with ready made teams!)

Entries must be developed in Python during the challenge, and must incorporate some theme decided at the start of the challenge. See the challenge rules for more information.

I haven’t tried participating in one of these yet (I got as far as signing in and writing a very enthusiastic plan of action, but no code 😀 ), but I think I should give this a shot this April, and you should, too! I’m amazed at the output that this has generated so far – in a span of just one week, plenty of very good games have been written. The physics-based Nelly’s Rooftop Garden and the well-polished Trip on the Funny Boat are personal favorites – try downloading these games and see what can be done in just a week.

Making good art has always been my weakness – that’s why I rely so much on SpriteLib. Maybe I should consider using simple geometric objects and pygame.draw… 🙂

The 2nd Annual Toronto Indie Game Jam!

From the IGDA Toronto Chapter forums:

Greetings folks! This is the official announcement of TO Jam 2. This years event promises to be bigger, more exciting and prestigious than last year. We currently are able to confirm the following information about the event:

-Will be held in the downtown Toronto area
-Event will happen May 4,5,6
-Refer to the event website for the latest news and developments
-Refer to the discussion forums to talk about your ideas, look for team members and ask questions about the event

If you live in Toronto, then this is probably a good event for you to participate in. By participating in this kind of event, some pressure will be put on you, and the chances of actually coming up with something gets better – it’s good to start May 4 with the idea that you will have a “complete game” by May 6. Also, participating in events like this allows you to meet up with other game developers – the event itself is a natural venue for working on a game as a team.

To get you started, the TOJam organizers have made available some frameworks that you can use with the games. One may be used with Flash, the other with Pygame. Unfortunately, the Pygame framework isn’t available for download yet, but details about it may be found on a pygame-users message from last year.

Hopefully, our local IGDA chapter will organize something like this as well :).

Call For Proposals: AI Game Programming Wisdom 4


Once again Charles River Media and series editor Steve Rabin are looking for game developers to share their wisdom in the next brand new volume of the groundbreaking AI Game Programming Wisdom series. Anything that an AI game programmer would typically deal with is fair game, including pathfinding, AI architecture, animation control, scripting, learning, and various decision-making techniques. Selected authors will have several months to write and will share in a portion of the book’s royalties. Proposals for 8-20 page articles are now being accepted until March 31st.

For those of you who are in a position to contribute to this volume, here’s your chance :). I have a copy of the first book in this series, and I have to say that it is a very useful and impressive volume. It’s not the type of book that you would read from cover to cover. Instead you are presented with a series of focused articles that deal with cutting-edge game AI techniques. It’s more of an encyclopedia/cookbook than a textbook. Emphasis is on depth than on breadth, and this can prove to be very useful if you’re trying to solve a very specific problem that’s actually already covered in the book.

Maybe I’ll try to contribute in AI Wisdom 5. 😀 I’m particularly interested in the racing articles provided by the series, and I thought that the articles contained in AI Wisdom 1 are all top-notch. I find Euan Forrester’s Intelligent Steering Using PID Controllers (contained in AI Wisdom 2) article very interesting – probably, the information contained in this article will be especially relevant to today’s games, because game AI would have to be designed to consider the underlying physics engine. Unfortunately I don’t have a copy of AI Wisdom 2 YET. 😀 Hopefully, I’ll have access to this article soon and hopefully write a follow-up to it – I did some work with optimal control theory as an undergraduate and I’m thrilled at the possibility of applying it to (hopefully cutting-edge) game development!

Of course, if you find the above interesting as well, go ahead and write about it. 😀 I would love to read the result, and hopefully build upon that work eventually.

Be sure to read the guidelines before submitting your proposal. Now go work on those articles! There are royalties to be earned! 😉

Announcing the XNA Game Studio Express Update

From the XNA Team Blog:

In April of this year you’ll be able to download an update to XNA Game Studio Express, this release mainly focuses fixing your requests and issues that you’ve filed through the Microsoft Connect site(yes, we really do read and respond to your bugs and feedback as best we can).

A list of improvements for the release is given on the site. What I found most interesting are the items that he saved for last:

Developer sharing of packaged XNA Game Studio Express Games

  • Users can now package their binary games into a single file to share with other users of XNA Game Studio Express.
  • These files can be emailed or hosted on websites like any other files.
  • To run a game double click a file and it will unpack to your Windows based PC or Xbox 360 console, it’s that easy!

This is amazing, although you will need to shell out at least $49 for a Creators Club subscription that will allow you to take advantage of these. However, the compilers and the game libraries needed to develop the actual games are free to download, and there are plenty of training materials available as well. Developing for the PC is free, and seeing your game run on the XBox 360 costs less than a hundred dollars – just a few years ago, this was unheard of! It really is an exciting time to be a game developer 😀

Bullet Physics Contest 2007

Videos of the entries to the Bullet Physics Contest 2007 have been posted online. The participants were asked to build a Rube Goldberg device (like the ones in the game The Incredible Machine), and the winner will get a Sony PS3. A Nintendo Wii will also be given as a prize.

Interview With Adrian Crook, Relic Entertainment

GameProducer.Net had a chance to talk with Adrian Crook, game producer at Relic Entertainment. Relic has stunning games in their portfolio, for example: Homeworld, Company of Heroes and The Outfit.

In this interview, Adrian describes the work of a game producer, and even says that “the lack of a ‘typical’ day is probably what I like best about being a producer!” He shares that he got his start in the game industry at the QA department of EA Canada in 1995, and got work as a Producer a year later.

When asked about how someone can land a job in the game industry, Adrian responds:

I get asked this question all the time. You could go to a game school like Vancouver Film School, or work on a mod, or get a job in the production, QA or Balance departments of a developer or publisher. Or all of the above. Either way, you need to demonstrate a love of games and solid communication and organizational skills. Then you need to get noticed somehow… so taking any game industry job to start is a good thing. If you’re an awesome performer and vocal about your career goals, then you’ll likely end up where you want to be.

A whole lot more is discussed in the interview, so go read it! 😀

Unity To Enable Nintendo Wii Games

San Francisco – March 13, 2007 – We’re extremely proud to announce that later this year, Unity will support creating games for the amazing Nintendo Wii game console.

This is a very intriguing announcement. I’ve been a huge Mac fan since I was a kid, and I really thought that the Unity game development tool was a fantastic concept when I saw it. With this announcement, making games for the revolutionary Wii may become a possibility for a lot more people, hopefully for you and me.

With this, it becomes possible to make Wii games with Python! Well, sort of. Unity supports game scripting via the language Boo, which uses a Python-inspired syntax. With this feature, it should be easier for Pythonistas to learn how to use Unity.

Currently, Unity is a Mac-only tool, but supports deployment on Windows and Mac. Eventually, I hope to own my own Mac and a copy of Unity. All I have to do now is look for $2700 to spend…

Particle Invaders update 1

I thought of changing some lines in the Particle Invaders code to make the particles emitted by the shots and the bombs more interesting. Go ahead and grab the source. You can try running the previous version and the current one to see the difference.

If you’re looking for an exercise, maybe you can try modifying the previous version’s code to match the behavior of the current version without looking at the new code? 🙂

Intel® Game Demo Contest 2007

Intel® Game Demo Contest 2007
Show us Your Game!
Win great exposure and your share of over $95,000 worth of Prizes, including:

  • Meetings with game company executives — for a possible bundling deal
  • A Gateway gaming machine worth at least $3,000
  • $5,000 in custom art for your demo
  • A Giga pass to the Game Developers Conference 2008
  • Copies of Garage Games’ Torque Engine Advanced and other content prizes
  • An International Game Developers Association membership
  • A full suite of Intel® Software Development Products
  • and of course, loads of cash.

If I find extra time on my hands, I’m really considering joining this contest. I think that this is a great opportunity – and the prizes are really attractive :).

More importantly, by joining this contest, there’s a need to follow the set deadline – executables must be in by August 15. Having a clear deadline helps in setting concrete dates for milestones, etc.

Regarding the chance of winning, Intel has given a very encouraging words on this:

The chances are good! AAA developers often have exclusive deals for distribution of their game demos, or they have an existing technology relationship with Intel which would disqualify them from the contest. We expect that the vast majority of our entries will be from small developers and student groups.

Intel also hosted a similar contest last year, and the 2006 winners page should give everyone a good idea of what constitutes a winning entry.

There’s a special mention of GaragegamesTorque Game Builder and Torque Game Engine products. Fortunately, I won indie licenses to these products some time ago, and hopefully they’ll be put to good use in this competition.

I’ll see all of you at the competition! And hopefully, I’ll see myself as well! 🙂

Thousand Parsec Participating in Google Summer of Code


Thousand Parsec is a vibrant free and open source project, creating a framework for 4X (eXplore, eXpand, eXploit and eXterminate) space strategy games. We are happy to announce that this year we are also participating in Google Summer of Code as a mentoring organisation. We have prepared a special page with information and ideas for students, who would like to work on a task for Thousand Parsec. Join us, it will be fun, you’ll gain a new experience, learn something new, play games and if you finish successfully you can even get 4500$. The deadline for submissions of student applications is 24th of March.

For those of you who are eligible to participate in Google Summer of Code, this seems to be an interesting project to participate in. Aside from the possibility of earning money, you will actually get to work on a large project with other people – a big step from the simple examples that we have considered in this site so far. If you plan to join the game industry anytime in the future, this is you chance to gain experience.

Another fact that caught my attention is this project’s extensive use of Python. If you’ve been to this site before, then you’re probably already familiar with Python. If not, I encourage you to look into it – I think that it’s a great language to work with, and if you’re already familiar with programming, it should only take you less than a weekend to pick it up.

Some of the Python-related tasks listed on the site include:

Several of the tasks call for “Good Python Skills”. If you’re looking for a project to work on, I suggest that you give this a look.

And yes, there are several C++ – related jobs as well 🙂

Particle Effects for Games

I would like to apologize for not being able to post in a very long time. The schoolyear’s about to end here in Manila, and there is still a lot of work that needs to be done.

I needed a break, so I came up with this very simple demo of particle effects for Pygame, which I suspect might be useful to game programmers in general, particularly those who use SDL.
Particle Invaders screenshot
For those of you looking for a distraction, this demo was implemented as a “Space Invaders“-type gamelet, with PLENTY of room for improvement :). As always, the graphics were taken from Ari Feldman’s very useful SpriteLib. Grab the source now!

To implement the particle effects, I implemented a Particle class that needs to be given the following information:

  1. initial position (x and y)
  2. initial velocity (x and y)
  3. acceleration (x and y)
  4. particle size
  5. “color structure”

Numbers 1 through 4 are self-explanatory. The particle is drawn as a square with the given side length, then it is placed on screen at the initial position. Then, at every frame, its position is changed by the amount prescribed by the velocity. At each frame also, the velocity is changed by the amount prescribed by the acceleration. By tweaking the velocity and acceleration, together with the use of random numbers, it’s possible to come up with interesting movements for the particles. If you want to make things more interesting, you can experiment with nonconstant acceleration by defining acceleration as a function of time.

But we all know that particle effects are primarily used for eye candy, and can produce spectacular results by playing with the colors. This is where the “color structure” comes in. Basically, the “color structure” is a list of tuples of the form:

(initial rgb, final rgb, duration)

The purpose of this structure is to set the initial color of the particle, then smoothly change the color to the final color over the number of frames set by the duration.

Since “color structure” is not just a single tuple, but a list of tuples, it is possible to chain together a sequence of color transitions in order to make more sophisticated effects. For instance, the explosions from the enemies are actually a combination of two color transitions: random color to white for 20 frames, then white to black for 10 frames.

The particles emitted by the shots from the player simply change color from a random shade of orange to black. You might find the particles emitted by the bombs interesting: the particles change from either orange or red, then go to black – this results in an interesting “fire-like” effect.

This is a VERY simple particle engine, only meant to show the basics. Feel free to experiment with the code, and if you come up with an interesting particle effect or an interesting modification to the code, I’d really appreciate it if you could share it with everyone :).

Perhaps there are other topics which you would like covered in this site? Feel free to send me an e-mail or leave a comment :). Thank you and I hope you find this useful!