Any Open Renpy Games I can learn from?

Fuku95

Newbie
Jul 27, 2023
55
23
I've played Ren'py games here and there. Since I'm interested in game development, does anyone know of any Renpy games that have their files open so I can learn from them? Having numerous ones with different play styles will help me out. Almost all the games I come across frome Renpy are encrypted.

So far I only came across one that wasn't. Summer with Brina. However I need more to learn from.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,382
15,290
Just a warning, learning from other games also imply that you'll possibly learn stupid things. There's (alas) still a lot of developer who have no idea about what they are doing, and write ugly broken code.

This mean that you should focus on learning the logic behind the mechanism you want to use, more than on learning the code to implement that logic.
 

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,583
2,224
General rule of thumb:

Avoid learning from any game that starts with something that looks like:

Python:
init:
    $ myvariable1 = 0
    $ myvariable2 = 0
    $ myvariable3 = 0
    $ myvariable4 = 0
    $ li1_love = 0
    $ li1_hate = 0
    $ li1_corruption = 0
    $ li2_love = 0
    $ li2_hate = 0
    $ li2_corruption = 0
    $ li3_love = 0
    $ li3_hate = 0
    $ li3_corruption = 0

-or-

Python:
init python:
    myvariable1 = 0
    myvariable2 = 0
    myvariable3 = 0
    myvariable4 = 0
    li1_love = 0
    li1_hate = 0
    li1_corruption = 0
    li2_love = 0
    li2_hate = 0
    li2_corruption = 0
    li3_love = 0
    li3_hate = 0
    li3_corruption = 0

Look for games that would code it like:

Python:
default myvariable1 = 0
default myvariable2 = 0
default myvariable3 = 0
default myvariable4 = 0
default li1_love = 0
default li1_hate = 0
default li1_corruption = 0
default li2_love = 0
default li2_hate = 0
default li2_corruption = 0
default li3_love = 0
default li3_hate = 0
default li3_corruption = 0

It's a tiny thing, but to my mind it is a good way of spotting games written by those developers who just copy/paste code from some other game without really understanding WHY things are coded like they are.

As I understand it, default was added as a solution to developers who didn't really understand when variables would and wouldn't be included in the save files. Developers would "fix" something in an earlier release and break their entire game. It's one of the reasons why you'd see "This version is not compatible with saves from version x.y and older".

This thing is, by that point - there were a lot of big title games already out there, using the "old" style of coding variables. And because those games were successful (although not very well written in some cases), people would "borrow" code from them or at least try to use them to understand what they should be doing. It was the blind leading the blind.

Anyway, whilst default doesn't guarantee a well written or structured game, it does at least show someone understood one of the basics of writing RenPy code.
 

aereton

Digital Hedonist Games
Game Developer
Mar 9, 2018
435
858
The previous tips are very good, however maybe someone who already decompiled some RenPy projects would post some examples of passably well written games, as I doubt someone who wants to learn from established projects can differentiate between clean and messy code examples.

I'd do it but I haven't touched any strangers yet.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,382
15,290
Because it's a good idea

Avoid learning from any game that starts with something that looks like:

Python:
init:
    $ myvariable1 = 0
    $ myvariable2 = 0
    $ myvariable3 = 0
-or-

Python:
init python:
    myvariable1 = 0
    myvariable2 = 0
    myvariable3 = 0
Regarding variable declaration, this too is bad practice:

Python:
label whatever:
    $ myvariable1 = 0
    $ myvariable2 = 0
    $ myvariable3 = 0

And of course, there's this that is a really bad omen:
Python:
default MC = Character( "mc" )
Variables that are constants shouldn't be savable.


On the same topic there's still some who are doing that kind of error:
Python:
define mc = Character( "[mc]" )

label start:

    "What's name do you want to use"
    $ mc = input( "Your name" )

Should also be added the (still too frequent):
Python:
label whatever:
    show screen whatever
    pause
    jump whatever
