Friday, September 2, 2016

Making your first contribution to open source software

A reader recently emailed me to ask how to get involved in open source software if you haven't done that before. Great question!

I believe that open source software needs to be personal to you if you're going to do it at all. Open source software is a hobby—but it's more than that. I find myself thinking about the open source software projects I maintain, contribute to, and use almost daily. So if you're going to contribute to open source software, make it something you care about.

But how to get started? It can be somewhat intimidating to look at the software that's already been created and think "How can I contribute to that?" One easy way to contribute is by fixing bugs. Every program maintainer is always interested to receive bug fixes! So play with a program that you like. If you find a bug, dig into the source code and fix it. Or if you think the program would be better if it did things a little differently, add that new feature! Email your patches to the program maintainer and see if they accept it. Pretty much all the open source software developers I know are happy to receive patches that fix bugs or add new functionality.

Start by looking at the project website for the program you like. They may have a bug list or a bug tracker or some other bug database of "known bugs" or "known feature requests" that you could work on.

But here are a few projects I would recommend to you. These are of special interest to me:

​The FreeDOS Project
I'm also the founder and project coordinator for FreeDOS, a free implementation of the DOS operating system. We just discussed/reviewed a bunch of bugs on the mailing list, and folks have been updating the ​FreeDOS bug tracker. So the bug list should be updated. Most of the FreeDOS Project (and certainly the bugs listed in the bug tracker) are written in C and x86 Assembly. We use OpenWatcom for our C compiler, and NASM for our Assembler. Both are open source. You will need to install FreeDOS somewhere to work on it - I recommend installing FreeDOS in a virtual machine or PC emulator such as QEMU, Bochs, Plex86, VMWare, Virtualbox, or any other PC emulator.

Simple Senet
I wrote Simple Senet a few years ago. My original intention had been to write a playable version of the board game Senet. But as an experiment, I distracted myself by creating a Senet simulator, where two AI players compete: an "aggressive" player vs a "defensive" player. It's interesting to see which play style wins. It's written in C using ncurses for display to a text terminal. A few suggestions:
  1. Update Simple Senet so a real player can move pieces on the board. The rule system for Senet is very simple, so I imagine a human would use a keyboard up/down/left/right to select the piece they want to move, then space or Enter or some other key to move the piece.
  2. Implement a rules subsystem. Senet is a very very old game. It may be the oldest game known! Because it's so old, there are no written rules from ancient times. Experts have had to figure out how to play the game based on evidence; there is some agreement on the rules (PDF), but not everyone plays the same rules. I wanted to separate the rules into a "rules system" that you could select from. One way to do this is via command line options: senet --kendall to play with Kendall's rules, or senet --jequier to play with Jequier's rules, and so on for --tait and --bell. I was going to make these "top level" options as "macros" that are the same as combining a bunch of other command line options like --stop-squares=15,26,28,29,30 or --start=on or --start=off and so on for other options.
  3. Port the game to GNOME. But this is likely better accomplished as a complete re-write.

Atomic Tanks
This is a fun little game that I used to play a lot. I've even submitted some patches, long ago. I recall Atomic Tanks is written in C. In Atomic Tanks, you control a little tank and you combat other (AI) tanks using outlandish weapons. It's basically a trajectory game: angle and power. One change I would recommend is the fonts: the text fonts are pretty basic. You might see if you can find a better free font (for example, from Google Fonts) that you could load instead.

GNU Robots
I wrote this game a long time ago, but others have updated it after me. It was last updated in 2008. It's a game where you write a program for a little robot, then set it loose and watch it explore a virtual world. GNU Robots is written in C, but the robot programs are written in Scheme (implemented by GNU Guile). I recall the build process needs updating, so you might do that. Also, the game currently displays the whole world at once using tiles for each square. They are pretty small and can be difficult to see. I think it would be more fun to have the game "zoom into" the immediate play area (say, the surrounding 7×7 squares, assuming the robot is always in the center square) and display a smaller version of the entire map off to the side with a "highlight" square around the area that is currently zoomed. That would allow players to watch their robot more closely, but still see where the robot is positioned relative to the map.
image: Official FreeDOS fish (cc-by)
by Bas Snabilie, adapted by Mateusz Viste
from FreeDOS Images

No comments:

Post a Comment