For me to read code and learn, not to play...

...of course ;-)

+41  A: 

Battle for Wesnoth

That said, you can devote some time reading

It also depends what exactly do you want to learn... For instance there is an annual competition for games written in Pygame

Vinko Vrsalovic
+18  A: 

Robocode is pretty awesome. See also its entry at Wikipedia.


Do unintentional source releases count? If so, Half-Life 2 and EVE (though it was only the client code)

Chris Porter
No, because they are not open-source
More precisely: they are illegal (to obtain and own).
+29  A: 

How about FreeCiv?

Thomas Owens
(Freeciv == awsomeness)
One problem I have with FreeCiv is it doesn't run smoothly on older hardware. Otherwise I love it.
Brad Gilbert
I've got a really really old original Pentium running BSD that I run Freeciv on, it runs fine, except for the graphics in the client, the window is too large to fit on my older resolution monitor. So, i can't see the tabs on the bottom.
Try the trident tileset for older computers. Should work fine.
+64  A: 

Quake (1,2 and 3) and DukeNukem 3D source code is available under the GPL.

Michał Piaskowski
Although originally commercial, the fact that these games are now released under the GPL make them the best open source games. Ever. You can't compete with Quake. You can't compete with what it means.
Vicent Marti
Just a quick "legalese" comment: the source code of the "game engines" for these games is open source now. The graphics, maps, characters, story, etc. are still proprietary copyrighted items. If you want to play them, you have to either use the files provided with the shareware version or buy it :(
Joe Pineda
Agreed, but for learning games programming, these sources are invaluable!
Gary Willoughby
Another thing you can learn from these is historic, how they managed to get it to work on the hardware of the day.
Brad Gilbert
Although being good games this doesn't mean the code is readable and good to play with.It's also heavily optimized, that will bring you some headaches in understanding the real inner workings.Anyway, if you like the procedural approach in games you'll be pretty much satisfied with it.
Agreed, can't beat quake.Try OpenArena for a fully free package, and ioquake3 for a somewhat modernized version
definitely Quakes and Duke Nukem, but for full open source there's always open arena :)
+2  A: 
+58  A: 

If part of the reason for open-source code is for code to be reused and recycled as it evolves, then I think influence and legacy would be two large factors in this decision. On this basis, I would probably vote Rogue / Hack / Nethack. It was one of the seminal influences behind the hack-and-slash dungeon-crawling genre, living on today in thriving communities that still play these old ASCII games, as well as having a significant influence on some of the most popular graphical games of all time, such as Diablo and Diablo 2.

I've been playing Hack/Nethack since 1990.Best game of all time!
I've been playing rogue since the early 80s. There was a java applet version of it, that I used to have on all my computers I've ever owned in the last decade. Now I haven't been able to find it anymore.
In its simple graphics come a very complex and fun game. Its like playing chess with magic :D
Don't forget the Moria/Angband development tree.
David Thornley
HackHackHackHackHackHackNethackNethackNethackNethackNethackNethackYes, i am biased
Hack/Nethack source taught me C
And Nethack has a a lot of technology in the code. UI abstraction layer, serialzation, domain specific data description language with a compiler, etc.
And remember the reason it's called NetHack is because it was one of the first programs written collaboratively over the net. It was so new that deserved a special distinction in the name!
ilya n.
Similar to nethack, muds are great games to get into the coding of.
+5  A: 

If your intent is to see how a game works and are willing to spend a small amount of money to see it, I highly recommend the Torque Gaming Engine from GarageGames. For $150 you get the entire engine source code of a AAA game title (Tribes 2). The content was ripped so you aren't buying Tribes 2, but content is easy to replace. Compared to the cost of other comparable engines, Torque is an amazing bargain. And if you ever decide to produce a game, you can do so without overbearing licensing restrictions.

EDIT: I know its not Open Source, but for your purpose of learning code it should qualify. The engine is coded in C++ and there is a script layer that is similar in syntax to C#/Java.

Chris Porter
+11  A: 

I can't believe Hunt the Wumpus hasn't been mentioned.

Or Star Trek?

Michael Burr
My favorite implementation is "Be the Wumpus", which features audio ONLY.
+6  A: 

What? No one here likes Tux Racer?

I just LOVE that game!!! It's fast paced and can run on almost any decent modern computer (no need for expensive video cards). And it runs on Windows, too!! Furthermore, it demonstrates that "penguins can fly" (and even surpass speed of sound :P)

Joe Pineda
It's been my favorite one for a while too!
Pascal Paradis
I won't vote you down, but I have never been impressed with TuxRacer.
Tux Racer was neat back when I first got MesaGL working, but I can't help seeing it as a perfect example of how linux is a second-class citizen in the gaming world.
Adam Lassek
+2  A: 

Dopewars is fun to play on the internet or on a LAN with friends. And it runs on Windows, OSX, Linux, iPhone and there is an adaptation on Facebook.

Pascal Paradis
Oh! Thanks for correcting this one!
Pascal Paradis
+8  A: 

No question in my mind, GL Tron. How can you not love it?

jeph perro
Because it's kind of boring. It's like Minesweeper for Tron fans. Never the less, I will not vote it down.
Cristian Ciupitu
Against the computer it's boring indeed. But it's a lot of fun against real people.
+2  A: 

Warsow, obviously.

It's a FPS, technically advanced as Quake 3, open source, with nicely documented code and a great community.

That's because it uses Quake 3 code base.
+7  A: 

I'd have to go with GNU Chess.

If you're really interested in looking at the code. From the wiki: "Version 5 was essentially a complete rewrite from scratch of GNU Chess to eliminate spaghetti code and replace antiquated data structures with more advanced computer chess implementation techniques."

Aaron Palmer
+2  A: 

I can't believe, nobody mentioned Armagetron Advanced yet!

For fans of the movie Tron, this is a nice way to waste some time online with other players worldwide.

+1  A: 

Duke3D released their source code. That's the best game ever. Source code is number 15 under duke3d

+4  A: 

Wormux really has a fantastic architechture. i'm a professional game developer and i think that these guys really might be too. the quality of the work smells of years of game dev experience.

+27  A: 
Corbin March
Whoa, +1 for neat games written in D!
Matt Olenik
Kenta Cho's games are awesome - the best probably being Gunroar or rRootage.
Steve Claridge
+13  A: 

There is a very good text based role playing game called 'make', you are on a quest to find hidden dependancies guarded by bearded sages and wrestle patches from them.

Martin Beckett
+11  A: 
. . . . . . . . . .
. . . . S . . . . .
. . * . . . . * . .
. . . . . . . . . *
. * . . . * . . . .
. . . . . . . . . .
. . . E . . . . . .
. . . . . * . . . .
. . . . . . . . . . 
. . . * . . . . . .

This one... the original Star Trek. PDP11 rulez! :)

