Optimizing my game for web?

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
ynneblack
Newbie
Posts: 4
Joined: Thu May 18, 2017 10:46 am
Deviantart: ynne-black
Contact:

Optimizing my game for web?

#1 Post by ynneblack »

Hello! I just finished a game in Ren'py (Dream Avatar) and used the beta builder for web. (Which is excellent and I am very excited about the options it opens up!!) It is a short game (it's for Ludum Dare), but about twice as large (content-wise) than my previous one. The smaller game runs smoothly when I play it in my browser, but this new one doesn't.

My internet is OK for playing browser games (I'm aware Ren'py is not primarily web-based so it simply cannot be as optimized as games that were built for web in the first place) so that shouldn't be a big factor, but I did not get to test it anywhere else yet.

The issues, from the little play-testing I did, were mainly:
  • music stops/stutters
  • text freezes or stops loading and then loads all at once
And here are the things I did to make the game as small as possible:
  • non-transparent images are JPG, compressed and are the exact size needed
  • transparent images are PNG, compressed and are the exact size needed
  • repetitive GUI elements are the same (game_menu/main_menu, some pop-up frames, etc.)
  • sound files are OGG, compressed and trimmed to a reasonable length
  • it was never intended for phone so I got rid of all phone-related sections & deleted unused History screen
With that, the web ZIP file went from 25.1 MB to only 13.6 MB.

So now my question is, what else could I do to make my game run faster in browser?

If anyone has any tips or ideas or experience, I would be really interested in hearing it & thanks so much in advance!

rayminator
Miko-Class Veteran
Posts: 793
Joined: Fri Feb 09, 2018 12:05 am
Location: Canada
Contact:

Re: Optimizing my game for web?

#2 Post by rayminator »

the web option in in beta right now so there be problems and it's at you own risk for using it

so here something thing you can do

1. check all code that you have used and make sure it's compatible with all browsers some python is not compatible with some browsers

2. by going here viewtopic.php?f=8&t=20031 and send in your raw game to PyTom it might help in the next release

Edit:

if renpy will work on the web maybe this will help that's a maybe not tested you can use a html format embed your music files or images

this for music
https://developer.mozilla.org/en-US/doc ... ment/audio

this is for images
https://developer.mozilla.org/en-US/doc ... lement/img
Last edited by rayminator on Wed Oct 09, 2019 10:35 am, edited 1 time in total.

User avatar
isobellesophia
Miko-Class Veteran
Posts: 979
Joined: Mon Jan 07, 2019 2:55 am
Completed: None
Projects: Maddox and Friends! (AI Teacher friend), Friendly Universities! (Soon)
Organization: Friendly Teachers series
Deviantart: SophBelle
itch: Child Creation
Location: Philippines, Mindanao
Contact:

Re: Optimizing my game for web?

#3 Post by isobellesophia »

Most likely you need the very lastest version as said above, or maybe because it was in beta version, all you need to do is,


Double check the music code and try some things that can be tested or can be worked.
Edit the text speed and text transition (Dunno if that works.)
The quality of your game.


Maybe that's all, because if your game is large, phone users cannot handle it. PC can be done.
I am a friendly user, please respect and have a good day.


Image

Image


ynneblack
Newbie
Posts: 4
Joined: Thu May 18, 2017 10:46 am
Deviantart: ynne-black
Contact:

Re: Optimizing my game for web?

#4 Post by ynneblack »

rayminator wrote: Wed Oct 09, 2019 7:56 amif renpy will work on the web maybe this will help that's a maybe not tested you can use a html format embed your music files or images

this for music
https://developer.mozilla.org/en-US/doc ... ment/audio

this is for images
https://developer.mozilla.org/en-US/doc ... lement/img
I know it is in beta as I say in my OP, I am just looking for ways (if there are any) to improve it on my end!
Since it is auto-compiled for the web, I am not 100% sure how to use the embedding of music and images? (I know how to do it for regular web page, just not in this context.) When and where would you put it there? The index.html doesn't contain my script, that seems to stay in the .rpy file, but the inserting of music and images is defined in the script.
Thank you for your time!
isobellesophia wrote: Wed Oct 09, 2019 10:25 amMost likely you need the very lastest version as said above, or maybe because it was in beta version, all you need to do is,

Double check the music code and try some things that can be tested or can be worked.
Edit the text speed and text transition (Dunno if that works.)
The quality of your game.

