70
votes

This question has been preserved for historical reasons, but it is not considered on-topic, so don't use it as an excuse to post something similar.

More info at https://stackoverflow.com/faq.


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

...of course ;-)

0

55 Answers 55

70
votes

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

6
  • 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. Oct 22, 2008 at 20:00
  • 12
    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
    Oct 22, 2008 at 21:21
  • Agreed, but for learning games programming, these sources are invaluable! Oct 23, 2008 at 17:25
  • Another thing you can learn from these is historic, how they managed to get it to work on the hardware of the day. Oct 24, 2008 at 16:30
  • 3
    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
    Jan 2, 2009 at 17:28
67
votes

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.

4
  • 1
    Don't forget the Moria/Angband development tree. Nov 14, 2008 at 21:41
  • 5
    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
    Jan 6, 2009 at 18:26
  • 3
    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.
    Jun 21, 2009 at 8:57
  • I think you can put MUDs in that tree as well: multiplayer realtime Internet text adventure game. CircleMUD has very good documentation and I started with that a few years ago: circlemud.org Oct 18, 2011 at 16:47
46
votes

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

37
votes

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

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

2
  • 1
    the best ever, now only if they could create good API for programming your own bots. Nov 14, 2008 at 10:47
  • 1
    ..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
    Mar 3, 2009 at 19:39
31
votes

How about FreeCiv?

3
  • One problem I have with FreeCiv is it doesn't run smoothly on older hardware. Otherwise I love it. Oct 24, 2008 at 16:31
  • 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. Nov 14, 2008 at 21:26
  • Try the trident tileset for older computers. Should work fine. Mar 10, 2010 at 21:28
31
votes

Check out Kenta Cho's games: http://www.asahi-net.or.jp/~cs8k-cyu/index_e.html. Most of them are written in D and use Simple DirectMedia Layer.

They're a lot of fun and the source is extremely readable - a great showcase for the D language.

Torus Trooper screenshot:

alt text http://images.macworld.com/images/legacy/images/content/torus.jpg

2
  • 3
    Whoa, +1 for neat games written in D! Apr 15, 2009 at 10:56
  • Kenta Cho's games are awesome - the best probably being Gunroar or rRootage. Mar 6, 2010 at 14:21
25
votes

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.

20
votes

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

16
votes
. . . . . . . . . .
. . . . S . . . . .
. . * . . . . * . .
. . . . . . . . . *
. * . . . * . . . .
. . . . . . . . . .
. . . E . . . . . .
. . . . . * . . . .
. . . . . . . . . . 
. . . * . . . . . .

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

3
  • 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) Oct 23, 2008 at 17:27
  • You can download a PDP-11 version of Empire, too! classicempire.com Nov 10, 2008 at 5:42
  • @Christopher Klein: probably Syndicate Jan 6, 2009 at 18:48
16
votes

alt text http://sc2.sourceforge.net/screenshots/melee2.png

Ur Quan Masters - Star Control 2 update.

2
  • Just wanted to say this is excellent. The feel of the space combat is spot on.
    – Alex
    Sep 5, 2009 at 14:10
  • Excellent game. This screenshot perhaps doesn't do it justice; Star Control II is often rated one of the best games ever (en.wikipedia.org/wiki/Star_Control_II#Accolades). Jan 25, 2010 at 1:57
12
votes

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

11
votes

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

Or Star Trek?

1
  • My favorite implementation is "Be the Wumpus", which features audio ONLY.
    – mdm
    Oct 30, 2009 at 18:53
10
votes

two words: Frozen Bubble.

0
9
votes

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

8
votes

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)

3
  • It's been my favorite one for a while too! Oct 22, 2008 at 18:51
  • 3
    I won't vote you down, but I have never been impressed with TuxRacer.
    – Knobloch
    Oct 22, 2008 at 19:00
  • 2
    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. Nov 14, 2008 at 20:49
8
votes

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

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

2
  • Because it's kind of boring. It's like Minesweeper for Tron fans. Never the less, I will not vote it down. Oct 24, 2008 at 18:13
  • Against the computer it's boring indeed. But it's a lot of fun against real people.
    – Ryan Lundy
    Jun 8, 2010 at 4:02
7
votes

Jagged Alliance 2

Its source code was released in 2004 (I think) and since then it has been improved very much 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. ;)

1
  • Jagged Alliance 2 would be a good start if you want to practice your review skills.
    – mbx
    Aug 23, 2011 at 19:01
5
votes

well....

If you'r into Flight simulators the definitively check out Free Space just can

http://scp.indiegames.us/

There are also tons of mods... a very nice one is on the battlestar gallactica universe where you actually fly the viper mark VII

http://www.game-warden.com/bsg/

have fun... errr, of course, where's my head...

happy code reading ;-)

5
votes

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.

5
votes

Sauerbraten Very nice FPS

2
  • 1
    also the code is extremely elegant and clean, a master piece of software development.
    – levhita
    Nov 14, 2008 at 20:43
  • 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.
    – Hakkar
    Feb 24, 2010 at 3:01
5
votes

alt text http://www.classicempire.com/emlogo.jpg

Empire, the Wargame of the Century, naturally. You can download it from classicempire.com. Empire has been flunking out students and wrecking marriages since the 1970's.

1
4
votes

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.

4
votes

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

I mean "studying the source code of FreeCol".

4
votes

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

3
votes

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.

0
3
votes

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/

3
votes

So many games, so little time.

2
votes

Warsow, obviously.

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

1
  • That's because it uses Quake 3 code base. Jul 4, 2009 at 14:20
2
votes

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.

Not the answer you're looking for? Browse other questions tagged or ask your own question.