Changing the recipe
An introduction to basic game mod’ing
Download the whole article as PDF
Short URL: http://fsmsh.com/1370
- 2006-07-13
- Published on web | Intermediate
-
Write a full post in response to this!
This content was sponsored by:
There is a tradition amongst computer game aficionados which may be little known to people accustomed to proprietary games. This activity is called mod’ing—making small changes to a game to customize the play experience. Without a game’s source code, such changes are extremely difficult to implement. Games licensed as free software, on the other hand, are quite amenable to mods. This article presents two example mods for single-player games and proceeds to discuss mod’ing in general.
It may be news to you that it is usually easy to tinker with the source code for games
If you haven’t done much programming then it may be news to you that it is usually easy to tinker with the source code for games. Typically there are a few crucial variables like score and powerup. There is a main loop which reads keyboard and mouse events. Adding a special cheat key and recompiling can entail as little time as an hour or two.
It may sound impractical for mere reflex gamers to make source code changes for cheat keys and the like. Examine the following examples to decide whether you’ll need any help.
Mods for single-player games
Before jumping into source code, understand that most software is developed through independent projects. Gathering all these projects and making them work together is the primary motive of distributions like Red Hat, Gentoo, and Debian. If you use the packaging tools which come with your distribution then you will have an easier time because the myriad of integration problems are already solved. I use the Debian toolset here.
# Some preparation: apt-src automates the process of
# downloading source code. We'll keep track of our
# changes with GIT, just like the pros.
#
$ apt-get install apt-src git-core
# You may have to add a deb-src line to your
# /etc/apt/sources.list.
#
$ apt-src install gnome-games
# This tutorial uses version 2.12.3. Other versions
# hopefully differ little.
#
$ cd gnome-games-*
# Take a snapshot of the original version.
#
$ git init-db
$ git add .
$ git repo-config user.name "John Doe" # your name here
$ git commit -m original
# Edit the code such that git diff show the following
# changes. Add lines prefixed with plus and remove
# lines prefixed with minus. It's probably OK if the
# line numbers turn out slightly different.
#
$ git diff
--- a/gnometris/blockops.h
+++ b/gnometris/blockops.h
@@ -44,10 +44,10 @@ public:
GnomeCanvasItem *generateItem(int x, int y, ..
const Block * const getFieldAt(int x, int y) ..
+ void eliminateLine(int l);
private:
bool blockOkHere(int x, int y, int b, int r);
- void eliminateLine(int l);
Block **field;
bool field_initialized;
Field *fieldDisplay;
--- a/gnometris/tetris.cpp
+++ b/gnometris/tetris.cpp
@@ -1132,6 +1132,10 @@ Tetris::keyReleaseHandler ..
} else if (keyval == t->moveDrop) {
t->dropBlock = false;
res = TRUE;
+ } else if (keyval == 'c') {
+ t->ops->putBlockInField(true);
+ t->ops->eliminateLine(LINES-1);
+ t->ops->putBlockInField(false);
}
return res;
# Build a new deb package with your mod. This can take
# a long time depending on the speed of your machine.
# You need about 100M of free disk space.
#
$ dpkg-buildpackage -b -uc -rfakeroot
# If all goes well, install it on your box.
#
$ su -c 'dpkg -i ../gnome-games*.deb'
Write a full post in response to this!
Similar articles
Do you like this post?
Vote for it!
Copyright information
Verbatim copying and distribution of this entire article is permitted in any medium without royalty provided this notice is preserved.
Biography
Joshua Pritikin: Joshua is an aspiring researcher in evolutionary anthropology. To participate in his research, visit http://shared1.openheartlogic.org
- Login or register to post comments
- 6814 reads
- Printer friendly version (unavailable!)




Best voted contents
-
Special 301: FOSS users. Now we're all Communists and Criminals
Gary Richmond, 2010-03-05 -
Microsoft's Internet Driving Licence: stupid, unworkable and unenforceable
Gary Richmond, 2010-03-10 -
The Bizarre Cathedral - 69
Ryan Cartwright, 2010-03-12 -
Interview: Nina Paley (author of "Sita Sings the Blues" and the two "Minute Meme" animations)
Terry Hancock, 2010-03-15
Buzz authors
Free Software news
- #ubuntu #linux Help Needed! Reviewing And Merging Patches http://goo.gl/fb/mntV #debian #freesoftware #linux
- When are YOU get your copy of this AWSOME FREEsoftware? Check it out at http://bit.ly/5NJCME
- #ubuntu #linux ##Ubuntu Weekly Newsletter #185 http://goo.gl/fb/32OY #business #entertainment #freesoftware #gos
- http://www.jarronegrolinux.com/ #FreeSoftware #SoftwareLibre #GNU #Mexico
- Software idea: A metronome written in GTK+. I'd call it MetroGNOME. The Qt version can be MetroKnome. #gnome #kde #gnu #linux #freesoftware
Similar entries
Other sites
- The Top 10 Everything (Dave). The good, the bad and the ugly.
- Free Software news (Dave & Bridget). All about free software -- free as in freedom!
- Book Reviews: Illiterarty (Bridget). Book reviews, blogs, and short stories.
Hot topics - last 60 days
-
Linux performance: is Linux becoming just too slow and bloated?
Mitch Meyran, 2010-01-26 -
Save "Sita Sings the Blues" from the Flash format: can you convert FLA?
Terry Hancock, 2010-01-29 -
Microsoft's Internet Driving Licence: stupid, unworkable and unenforceable
Gary Richmond, 2010-03-10 -
Special 301: FOSS users. Now we're all Communists and Criminals
Gary Richmond, 2010-03-05 -
The Bizarre Cathedral - 69
Ryan Cartwright, 2010-03-12
Hot topics - last 21 days
-
Microsoft's Internet Driving Licence: stupid, unworkable and unenforceable
Gary Richmond, 2010-03-10 -
Special 301: FOSS users. Now we're all Communists and Criminals
Gary Richmond, 2010-03-05 -
The Bizarre Cathedral - 69
Ryan Cartwright, 2010-03-12 -
Interview: Nina Paley (author of "Sita Sings the Blues" and the two "Minute Meme" animations)
Terry Hancock, 2010-03-15
Odiogo
Free Software Magazine uses Apollo, project management and CRM for its everyday activities!

be careful what you mod
Submitted by Anonymous visitor on Wed, 2006-08-30 21:49.
Vote!Also a good note, be very VERY careful what you mod... game modding has gotten myself and my friends sued in the past. I kid you not: http://www.worthplaying.com/article.php?sid=23629