DEV Community

PythonIsNotASnake
PythonIsNotASnake

Posted on • Updated on

Take your documentation to the next level with Ren'Py

Do you ever heard of Ren'Py? Ren'Py is an engine for visual novel games published in 2004. The engine is open source and run by MIT License. Visual novel games are games which based on visuals and dialogs and live by decisions of the player. Visual novel games are very popular in the Asian region. But there are more use cases than game development. Let me tell you which potential is sleeping in this engine.
Disclaimer: This post will not teach you Ren'Py in any kind and don't explain exactly how you can program your documentation. It will only show you some basics and what you can do and achieve with it.

The idea

Which tools do you use to publish documentation for your software to end users? In most of the cases it is a document to read by the end user. Divided into chapters so the user can search for the fitting part of the document.
This proceed is full of information and can give a deep dive into the product. But it can also be overwhelming to read many pages of content.
This is exactly the point on which Ren'Py can make a big different. The plan is to get a interactive documentation which will be a pleasure for users to learn and understand your product. So let's take a look on the details.

Gamification

Do you know what gamification is? It is the method to integrate parts of games in software to achieve an enjoyable experience for the user by use of the product. An quick example are success screens at the end of a process. A little symbol of a medal with a short text like 'You have create personal costs successfully' is enough to let the user get a little experience of success in the daily work routine.
In our situation we want to use Ren'Py to let the users enjoy the experience to read the documentation. This goal will be reached by dialogs to see faster the information the user is looking for combined with a visual contact person. The feeling to play a game instead of doing work can motivate a user a lot more to learn something about a product.

rpy Files and the Ren'Py Script Language

To write a game with the Ren'Py engine you don't need knowledge in any programming language. Ren'Py is written in Python and the engine use their own format named rpy. It is more like the script for a movie or a theatre play. There are two main sectors in which the language is split.
First the dialogs. The dialogs give the information in text on the screen and enable the user to interact with the program by select an answer. Those are menus which mean the decision by user. Each menu has one or more answers to keep the dialog running. For each option in the menu you can define different actions in your program. This can be completely different conversations.
The second sector are visuals and animations. The animations are similar to power point animations. You can choose between different effects to show or hide objects and switch from one scene to another scene. With this knowledge you can build a presentation completely in Ren'Py. It makes no big different.
With this separation we can look at some code snippets of the Ren'Py documentation.

label start:
  "Peter" "Good day! My name is Peter and I'm your contact person for all your questions about our software. How can I help you with our software?"
  menu:
    "Installation":
      "Me" "How can I install the software?"
      jump installation_guide
    "Pricing list":
      "Me" "How is the pricing list for the software?"
      jump pricing_list
    "Save progress":
      "Me" "How can I save my work progress?"
      jump save_files
Enter fullscreen mode Exit fullscreen mode

This simple example show a conversation. You can see two characters, Peter and Me. Peter ask the user something and the user can response the question with different options. Each answer start a different section of the script. The sections are called 'label'. Behind each of the options the user can find a dialog with the exact information he or she is looking for.
This is one part of Ren'Py. It can go very deep so you can do much more than showed in the example. But let us going forward to the next example. It will show us animations.

label start:
  scene bg office
  show peter at left
  with fade
Enter fullscreen mode Exit fullscreen mode

How you can see first the script will show a new background named 'bg office'. After this the image of the character 'peter' will be show at the left side of the screen with a fade animation. This are the basic keywords to animate your program. You can find a lot more keywords in the documentation to animate your interactive documentation.

Goal

Now you have a kind of an idea how Ren'Py can work. With this we can take a look at a finished game which shows our goal. If you download the Ren'Py launcher and start the project 'Tutorial' you can see the following view:
Screenshot of the interactive Ren'Py tutorial of the Ren'Py launcher
You can see a kind person who want to help you with your questions. All options in the menu guide you to other sections of the documentation.There are some vibes of a chat bot but without any kind of intelligence.
The launcher give you the ability to jump into the source directory. So you can see the source code of their tutorial and can use this as inspiration. You don't must use Ren'Py to write a deep documentation like it is common for framework or library documentations but can use it for a FAQ.

Conclusion

Now it's your turn. You have a quick overview how Ren'Py work and saw how a documentation made by Ren'Py can look like. For a deep dive the Ren'Py documentation is the right place to begin. Furthermore there are so many tutorials and forums where people share their knowledge and projects.
Do you think that a user will have more fun with a documentation in this style?
Are you ready to invest time to learn and practice Ren'Py for your next documentation or FAQ?
Can it be a good marketing move to introduce your product with a short game which explain the main features?

Top comments (0)