Saturday, January 14, 2012

Professional developer's look at Ren'Py

Editor
In the image above, some Ren'Py code (people familiar with python might recognize some keywords/syntax) from my current project Loren Amazon Princess in my preferred editor, SciTe.

Ren'Py was created by Tom Rothamel, as a tool to help everyone to create visual novel games, with very little or no coding knowledge required. I first learned and started using it around Summer 2008, and since that year it has evolved quite a lot. So it's been 3 years and half since I started using it, and right now I can prototype many games rather quickly, even if works better for certain kind of games: heavily story based, with no real-time animations and of course 2d, since Ren'Py is a 2d game tool.

Currently Ren'Py is available for PC, Mac, Linux and is still experimental on Android, though it should be available sometimes in the future. There's no iOS version planned at the moment of writing, even if the author seems to be thinking about it.

The language

Ren'Py, as the name suggest is based on Pygame and Python, which I consider the most advanced language available today. Simple, concise, but at same time powerful and easy to use.

It was love at first sight for me: I was used to type the Divine Comedy in C/C++ to load a .csv or do string operations, and when I realized how quick was to develop with python I immediately started to learn it, and it was very simple process (thanks also to the online documentation).

Ren'Py is NOT a visual tool. You don't use the mouse to place UI. You use an IDE, currently available are SciTe or Jedit. This might discourage many people who first approach it, especially if they're not coders but are used to play with Flash, Gamemaker, Stencyl or other visual creating tools. However, you soon realize that for certain kind of games there's nothing better than Ren'Py and you don't actually need a visual editor at all.

As I said the language was designed with visual novels in mind: though you can use it also for any story-based game like dating sim, RPG games, or adventures with some extra coding.

Recently a new Screen Language and ATL (Advanced Transform Language) were introduced, making the creation of interactive screens and special effects (zoom, rotation, movement, etc) even easier.

The Good

Very simple cross-platform capability. Since python is an interpreted language, this means that you can build the game for the three platforms (PC, Mac, Linux) with ONE CLICK. This is simply amazing! And you don't have to worry for different behaviors: if the game works in one platform, it will behave the same in another. This was a big plus for me since I was used to have mysterious bugs on Mac when coding in C and Xcode, that weren't present on PC.

With Ren'Py, I went as far as copying new .rpyc (Ren'Py compiled source scripts) directly into the zip (Mac version) or the tar.gz (Linux versions) from my Windows computer, without rebuilding the games and it worked, I didn't encounter any problem. So for example you can develop for Pc, Mac and Linux without the need to buy a Mac or have a machine with Linux installed.

Powerful language and syntax. The language is really simple and intuitive. Remember that it's a tool specialized for Visual Novels, but you can effectively write most 2d games with it. Probably the only ones that I wouldn't reccommend coding are those who rely on real-time movement, like a RTS, shooter, or similar. Note that is still possible to make that kind of games, but I would pick another tool honestly.

Still for any other 2d game it's really a great solution. Very strong GUI system, combined with the ease of use of python makes this a great tool.

Easy to debug. In most other languages, debugging is a pain. Not just finding the bug, but finding out which line of code cause it. With Ren'Py thanks to Python you get very detailed crash reports, telling you exactly where the problem is.

Magic reloading and rollback system. Those are without any doubts the BEST features I've seen in ANY 2d development engine. Not even Unity has something so powerful. What is that, you might ask? First, the reload: since python is a scripted language, you can ANYTIME (and I mean literally anytime) hit shift+R and see immediately the changes you've made to the current screen.

The rollback system instead is something inherited by the visual novel mechanics, but that works surprisingly well even to debug. In practice, the program stores the path you have choosen, and memorizes XX amount of "steps". This was doen so that the player could "rollback" with the mousewheel or keys, to a previous situation in the game story. But it works even for coding!

Trying to explain better: if you start the game, then visit in order: screen 99, do action 32, screen 32, click button 2, screen 12, type your name, screen 42, click button 5. Can you remember that? the game can, and provides you with a way to go back, a sort of "Undo" but you can use it when directly playing the game in debug mode!

I know that even in Unity you can modify the game world with the 3d world editor and see the changes, but here I mean something different: you can see the changes without having to EXIT the game, and restart.

A few simple examples:

case A: you've been testing for 6h a complex RPG. You see a visual bug. You look in the code, find that a button was aligned badly, change the code and reload. You see the change immediately, and go on testing. "Flawless Victory".

case B: you've been testing for 6h a complex RPG. You click "done" and the next screen crashes. Thanks to Python built-in descriptive crash you see where the problem was, in previous screen you assigned a impossible value. You do a rollback, in practice executing an Undo of all executed code, then fix the bug in the source with the game still running, reload, and go on with the testing. "Epic Win".

And the documentation? it's good, at least for the basic features.

The Bad

As I said, there's no editor apart an IDE. There is no intellisense/code completion, and you cannot browse classes or labels (some people managed to use Eclipse or other tools for python to code with it, but it's definitely a hack). This is definitely something that could be improved, since in particular in the first weeks of use you can't remember all the commands by memory and you'll be looking at the documentation extensively.

Bad documentation for the most advanced features. How does Sprites work? What is im.ConditionSwitch? and so on. The documentation explains everything, but sometimes seems written like if the author assumes the reader is a good coder/clever as him, but often that's not the case :) I consider myself an average coder but surely not a beginner, and sometimes I have hard time to understand how some of this stuff works. But it's not bad as it was in the early days when documentation was really scarce!

It's an hobbyst project. Don't get me wrong: the author is doing an awesome job trying to reply to all the support requests, mainly done through the specific Lemmasoft forum dedicated to Ren'Py. However it still is, at least for now, an hobbyst project. The author doesn't make any money from it, and so obviously there's no guarantee that you'll get an answer to your question. I repeat, he is doing the best he can, and sometimes other people help answering the most common questions, but still you must not expect to get immediate responses to your problems.

Personally, I'd love to see Ren'Py become a professional tool, with full support of deployment for Android/iOS, and maybe future porting to HTML5 and more. I am sure many other gamedevelopers even outside of the "visual novel / dating sim circle" would pick it up because of its features.

In conclusion

Ren'Py is a tool with double face. If you want simply to use it for what was made for, it will do the job without problems and is simply the best visual novel/dating sim system around, at least for desktop computers.

If you're a more advanced coder and want to build simulation games, strategy games, rpg games, or any 2d game that doesn't need a lot of things moving on the screen (but even in that case, you could make it) you'll be surprised by the ease of use and powerful features that Ren'Py has to offer, combining the power of Python with one of the best GUI / scripting systems I've seen in modern 2d libraries.

Yes, to use it in advanced mode it has a steep learning curve, but once you get the grasp of it, is really hard to get back to... anything else. I had to do some C coding last week, and wondered why the "rollback" wasn't working, or why I couldn't just hit Shift+R to see instantly the changes I've made!

At least this was my experience. If I was able to release 12 games in three years and half (almost one every 4 months) it's only because I discovered this powerful tool. Thanks again to Tom Rothamel for the incredible piece of software he managed to create!

No comments:

Post a Comment