Posts Tagged ‘Renpy’

Introduction to Ren’Py

Saturday, March 19th, 2011

Hello, programmer SleepKirby here.

I’ve mentioned in an earlier post that Eastern Starlight Romance runs on the Ren’Py engine, but perhaps it would be interesting to show what’s involved in coding a basic Ren’Py game.  Ren’Py is a visual novel engine, based on the programming language Python. One of its strongest points is that it’s easy to make a basic visual novel with it.

Here’s a simple example.  The code for a line of dialogue looks like this:

ma "Not bad, Alice. I didn't think you were that devious."

The part in quotes is the dialogue.  “ma” indicates that Marisa is speaking.  ma is a Character object, and it’s a shortcut so that we don’t have to type the full name “Marisa” every time Marisa speaks.

Here’s where the Character object is defined:

define ma = Character('Marisa', color="#FCEC7C")

With this code, the speaker’s name is shown as Marisa.  Using Character objects, we can also customize the dialogue box based on who’s speaking.  In this case, we make Marisa’s name show up as the color FCEC7C.  That happens to be a shade of yellow.

That’s Graph’s new Alice and Mystia, by the way!

In the future, I may make more posts about Ren’Py.  My main purpose here isn’t to advertise Ren’Py (though I do recommend trying it out); it’s to give examples of the inner workings that make a visual novel come together.