Kevin Little
I remember playing this at school on a dot-matrix console... right up there with a civil war program and some wierd mafioso program (that the name escapes me atm)
You can download a PDP-11 version of Empire, too!
Walter Bright
@Christopher Klein: probably Syndicate
Adriano Varoli Piazza
+3  A: 

Depending on what platform you're going for, the XNA guys have a few "starter kits" of ready to build projects, the code is available, but it's not explicitly open source:

+2  A: 

A classic: Crowther/Woods Adventure ;-)

Andreas Scherer
+4  A: 
Walter Bright
anything that can get this has got to be good:
+4  A: 

Sauerbraten Very nice FPS

also the code is extremely elegant and clean, a master piece of software development.
The code follows a certain philosophy and really does well in being minimalistic. It's actually a great piece of code if you wish to see how clean and elegantly optimizations can be done.
+31  A: 

What about OpenTransportTycoon? :) Come one people - that's got to be the best! FTW! ;)

Israr Khan
I wasted years of my like playing TTD on the Amiga - love it.
Hehe! That makes two of us ;) Forget all that 3D, shooting and action, this is simple gfx, but gameplay on it's best! ;)
Israr Khan
the best ever, now only if they could create good API for programming your own bots.
lubos hasko
..They've come close with NoAI now. oTTD is an interesting read, I've been able to learn a fair bit just by reading the oTTD source code.
Only one people?
Wayne Koorts
+2  A: 
Denis Hennessy
+4  A: 

I've spent many hours playing FreeCol (a clone of Sid Meier's Colonization).

I mean "studying the source code of FreeCol".

+2  A: 

No shout outs to Angband yet? It went under new "ownership" in March of this year and is still the most addictive fantasty/dungeon style game I've seen. Source is readily available and it is pretty slick to see how a program can still be heavily active after its initial release back in 1993, or even later, if memory serves on its lifetime.

+8  A: 

two words: Frozen Bubble.

oh man, the Perl :O!!
+2  A: 

