Jump to: navigation, search



Renpy is a fast rapid development role play engine that allows the creation of interactive experiences quite quickly and easily. It's based on Pygame however there are a few issues to be overcome to make it work on the XO properly. This is being used in OLPC Afghanistan to create interactive roleplay / avatar based learning experiences.

There are a few gotchas in this. I hope I have them all documented here. Also when renpy makes distributions it creates it's own Python bundle, so rather than using the OLPCGame wrapper for now this is using normal sugar coating.

Getting Started

Download the normal Renpy from . The program has excellent documentation and tutorials. Go through making the roleplay as normal, and click build distributions.

  • Make sure that you do not select full screen by default. This has a really weird bug that when running as the sugar temporary user it will get the screen position completely wrong.
  • Recommended to make the game at 800x600.

Adjustments for use on the XO

  • You need to make sure that you have the latest video driver installed on the XO so that we can change the resolution - see [[1]]
  • Sugar coat it using [[2]] - if you are doing this on a normal Linux (e.g. Ubuntu) distro make sure that you have installed the sugar emulator package or at least have a folder /usr/share/activities
    • When running this enter any command you like - it doesn't matter, we will have to change this later.
    • Use a name without spaces
  • This should create /usr/share/activities/NameYouEntered.activity , under that there is bin/sugarNameYouEntered which is a shell script. Open it in a text editor and change the lines as commented below:
while [ -n "$2" ] ; do
     case "$1" in
         -b | --bundle-id)     export SUGAR_BUNDLE_ID="$2" ;;
         -a | --activity-id)   export SUGAR_ACTIVITY_ID="$2" ;;
         -o | --object-id)     export SUGAR_OBJECT_ID="$2" ;;
         -u | --uri)           export SUGAR_URI="$2" ;;
         *) echo unknown argument $1 $2 ;;
export NET_WM_NAME="TheInterview"

#Add this line as the renpy script will need this variable

#change this from the command that you entered
  • Open up the renpy generated .sh script that comes in it's folder and make the following changes:

# We assume Darwin means Mac OS X. Sorry, Darwin guys.
if [ "x`uname -s`" = "xDarwin" ]; then
    dir=`dirname "$0"`
    dir=`cd "$dir"; pwd`
    base=`basename "$0"`

    export RENPY_LAUNCHER_DIR="$dir"

    if [ -e "$dir/${}.app/Contents/MacOS/${}" ] ; then
        launcher="$dir/${}.app/Contents/MacOS/Ren'Py Launcher"

    exec "$launcher" "${}.py" "$@"

# This section is needed to change the screen resolution and remembering
# that we are now running as the temporary user created by rainbow

rm $HOME/.xsession

if [ ! -e $HOME/.xsession ]; then
        echo "xrandr --newmode 800x600 0 800 0 0 0 600 0 0 0" >> $HOME/.xsession
        echo "xrandr --addmode default 800x600" >> $HOME/.xsession
        echo "xrandr --newmode 1200x900 0 1200 0 0 0 900 0 0 0" >> $HOME/.xsess$
        echo "xrandr --addmode default 1200x900" >> $HOME/.xsession

#changes the screen res
xrandr --output default --mode 800x600
"$SUGAR_BUNDLE_PATH/lib/python" "-OO" "$SUGAR_BUNDLE_PATH/" "$@"

#puts it back when we are done
xrandr --output default --mode 1200x900
  • Now you can turn this into a .xo file, copy it into an activities folder, etc. should be good to go!

Localization / About RTL

Normally one would argue that roleplays should be available in all languages no matter what the interface is running - e.g. do an interview sim in your language and then in English. You can do this with renpy by defining named points and separating the script out according to language effectively.

Was in contact with the developers and testing this out for Afghanistan - is only in the recent version - author recently added free bidi. Will add more info here as soon as it's tested.

Personal tools
  • Log in
  • Login with OpenID
About OLPC
About the laptop
About the tablet
OLPC wiki