- 1). Download and play various strategy games whose source is freely available for viewing and modification. Examples of open-source games with a strategy element include "Battle for Wesnoth," "FreeCiv" and "Glest."
- 2). Download the source code for one of Step 1's games. A zip file or or other archive file storing the source code is on the same site that hosts the game's executable file.
- 3). Open the archive in Windows Explorer and read the documentation, which explains how to build the executable file from the source code. The docs also relate the language the strategy game's developers used to write the game.
- 4). Get a compilation kit for the language you read about in the previous step. Java kits are on Oracle's Java site, and C++ and C kits are on the GNU compiler collection site.
- 5). Read the game's source code and study it using the approaches in the following steps. The more ways you study the code, the quicker you understand it.
- 6). Memorize portions of code, such as functions or complete source files. Memorization builds understanding.
- 7). Delete functions from the code, then compile the game and jot down your observations about how the game has changed. For example, if you delete a function and then notice the character's arm is missing, you know the code you deleted was essential to that character's arm.
- 8). Step through the code using your compilation kit's debugging tools. This technique shows you exactly how the code is executing and making decisions, one statement at a time. Write a list of variables and the different values they take on as you step through the code --- a game's variables are like landmarks on a place or a person's face.
- 9). Evaluate whether you understand the code well enough to begin changing it, using different benchmarks or litmus tests: The ability to write a comment for each of the original strategy game's source statements is one indicator of total understanding of the game. Another is writing a description of each variable in the game. The ultimate indicator is being able to recite the game's complete source code from memory.
- 10
Write code that implements small changes to the strategy game, starting with changes to hypothetical constants such as "PointsNeededToWin = 10" and other clearly named variables. Recompile and test the strategy game after each change you make. - 11
Make bigger changes that impact character appearances, settings and how virtual opponents behave. Continue making changes until you can't recognize the original game anymore, thus creating your own strategy game.
SHARE