Saturday, February 21, 2009

Why Specialized Engines Make Sense - RenPy versus Flash

OK, if you want a reason why a specialized game engine - one tuned to the type of game you're creating - makes sense, you need look no further than my latest game. As those of you who have been following my work may know, it took me about two months to do the Flash port of a Visual Novel (College Romance) that I had previously done in another language. The dialog count for that game was just under 22,000 words. My new game which takes place in the same "universe", but has a mainly different set of characters took just about one month to write and program using RenPy, and has just under 45,000 words. Since in both cases I had basically the same graphics, it is a closer match on effort than comparing the original creation of the first VN to the port.

Part of the reason RenPy is more efficient for this type of game is that it is designed to let you write your story as the program. IOW, you may remember that the Flash code to show a window of text required that I know which individual window I was at, added user variables and text formatting, and finally did the display and incremented the counter to take you to the next window. RenPy handles all of that behind the screens for you.

So while the flash block looks like:
F4Discuss.text = myCarla;
sayText = "Here it is, the dish you ordered.";
F4Discuss.appendText("\n" + sayText);
F4Discuss.setTextFormat(carlaText, 0, myCarla.length);
F4Discuss.setTextFormat(ditText, myCarla.length + 1, F4Discuss.text.length);
F4Discuss.addEventListener(MouseEvent.CLICK, nextText);

The exact same functionality in RenPy looks like:
c "Here it is, the dish you ordered."

I think you can see how that can simplify your coding effort :-)

Now, this is presuming you are trying to do the same thing in both. RenPy "knows" that the character name must be displayed, and to move forward on a click, and to move to the next line on that click. Obviously there are things you can do in Flash that you can't do in RenPy, because Flash doesn't require that you move to the next line on a click (for example). But my point is that when you are writing games, it is often worth trying to find an engine for your type of game, rather than use the generic programming environment. The time you lose in finding the tool can easily be regained and then some in the efficiency of coding the game itself.

If only there were a RenPy environment for the iPhone...

0 comments: