Why is my game slow?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
PyTom
Ren'Py Creator
Posts: 15437
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:

Why is my game slow?

#1 Post by PyTom » Sun Jan 14, 2018 3:56 pm

So, here's a new thing.

If your game skips a frame, I want to know why. It might be a problem with Ren'Py itself, or it might be a problem with your game. Either way, I'll want to track it down and figure out why.

Some rules:

0) Make sure the problem exists in the latest Ren'Py! 6.99.14 should massively improve performance.
1) Please prepare your game for me to look at by putting a jump from the start label to right before the problem.
2) Make a post here.
3) Send me your unpacked game. Either attach it here, or email it to pytom@bishoujo.us.

As part of this, I want to pick apart the programming styles that Ren'Py creators have been using, since I suspect some of them might contribute to speed problems. I'll suggest alternative ways of doing things, fix the engine - whatever it takes. While not every suggestion might be immediately applicable, my hope is that fairly soon we'll be able to stamp out styles of programming that make Ren'Py slow.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
Farryn
Regular
Posts: 33
Joined: Wed May 10, 2017 10:15 pm
Projects: Diplomatic Relations
IRC Nick: Farryn
Tumblr: princessdealtry
Contact:

Re: Why is my game slow?

#2 Post by Farryn » Sun Jan 14, 2018 6:58 pm

Sent you an email - thank you!

User avatar
Arowana
Miko-Class Veteran
Posts: 531
Joined: Thu May 31, 2012 11:17 pm
Completed: a2 ~a due~
Projects: AXIOM.01, The Pirate Mermaid
Organization: Variable X, Navigame
Tumblr: navigame-media
itch: navigame
Contact:

Re: Why is my game slow?

#3 Post by Arowana » Mon Jan 15, 2018 4:30 am

Thanks for doing this, it sounds really helpful! If you do figure out which programming styles that are causing performance issues, please let us know. I've gotten multiple reports of lag for my game, so I'm interested in tips for making it run more smoothly. :D

I do think that updating to 6.99.14 has helped, though some parts still occasionally seem slow. Would you be interested in taking a look even if the lag isn't consistently reproducible? I have some general ideas about which parts tend to lag more than others, but it seems to vary between machines and playthroughs.
Complete: a2 ~a due~ (music, language, love)
In progress: The Pirate Mermaid (fairytale otome)
On hold: AXIOM.01 (girl detective game)

Image

User avatar
PyTom
Ren'Py Creator
Posts: 15437
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: Why is my game slow?

#4 Post by PyTom » Mon Jan 15, 2018 1:04 pm

Yes, I can look even if it's not totally reproducible, within reason. I can look for things like unexpected disk access and garbage collection, as well as frames that are marginal on time.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
Arowana
Miko-Class Veteran
Posts: 531
Joined: Thu May 31, 2012 11:17 pm
Completed: a2 ~a due~
Projects: AXIOM.01, The Pirate Mermaid
Organization: Variable X, Navigame
Tumblr: navigame-media
itch: navigame
Contact:

Re: Why is my game slow?

#5 Post by Arowana » Mon Jan 15, 2018 8:25 pm

PyTom wrote:
Mon Jan 15, 2018 1:04 pm
Yes, I can look even if it's not totally reproducible, within reason. I can look for things like unexpected disk access and garbage collection, as well as frames that are marginal on time.
That would be great! I'll send you an email with my game. :)
Complete: a2 ~a due~ (music, language, love)
In progress: The Pirate Mermaid (fairytale otome)
On hold: AXIOM.01 (girl detective game)

Image

User avatar
zankizuna
Veteran
Posts: 406
Joined: Fri May 04, 2012 2:20 am
Projects: Softwar
Deviantart: raseru09
itch: ZanKizuna
Location: Manilaaaaaaaa
Contact:

Re: Why is my game slow?

#6 Post by zankizuna » Mon Jan 15, 2018 8:55 pm

Slow game coz my pic was like over 2000 pixels long and wide, but I kept zooming it down, while using LiveComposite