Maybe that's all, because if your game is large, phone users cannot handle it. PC can be done.
Thank you for taking the time to reply! I have the latest version, and it is just for PC as stated above, I do agree with you that making it work for phones would be a whole another issue. :) What do you mean by "Double check the music code and try some things that can be tested or can be worked."? I suppose I could try making the text speed slower, but that won't help when people click for it to load automatically... hm. I will look into getting rid of transitions for the web built, thanks again!

*

Also, since analytics say people are clicking the link and checking the game, could anyone else, please, tell me whether it is slow on your end as well? c:

User avatar
isobellesophia
Miko-Class Veteran
Posts: 979
Joined: Mon Jan 07, 2019 2:55 am
Completed: None
Projects: Maddox and Friends! (AI Teacher friend), Friendly Universities! (Soon)
Organization: Friendly Teachers series
Deviantart: SophBelle
itch: Child Creation
Location: Philippines, Mindanao
Contact:

Re: Optimizing my game for web?

#5 Post by isobellesophia »

Actually, people can make the text fast and the preference menu if they wanted, about checking the music, you need to check about their code placement in the script. (It is up to you since you made the game).
I am a friendly user, please respect and have a good day.


Image

Image


ynneblack
Newbie
Posts: 4
Joined: Thu May 18, 2017 10:46 am
Deviantart: ynne-black
Contact:

Re: Optimizing my game for web?

#6 Post by ynneblack »

isobellesophia wrote: Wed Oct 09, 2019 9:20 pm Actually, people can make the text fast and the preference menu if they wanted, about checking the music, you need to check about their code placement in the script. (It is up to you since you made the game).
I got rid of transitions as per your previous suggestion, and I advised people to speed up the text if it loads slowly for them. :) Thanks! Might still make it the default later.
So now the main issue is still the slow/jumpy music, I double-checked and it is placed correctly and plays perfectly fine in downloadable version, but if I made the sound files even smaller (lower quality), it starts to sound bad. :/

User avatar
isobellesophia
Miko-Class Veteran
Posts: 979
Joined: Mon Jan 07, 2019 2:55 am
Completed: None
Projects: Maddox and Friends! (AI Teacher friend), Friendly Universities! (Soon)
Organization: Friendly Teachers series
Deviantart: SophBelle
itch: Child Creation
Location: Philippines, Mindanao
Contact:

Re: Optimizing my game for web?

#7 Post by isobellesophia »

Hmm.. maybe recreate your music? Maybe you were using mp3 or wav, try ogg.
I am a friendly user, please respect and have a good day.


Image

Image


rayminator
Miko-Class Veteran
Posts: 793
Joined: Fri Feb 09, 2018 12:05 am
Location: Canada
Contact:

Re: Optimizing my game for web?

#8 Post by rayminator »

don't forget one thing it is still in beta so the sound might not be working at 100% right now

and isobellesophia he did say that he is using ogg format

can you post your code that you might think that's not work right we might be able to help you better

User avatar
isobellesophia
Miko-Class Veteran
Posts: 979
Joined: Mon Jan 07, 2019 2:55 am
Completed: None
Projects: Maddox and Friends! (AI Teacher friend), Friendly Universities! (Soon)
Organization: Friendly Teachers series
Deviantart: SophBelle
itch: Child Creation
Location: Philippines, Mindanao
Contact:

Re: Optimizing my game for web?

#9 Post by isobellesophia »

ynneblack wrote: Thu Oct 10, 2019 1:14 pm
isobellesophia wrote: Wed Oct 09, 2019 9:20 pm Actually, people can make the text fast and the preference menu if they wanted, about checking the music, you need to check about their code placement in the script. (It is up to you since you made the game).
I got rid of transitions as per your previous suggestion, and I advised people to speed up the text if it loads slowly for them. :) Thanks! Might still make it the default later.
So now the main issue is still the slow/jumpy music, I double-checked and it is placed correctly and plays perfectly fine in downloadable version, but if I made the sound files even smaller (lower quality), it starts to sound bad. :/

Just to ask, maybe the internet connection is slow? Maybe that is why music is slowing or perhaps in weird sound.

In addition, it must be some sort kind of a bug, if it is, you can report it to the creator of the RenPy web.
I am a friendly user, please respect and have a good day.


Image

Image


Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot]