DEVELOPMENT CORNER
Ren'Py 101: Releasing Your Game Part I
by Rio

We are now almost done with the Ren'Py tutorials and covering an important aspect of game making - putting in the final touches before releasing your game.

1. Obfuscating Images

2. Making a README File

 
1. Obfuscating Images

Obfuscating images in Ren'Py is just basically archiving all the images into one file. It's useful for those who:
1. Don't want players to preview game images before they actually start the game
2. Don't want players to play around with their game images
3. Don't want players to take game images and use them for their own games
4. Prefers having the image files in one convenient file upon release
5. Would rather not let players or fellow ren'ai developers know how something was done... (Hee hee, this one goes for me to some extent. Tricks of the trade, you know. ^_~)

If you agree with at least one of those above, then let's get to obfuscating your images...

As mentioned earlier in What's What: Files and Folders, you will have to use a file called archiver.exe (for Windows users) or archiver.py (for Unix/Linux and Mac users) found in the same folder as your run_game.exe file. When run, archiver will take all the images you specified and create a single file called images.rpi and images.rpa. These two will be all you need to put into your image folder upon release. Great, huh?

The first thing you have to do is run your Command Prompt. It will basically spit out a line much like this:

C:\Document and Settings\Visitor>

The first letter tells you what hard disk drive you are currently in - C: drive, in the above example. "\" tells you what folder you are in. The first "\", for example, tells you that you are currently in the C: drive and in the "Document and Settings" folder, while the next one tells you that you are now in the "Visitor" folder. In hierarchal terms (or how it would look under Explorer), it will be something like this:

(C:)
  Documents and Settings
    User 1
    User 2
    Visitor
      Files for Visitor listed here <---- This is where the prompt is at
    Visitor 2
  Program Files
  Temp

If the current prompt is not where your game is located, you have to navigate your way to your Ren'Py game folder. Here are some basic DOS commands to move around:

If you're in wrong drive, type out the drive you want to go to and press Enter. The prompt will then change to the drive you specified.

C:\Document and Settings\Visitor>E:

E:\>

To move down or up a folder, use the cd (short-hand for "change directory") command. For moving down, just type "cd" a space, the path to the folder, and press Enter. To move up a folder, type "cd .." and press Enter.

E:\>cd Games\RenPy\renpy-4.8.1 <--- moves down folders

E:\Games\RenPy\renpy-4.8.1> <--- new prompt

E:\Games\RenPy\renpy-4.8.1> cd .. <--- moves up a folder

E:\Games\RenPy> <--- new prompt

E:\Games\RenPy>cd ..\.. <--- if you want to move up folder two or more times, just keep adding "\.."

E:\> <---new prompt

