Changing the recipe
An introduction to basic game mod’ing
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
Best voted contents
Buzz authors
Free Software news
- http://tinyurl.com/2gyu5t3 No es oro todo lo que reluce A mas honor mas dolor #hgh #freesoftware #freesoftware
- Watching: Revolution OS - documentary traces t/ history of GNU, Linux, & t/ #opensource & #freesoftware movements ... http://bit.ly/9lv0H6
- Watching: Revolution OS - documentary traces t/ history of GNU, Linux, & t/ #opensource & #freesoftware movements - http://bit.ly/b6Ky3L
- silly tactic #freesoftware #saverelationship #poetry http://tinyurl.com/395kqtq
- #FREESOFTWARE #save marriage #Torrent adorable method http://tinyurl.com/25ml8l7
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
-
10 years on: free software wins, but you have nowhere to install it
Tony Mobily, 2010-07-29 -
Tales From the Front: in Search of APT-GET UNDO
Rosalyn Hunter, 2010-08-13 -
Finding Free Music for a Free Film with Jamendo, VLC, and K3B
Terry Hancock, 2010-07-13 -
The Jargon of Freedom: 60 Words and Phrases with Context
Terry Hancock, 2010-07-24 -
MediaWiki and Script Translation for the Morevna Project
Terry Hancock, 2010-07-07
Hot topics - last 21 days
-
Net Neutrality: what does the Google Verizon proposal mean for GNU Linux?
Gary Richmond, 2010-08-16 -
The Bizarre Cathedral - 78
Ryan Cartwright, 2010-08-16 -
The Bizarre Cathedral - 79
Ryan Cartwright, 2010-08-24 -
Flip: A Simple Camera Done Right
Terry Hancock, 2010-08-31
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