Corynth
Regular
Posts: 60
Joined: Thu Dec 01, 2011 7:59 am
Completed: Halloween Otome, Valentines Otome
Projects: Christmas Otome
Organization: Synokoria
Tumblr: synokoria
itch: synokoria
Contact:

Re: Why is my game slow?

#7 Post by Corynth » Tue Jan 16, 2018 2:01 am

Sent an email with our latest beta.
Thank you for taking the time to do this!

User avatar
trooper6
Lemma-Class Veteran
Posts: 3617
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: Why is my game slow?

#8 Post by trooper6 » Tue Jan 16, 2018 2:13 am

Hello PyTom! I'll send you an email with a link to my game...which has delays, dropped frames and is slow.
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

User avatar
Lena_Borodach
Regular
Posts: 93
Joined: Sun Nov 24, 2013 10:49 pm
Completed: 7 VN's so far
Contact:

Re: Why is my game slow?

#9 Post by Lena_Borodach » Mon May 21, 2018 1:51 pm

So glad you care, PyTom! Here is my example. Suffering a nasty lag trying to implement pixellation censorship.
UPD: Just received different and more effective approach from Remix. No longer the issue, i think ^^
Attachments
_mozaik.7z
(1.98 MiB) Downloaded 24 times
Look! It's moving. It's alive. It's alive... IT'S ALIVE! Oh, in the name of God! Now I know what it feels like to be God!(@Henry_Frankenstein. Sums up my coding style)

Czero
Newbie
Posts: 21
Joined: Sun Apr 15, 2018 1:44 pm
Contact:

Re: Why is my game slow?

#10 Post by Czero » Tue Jun 19, 2018 3:27 pm

Best of luck! :)
Visual novel lover and maker...

Works in progress: A Little Bit of Happiness viewtopic.php?f=59&t=54385

I'm looking for writing work viewtopic.php?f=63&t=50859

Flowersoft Gamedev
Newbie
Posts: 7
Joined: Fri Dec 28, 2018 6:02 am
Contact:

Re: Why is my game slow?

#11 Post by Flowersoft Gamedev » Wed Apr 03, 2019 6:48 am

My game become slow when I launch via launcher on renpy 7.2.0 but I attribute it to the large file size of the asset we use, but also maybe because of technical limitation on the PC we use.

Is this thread still active for the new release of the renpy program, or only for 6.9.... version?

xeesus
Newbie
Posts: 1
Joined: Mon Jun 24, 2019 3:53 pm
Github: xeesus
Contact:

Re: Why is my game slow?

#12 Post by xeesus » Mon Jun 24, 2019 5:29 pm

Is this still a thing? Either way, thanks for caring, as has been said before!

Our team has recently decided to update to 7.3 (from 6.9) and amongside some troubles caused by our own 'poor but working' code we've encountered a very interesting problem. Our gallery now works at 4 fps, although on all previous updates (tested on basically all versions from 6.99.14.1 to 7.2.2) it works at 144 or 60 fps. It uses a lot of python, most of which is probably inefficiently written and is likely the cause of the lag.

I've sent you an email with the game, thanks in advance for any help or advice and thanks for creating the Ren'Py engine in the first place!

trajano
Regular
Posts: 60
Joined: Sun Jun 16, 2019 7:59 pm
Github: trajano
Contact:

animations perhaps?

#13 Post by trajano » Sat Aug 03, 2019 3:26 am

xeesus wrote:
Mon Jun 24, 2019 5:29 pm

Our gallery now works at 4 fps, although on all previous updates (tested on basically all versions from 6.99.14.1 to 7.2.2) it works at 144 or 60 fps. It uses a lot of python, most of which is probably inefficiently written and is likely the cause of the lag.
@xeesus are you using a lot of animations? I am finding that large frequent animations can slow things down on Ren'py much more noticeable on a mobile device. I thought it was simply a problem of my mobile device being one year old already. However, I played the same large 30fps 1440p webm videos concurrently on a webview and it works well.

Post Reply

Who is online

Users browsing this forum: Google [Bot]