If you're moving down files, you have to make sure you are naming the folders correctly and the folders are actually where they are. If the folders are not there, an error message will pop up. If you can't remember the exact path to your game folder, open up a window to it. There usually is an address bar with the path listed under the menu bar (#1) or if that's not there, check the windows' title and the path should be listed there as well (#2).

Now that you know how to move up and down folders, go to the folder where your images are located. Mine are directly under the game folder like in the original Ren'Py release, so I would place a command like so:

E:\>cd Games\Amgine Park\game

E:\Games\Amgine Park\game>

Then you have to run the archiver file like so: ".. archiver.exe images *.jpg *.png *.gif" Let's get down to what each section means...

".." makes it go one folder up and looks for the file "archiver.exe". Archiver.exe is executed and is told to make a file called "images" when it is done. The images to be archived are specified after "images". In other words, all jpg, png, and gif files will be archived. * is a wildcard and basically means the file can be any name just as long as it ends with the extension .jpg, .png, or .gif.

Note: For your game, type out only the image file types you are using. Also, if you have your graphics under multiple layers of folders, use the "..\.." method. It is also best if you have all your images under one folder. If you have them spaced out in various folders like: character, background, and game - you will have to go to each folder and archive the images in them seperately.

E:\Games\Amgine Park\game>.. archiver.exe images *.jpg *.png *.gif

(After pressing enter, archiver.exe is run and it compacts the images into one file. You will see the names of your images files listed rather quickly and will eventually come back to the prompt...)

E:\Games\Amgine Park\game>

If you check the folder where your images are, you will see two new files: "images.rpa" and "images.rpi". All your image files are now in one convenient file. Note: If you made new images or made changes to your images, you will have to re-archive them all.

The next step is to direct Ren'Py to this file in your script. Open up your script and under the init block, enter the following code: $ config.archives = ['images']

    # Now, we declare the images that are used in the program.

    $ config.archives = ['images']

    # Declaring background images...


Technically you can declare this anywhere under your init block but I usually declare mine right above where I start to declare the images so I can easily remember where I put it. Now, check if it works properly by taking out all the individual image files from your folder and running the game.

Note: I make two seperate folders. One folder for tweaking and another folder for release. I suggest you create another folder that will be the released version that you zip or rar.

Back to Dev Corner | Back to Top

2. Making a README File

Another thing to consider when releasing your game is to make a README file. It is generally made in Notepad or similar basic word editor. Most people tend to skip the README file (I know I generally do :P) but it's quite helpful for those who may encounter problems with your game. Here's what is generally found in a README file:

1. About the Game - synopsis, hardware requirements, release date, rating, playtime, credits, platform, etc
2. How to Run the Game - how to run your game in Windows, Unix/Linux, and on Mac
3. Playing the Game - what buttons will do (ex: ESC, CTRL, right vs. left mouse button, etc) and features
4. Credits and Legal Stuff - shout outs to people like PyTom, user notices and rights, and a pointer to your site or email.
5. Disclaimer - notice that takes away liability to your game should anything bad happen to the users computer.
6. Introduction - a message from the game maker. In other words, you!
7. Updates/Bugs & Errors - any updates made to the game such as fixing bugs and whatnot

These are what are generally found but you can add more as you see fit. For example, I tend to put a Table of Contents with my README file. Below is what I put under "How to Run the Game". It was borrowed from PyTom with some additions on running the game on Mac.

The directions to run this game vary depending on if you are using
Windows or one of the other supported platforms.

~Windows~

Amgine Park should work with Windows 98 or higher.

To run it, simply run the amgine.exe excutable in the directory
containing the unzipped archive. After a few seconds, the game will
start running.


~Other Platforms~

Running this game on other platforms is more involved. You'll need to
ensure that python 2.3 or greater is installed, and that the pygame
libraries have been downloaded. You'll also need to have a version of
SDL_mixer that supports ogg vorbis.

Assuming that you've managed to satisfy the prerequisites, however,
actually running the game is simple. You just need to run
amgine.py. We personally do that on Linux with a command like:

python amgine.py

After a few seconds, the game should start running.

For Mac users, there are several more steps that you have to follow:

1. Download the files here: http://www.bishoujo.us/renpy/dl/macdeps/
They are...
A. pygame-1.7.0-py2.3-macosx10.3.zip, and
B. pyobjc-1.3b1-py2.3-macosx10.3.zip

2. The zip files should automatically install itself. If not,
uncompress them manually. Install PyObjC first, and pygame second.
Note: You only have to do this once. If you already did this to play
another Ren'Py-made game, you don't have to do it again.

3. After that, run the amgine.pyw file and the game will start.
If an error occurs, a traceback will appear. Please send that
traceback to me at [email protected] so we can debug it.

**Known Mac Bug**
Moving the mouse in fullscreen mode may leave artifacts on the screen.
Switching Ren'Py to windowed mode seems to fix this. You can make
the change by pressing the 'f' key.

For up-to-date info on Mac support, please visit the Mac Ren'Py page:
http://www.bishoujo.us/renpy/mac.html

Make sure you give proper credit for everything! If, for some reason, giving credit in your game is not appropriate, then by all means, do so in your README file.

<< Writing Your Script Part II | Back to Dev Corner | Releasing Your Game Part II >>

 


Content© 2005 www.RenaiGames.net & RenaiGames.com, unless otherwise specified. All rights reserved.