And its variations (there's too many to present them all).
The dev want a blocking screen that will wait for the player input, but neither use the , nor the syntax, that are made for this.


The use of show imageName when all the CGs are full screen.
Not understanding the difference between and , while they are the basis of any Ren'Py game is a really bad omen.


Talking about bad omen, the use of without related is also a strong one.
It's perfectly possible, and totally legit, to have the return in another label:
Python:
label whatever:
    [...]
    call calledLabel

label calledLabel:
    [...]
    if someCondition:
        jump subCalled1
    else:
        jump subCalled2

label subCalled1:
    [...]
    return

label subCalled2:
    [...]
    return
But it must always be ended by a return.

Doing so show a strong misunderstanding of how the game flow works.


Also a bad omen are games that copy/paste a big part of their code because of a small variation, especially when it regard the CGs:
Python:
label whatever:
    menu:
        "what swimsuit should she wear ?"
        "The red one":
            jump beachRed
        "The green one":
            jump beachGreen

label beachRed:
    scene beach001red
    girl "Wow, it's beautiful here."
    [...]

label beachGreen:
    scene beach001green
    girl "Wow, it's beautiful here."
    [...]
Here it's more excusable, but it's also not really difficult to find information on how to avoid this. It's been years that people promote the right way, and there's many games displaying it, some being already more than 5 years old.


More subtle, and so alas harder to catch, screens that handle all the action and update themselves for a long period are also to avoid.
 
  • Red Heart
Reactions: 79flavors
Sep 16, 2019
491
1,935
I'm not a developer but if I may make a recommendation, check out Game Developer Training channel on YouTube, he has a Renpy Master Class series that should be helpful.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,382
15,290
I'm not a developer but if I may make a recommendation, check out Game Developer Training channel on YouTube, he has a Renpy Master Class series that should be helpful.
Okay...

I just took a look at . It's one month old, and the code is:
Python:
label start:
    [...]
    while playing:
        $ UIreturn = renpy.call_screen( "mainUI" )
        if UIreturn == "dead":
            return
        [...]
And just this is enough to tell me that this guy don't know shit about Ren'Py !

Would he had opened the official documentation, that is available online, but also come with Ren'Py SDK into the "doc" directory, he would have found the . And then, he would have read the two first lines:
"The call screen statement shows a screen, and then hides it again at the end of the current interaction. If the screen returns a value, then the value is placed in _return."
 

osanaiko

Engaged Member
Modder
Jul 4, 2017
2,302
3,968
I have to second the criticism of Game Developer Training Renpy videos. (I won't comment on any other of the vids as I have not watched them. Although the Gell-Mann Amnesia effect suggests they might also be sus.)

I recently watched "Let's Code 4" series. The only good thing I can say about it is that it resulted in a game that appeared to work. But the style of the development made me shake my head.

I don't want to sit through it again to find specific examples, but stuff like making up random lists of class properties without planning the game design was painful and doomed. The mishmash of actions and effects and costs and energy points would result in a awful game design that belongs in the Flash era. The swing between early episodes making detailed directory structures for separating concerns and then in later ones just throwing all sorts of unrelated code together into a single file. The constant random capitalization/underscores vs snake case - why would you not just be CONSISTENT and not have to always refer back to check how you spelled a variable!!

Thundorn's code would not have survived a code review from me without a lot of grumpy comments, and probably a note to his mentor.

Maybe I should cut some slack as there is no one else putting out similar "non beginner" renpy video content. But honestly, it's not a great example to learn from.
 

Count Morado

Conversation Conqueror
Respected User
Jan 21, 2022
7,200
13,481
Isn't there a Ren'Py Tutorial already on the Ren'Py site? Would that be a bad place for the person to actually learn from?
 

Boarborn

Newbie
Apr 11, 2022
85
85
this seems like the good old purist versus practical programming to me
with a c++ background, pythonists has always attacked me i'm not pythonic, which i don't care since my code works and i get paid

here the case of 'default' is a real lesson, i would certainly adopt that if i use renpy
the other ones look like renpy purism
 
  • Like
Reactions: Turning Tricks