views:

6338

answers:

53

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 http://en.wikipedia.org/wiki/List_of_open_source_games

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.

Martijn
A: 

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
jjnguy
More precisely: they are illegal (to obtain and own).
steffenj
+29  A: 

How about FreeCiv?

Thomas Owens
(Freeciv == awsomeness)
stephenbayer
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.
stephenbayer
Try the trident tileset for older computers. Should work fine.
kaizer.se
+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.
Manuel
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 :)
rogeriopvl
+2  A: 
Newtopian
+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.

HanClinto
I've been playing Hack/Nethack since 1990.Best game of all time!
pearcewg
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.
stephenbayer
In its simple graphics come a very complex and fun game. Its like playing chess with magic :D
srand
Don't forget the Moria/Angband development tree.
David Thornley
HackHackHackHackHackHackNethackNethackNethackNethackNethackNethackYes, i am biased
johnc
Hack/Nethack source taught me C
johnc
And Nethack has a a lot of technology in the code. UI abstraction layer, serialzation, domain specific data description language with a compiler, etc.
Darron
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.
Tchalvak
+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.
mdm
+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.
Knobloch
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?

http://en.wikipedia.org/wiki/GLtron

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.
Kyralessa
+2  A: 

Warsow, obviously.

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

friol
That's because it uses Quake 3 code base.
HMage
+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.

HS
+1  A: 

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

Maudite
+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.

DavidG
+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)
SomeMiscGuy
You can download a PDP-11 version of Empire, too! http://www.classicempire.com
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:

http://creators.xna.com/education/starterkits/

+2  A: 

A classic: Crowther/Woods Adventure ;-)

Andreas Scherer
+4  A: 
Walter Bright
anything that can get this has got to be good: http://www.classicempire.com/epyx.html
BCS
+4  A: 

Sauerbraten Very nice FPS

GvS
also the code is extremely elegant and clean, a master piece of software development.
levhita
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.
Huur
+31  A: 

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

http://www.openttd.org FTW! ;)

Israr Khan
I wasted years of my like playing TTD on the Amiga - love it.
Kieron
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.
Sukasa
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".

JPLemme
+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.

Dillie-O
+8  A: 

two words: Frozen Bubble.

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

No one mentioned freedroidrpg yet.

Mnementh
+7  A: 

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

Mnementh
A: 

Global Thermonuclear War (http://en.wikipedia.org/wiki/WOPR) or, tic tac toe

Tim
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.

Mnementh
+1  A: 

Gnu-Backgammon.

alexmeia
+1  A: 

Torcs, the Open Racing Simulator http://torcs.sourceforge.net/

+2  A: 

My vote goes to OpenTTD (http://www.openttd.org)

CommanderZ
+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... =)

Darkwoof
A: 

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

http://www.lutzroeder.com/silverlight/

Nick Gotch
A: 
driAn
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.
rogeriopvl
Actually you CAN crouch since v1.0 ;)
driAn
+2  A: 

So many games, so little time.

pmg
+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:

http://scp.indiegames.us/links.php

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.

TokenMacGuy
+1  A: 

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

rogeriopvl
+11  A: 
jle
Just wanted to say this is *excellent*. The feel of the space combat is spot on.
Alex
Excellent game. This screenshot perhaps doesn't do it justice; Star Control II is often rated one of the best games ever (http://en.wikipedia.org/wiki/Star_Control_II#Accolades).
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.

Mnementh
+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

xadoc
Clearly has nothing to do with Worms.
Longpoke
+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).

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

TeeWorlds alt text

Tim
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 :((
Longpoke
A: 

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

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

alesplin
40+ people did: http://stackoverflow.com/questions/226970/best-open-source-game-code/226983#226983
Tim
A: 

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

eneveu
+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.

http://www.wolfire.com/humble

Tyler