No one mentioned freedroidrpg yet.

+7  A: 

My personal favorite is UFO Alien Invasion. I loved the original UFO and this is a really good clone.


Global Thermonuclear War ( or, tic tac toe

Hey, it isn't open source, he had to hack into their servers to play it.. :P
Daniel Dimovski
+1  A: 

And I will add a console-game: Meteora Evolution. It is a homebrew-game for the Nintendo DS and Open-Source.

+1  A: 


+1  A: 

Torcs, the Open Racing Simulator

+2  A: 

My vote goes to OpenTTD (

+1  A: 

I don't think it counts as "open-source", but I loved QBasic Gorilla.Bas grin I used to edit it to make all buildings disappear when the banana hits the sun; then it's a Banana Free-For-All! xD

I also took the liberty to rename the game QBrian Gorilla to make fun of a friend of mine... Lame, I know, but hey, I was 14. Haha..

QBasic was the first programming language I got into, before later moving on to VB, and then ASP, PHP and VB.Net. Ah, nostalgia... =)


If you're looking for a very quick C#.NET implementation of the classic Balderdash, check out the Digger source here:

Nick Gotch
I like this game allot. It's only a shame that you can't crouch :) And yes the code is ultra messy, but still it rocks.
Actually you CAN crouch since v1.0 ;)
+2  A: 

So many games, so little time.

+2  A: 

Freespace 2 source code. It is based off of the original Volition Freespace 2 (released as open source). This is production (and thus "battle tested") code and will give you a good look at how shipping titles look (with all of the warts).

You can gain access to the FS2_open source through SVN here:

Jeff Thompson
+2  A: 

I've spent more time with Glubulation 2 Than any other open source game. Its an innovative and fresh variation on the RTS genre.

+1  A: 

Open Arena, the best of Quake 3 engine, entirely open-source.

+11  A: 
Just wanted to say this is *excellent*. The feel of the space combat is spot on.
Excellent game. This screenshot perhaps doesn't do it justice; Star Control II is often rated one of the best games ever (
Josh Kelley
+6  A: 

Jagged Alliance 2

Its source code was released in 2004 (I think) and since then it has been improved very much (almost rewritten) by the mod community. The mod goes under the name JA2 v1.13 and the community resides at Bear's Pit.

P.S. For reading and learning from the code, this might not be the best project. It's old C code with many functions spanning hundreds of lines. Unless you want to learn how to work with legacy code, playing it is more fun. ;)

Esko Luontola
+1  A: 

Tremulous is a good multiplayer-game.

+1  A: 

Hedgewars it's fun, runs smoothly, has nice graphics and everyone who liked Worms World Party will enjoy it.

  To compile and install you need:

  Qt >= 4.4
  FreePascal >= 2.2.0
  SDL >= 1.2.5
  SDL_net >= 1.2.5
  SDL_mixer >= 1.2
  SDL_image >= 1.2
  SDL_ttf >= 2.0
  CMake >= 2.6.0

alt text

alt text

Clearly has nothing to do with Worms.
+1  A: 

Completely surprised that FreeCiv didn't get a mention yet. It is truly the best online multiplayer game out there. And I have played it for hours.

As for compiling, you can pick between the SDL client and the GTK client.

George Edison
FreeCiv is currently the 5th most popular answer. ;)
Dennis Palmer
+1  A: 

Distributed by Microsoft MechCommander 2 (good mech game).

Whatt, I never knew they open sourced this
+1  A: 

TeeWorlds alt text

Looks like a Kirby clone.
Repo Man
YESSS. I love this game. It's a shame hardly anyone plays it, and has no lag compensation, so I can't join them European servers :((

dude. I can't believe nobody has voted for Wesnoth!

Edit: can't believe I missed that. doh.

40+ people did:

The MMORPG Ryzom was open sourced a few days ago (blog post).

While I'm not that well versed in game programming, paroneayea's comment on reddit makes me think it's worth a look:

It's hard to understate how big of a release this is. The volume of assets here, the size of the codebase.. The fact that anyone can run their own MMORPG server, or contribute back useful assets to make it into the main server!

Honestly I don't think I've been this excited about the freeing of a project since Blender was released as free and open source software nearly a decade ago.

Source code - Media assets

+3  A: 

Quite recently a few of the games from the Humble Indie Bundle went open source and are probably pretty interesting for people to look into. Gish, Lugaru, and Penumbra were all opened.