Ren'Py Patreon Articles

A place for Ren'Py tutorials and reusable Ren'Py code.
Forum rules
Do not post questions here!

This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
Message
Author
User avatar
PyTom
Ren'Py Creator
Posts: 16088
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Ren'Py Patreon Articles

#1 Post by PyTom »

A list of articles I've written for the Ren'Py patreon. These tend to be fairly in-depth articles on a current or upcoming feature, edited by a technical editor and open to the public. Articles are sponsor-only for the first 90 days, and then are open to the public as a whole. (So you'd generally expect the first three links below to only be visible to sponsors.)

https://www.patreon.com/renpytom/posts?tag=article

is the official index, but I'll link the topics here, newest on top.

October 2019 Distance to Start and End
September 2019 Notarizing Mac Applications
August 2019 Very Old Features

July 2019 Checking for and Displaying a Message
June 2019 Save Metadata
May 2019 Three Creator-Defined Statements
April 2019 Ren'Py Presentation Framework
March 2019 Ren'Py OS FAQ
February 2019 Menu Arguments Cookbook
January 2019 Under the Hood: Interactions
December 2018 Python Tricks #2
November 2018 Under the Hood: .rpyc Files
October 2018 Adding Google Analytics to your Visual Novel
September 2018 Android Adaptive Icons in Ren'Py 7.1
August 2018 Visual Novel Reading Room (and Launcher)
July 2018 Python Tricks #1
June 2018 Save on Quit
May 2018 Selecting Images to Show
April 2018 Layered Image Conversion
March 2018 Automatic Speech Bubbles
February 2018 Avoiding Framerate Glitches Caused By Image Prediction
January 2018 Title Screens
December 2017 Multiple Dialogue Block Cookbook
November 2017 News From Your Website - Now in Ren'Py
October 2017 Picking a Winner
September 2017 Right-side Menus
August 2017 Wiki-Like Glossary or Codex
July 2017 Shuffling Choice Menus
July 2017 Character Customization
June 2017 Custom Preferences
May 2017 Timed Choice Menus


I'm always looking for ideas on what to write about, so if you have something you want me to do a deep dive into, let me know. Note that a good article is a feature that could be used by games across all sorts of different genres - this isn't a place to ask for support or for something that would benefit your game alone. If you do propose an article topic, and you're not a sponsor, I'll send you the link early so you can check out the answer before the 90 days are up.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
Empish
Veteran
Posts: 221
Joined: Thu Jan 14, 2016 9:52 pm
Projects: Efemural Hearts, It Ends With Graduation
itch: empish
Contact:

Re: Ren'Py Patreon Articles

#2 Post by Empish »

Hey, this looks great! Yet another reason for me to become a sponsor when I can.

As for what to write about, I'd recommend something like a discussion of when you might need to use Python in Renpy, and when it's not necessary. I have seen plenty of using python functions when ATL would suffice, for example, and I've also seen plenty of people not knowing that things could be accomplished more easily using Python.

User avatar
LateWhiteRabbit
Eileen-Class Veteran
Posts: 1867
Joined: Sat Jan 19, 2008 2:47 pm
Projects: The Space Between
Contact:

Re: Ren'Py Patreon Articles

#3 Post by LateWhiteRabbit »

I actually just realized you have a Patreon today. :oops:

I don't know how I've missed the link in your signature until now. I'm definitely signing up when I get home tonight. Be nice to give back and support you after all you've done, and I could definitely use some of those tutorials.

User avatar
PyTom
Ren'Py Creator
Posts: 16088
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Ren'Py Patreon Articles

#4 Post by PyTom »

I figure I'll put a post here and see if it's interesting enough to cause some discussion. Today I added a new Sponsor exclusive article,
on Avoiding Framerate Glitches Caused By Image Prediction. It's an example of something that the sponsors let me write - a deep-dive on how image prediction works in Ren'Py.

I've also made available November's article, for everyone: News From Your Website - Now in Ren'Py

Feel free to discuss these updates in this thread.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
LateWhiteRabbit
Eileen-Class Veteran
Posts: 1867
Joined: Sat Jan 19, 2008 2:47 pm
Projects: The Space Between
Contact:

Re: Ren'Py Patreon Articles

#5 Post by LateWhiteRabbit »

PyTom wrote: Tue Feb 27, 2018 10:36 pm I figure I'll put a post here and see if it's interesting enough to cause some discussion. Today I added a new Sponsor exclusive article,
on Avoiding Framerate Glitches Caused By Image Prediction. It's an example of something that the sponsors let me write - a deep-dive on how image prediction works in Ren'Py.
That's awesome. You know this is a topic near and dear to my heart.

In reference to the last couple of paragraphs, I have noticed that with the newest builds of Ren'Py, Shadowplay freaks out when trying to measure framerate now. It actually causes The Question to hitch and stutter badly when running. Not that it matters much anymore, because the interactive performance has definitely improved.

I'm assuming at this point that the image prediction is mostly for mobile Ren'Py games? For desktop deployment, even if someone is running an integrated graphics card with only 4GB of system RAM, that means they've got 200 MB available for graphics processing. Long Live the Queen, Queen of Thieves, and Katawa Shoujou, all clock in well under that. Even Loren Amazon Princess with all DLC comes out to just 243 MB and that game has massive amounts of image files.

I'm just wandering if you can think of any reason not to use the "Load All the Things!" advice if a developer is targeting desktops. It seems like from a quick look around at the Ren'Py games on my computer that all could be run on even a 'potato' of a computer and still make use of the "Load All the Things!" method.

For that matter, even on mobile - I've got a super low-end Android smart phone (I literally purchased the cheapest Android phone I could find), and even it has 2GB RAM. I imagine even it would have the room to load everything and hold it in memory for games like Long Live the Queen that come in at a tiny 77 MB. High-end smart phones of this generation routinely have 6GB of ram, and the new crop of phones are going to be expanding to 8GB of ram.

The only downside I can see is a longer startup time when the game is first launched. Thoughts?

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3785
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Ren'Py Patreon Articles

#6 Post by Imperf3kt »

Since I aim to release things specifically for a Raspberry Pi, which has a miserable 1GB of RAM (which is shared with the VC4 GPU), I would say it warrants testing.
The Raspberry Pi is already quite fringe when it comes to performance and I attribute this to either the limited RAM or the beta experimental video accelleration.
I conclude this based on my mobile phone, which has the same CPU (Arm cortex A53) and clock speed (1190MHz per core) as a Raspberry Pi3b except it addresses 2GB of RAM and uses a Quallcom GPU. The difference in performance is similar to comparing a modern i3 with a Celeron D from the early 2000s.

Do you have any specific suggestions to try?
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
PyTom
Ren'Py Creator
Posts: 16088
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Ren'Py Patreon Articles

#7 Post by PyTom »

LWR>>>

The thing to realize is that the Ren'Py image cache uses the _uncompressed_ images, which take about 4 bytes per pixel. Not the compressed images, which might vary in size. This can be a big increase. The most extreme example of this is "images/bg panorama.webp", from the Ren'Py tutorial. It's 325.6 KB, compressed. But it's a 5842x720 image, totally opaque. Uncompressed, it takes 5842 * 720 * 4 bytes of memory - a little over 16 MB, for that one image. It's 45x bigger.

Now, that's an extreme example. But it shows why you have to think about this, rather than just loading all the things, at least on a moderately sized game.

Imperf3kt>>>
This doesn't seem to be the right thread to answer your question. I'd make sure that you have working OpenGL ES acceleration for Ren'Py, and that your RasPi is set up to use it.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3785
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Ren'Py Patreon Articles

#8 Post by Imperf3kt »

Sorry, I should have specified my reply was a direct reply to LateWhiteRabbit and asking about the sorts of games that work well on a low spec Android so I could compare performance, but if, as you say, Ren'Py caches uncompressed files, then the whole trial is moot.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
LateWhiteRabbit
Eileen-Class Veteran
Posts: 1867
Joined: Sat Jan 19, 2008 2:47 pm
Projects: The Space Between
Contact:

Re: Ren'Py Patreon Articles

#9 Post by LateWhiteRabbit »

PyTom wrote: Thu Mar 01, 2018 1:51 am LWR>>>

The thing to realize is that the Ren'Py image cache uses the _uncompressed_ images, which take about 4 bytes per pixel. Not the compressed images, which might vary in size. This can be a big increase. The most extreme example of this is "images/bg panorama.webp", from the Ren'Py tutorial. It's 325.6 KB, compressed. But it's a 5842x720 image, totally opaque. Uncompressed, it takes 5842 * 720 * 4 bytes of memory - a little over 16 MB, for that one image. It's 45x bigger.

Now, that's an extreme example. But it shows why you have to think about this, rather than just loading all the things, at least on a moderately sized game.
Thanks, I knew there was something I was probably missing in the equation.

I'll be mindful about how much I force to preload into the image cache then. My machine has 32 + 8 GB of RAM at its disposal (I like to have "All the Things Loaded" at once :lol: ), so I can't use it as a typical test case. I'll have to get people on less powerful desktops to test to see where the preload sweet spot is.

User avatar
PyTom
Ren'Py Creator
Posts: 16088
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Ren'Py Patreon Articles

#10 Post by PyTom »

Also, right now Ren'Py is limited to 2GB of RAM on windows, since it's running in 32-bit mode.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

odysseus93
Newbie
Posts: 19
Joined: Sun Feb 03, 2013 10:52 am
Contact:

Re: Ren'Py Patreon Articles

#11 Post by odysseus93 »

Mmm. Will the 32-bit mode be upgraded to 64 anytime soon? Just curious...

User avatar
PyTom
Ren'Py Creator
Posts: 16088
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Ren'Py Patreon Articles

#12 Post by PyTom »

(This is getting off-topic.)

Maybe. It's something that I sort of want to do - but at the same time, I think there are still a few 32-bit systems out there, and I don't want to get into a place where we drop support for 32-bit windows before other major apps do. (I tend to use Chrome as a guide to what should be supported.) At the same time, a 64-bit Ren'Py would work better in several ways, thanks to the monstrosity that is the mix of 32- and 64-bitness on Windows.

It probably makes sense to design for 2GB of RAM, since mobile devices and low-end computers with 4GB are still a thing.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

odysseus93
Newbie
Posts: 19
Joined: Sun Feb 03, 2013 10:52 am
Contact:

Re: Ren'Py Patreon Articles

#13 Post by odysseus93 »

Cool. Sorry about dragging the topic off a little. Keep up the good work...

User avatar
PyTom
Ren'Py Creator
Posts: 16088
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Ren'Py Patreon Articles

#14 Post by PyTom »

Since last month's article had some nice feedback, I'll post this month's updates here as well. The new sponsor-only article is Automatic Speech Bubbles, while December's Multiple Dialogue Block Cookbook is free for everyone to take a look at it.

As always, feel free to talk about these here, and I'll answer any questions you might have.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
Alex
Lemma-Class Veteran
Posts: 3090
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Ren'Py Patreon Articles

#15 Post by Alex »

Thanks for the articles PyTom!

Post Reply

Who is online

Users browsing this forum: No registered users