[Suggestion] Webp Support

Would you like webp support?


  • Total voters
    13

Dope

Veteran
Veteran
Joined
May 29, 2017
Messages
132
Reaction score
16
First Language
English
Primarily Uses
RMMV
Webp Support
  • The ability to use webp images with windows/ mac os games. Web browser support can be added in the future if possible.

Mockups:
There isn't any work that needs to be done in the editor. It just needs to be able to recognize webp images the same way it does png.

Why is this feature good?
This feature is great because of the following:
  • Webp images use far less space than png images, with minor to no noticeable loss in image quality.

Possible issues with this feature?
Issues that might arise from this feature:
  • Uh, none?
  • Wait, waiiiiit, people that make games for web browsers might be jelly. Discus that with your browser manufacturer tho.
 
Last edited:

rpg_el

Veteran
Veteran
Joined
Sep 3, 2020
Messages
83
Reaction score
35
First Language
English
Primarily Uses
RMMZ
MZ has a web export though, and it seems like Safari is only adding WebP support just now. While I think Apple updates users on most not ancient devices fairly quickly, it should probably be a consideration of how many will be left behind by this. So this could be a problem in that regard.
 

Dope

Veteran
Veteran
Joined
May 29, 2017
Messages
132
Reaction score
16
First Language
English
Primarily Uses
RMMV
MZ has a web export though, and it seems like Safari is only adding WebP support just now. While I think Apple updates users on most not ancient devices fairly quickly, it should probably be a consideration of how many will be left behind by this. So this could be a problem in that regard.
"Web export" isn't exactly going to do what I need. I'm not trying to export the game to play on the web, I simply want the engine to be able to read/recognize webp images. Apple devices can already display webp images, the MV version of my game worked just fine on macs and displayed webp images in game with no problems. Through a plugin, but it worked. I'm also not sure how anybody would be "left behind" because I'm not purposing they remove png support, just add webp support. Nothing is being taken away, a new feature would just be added. I'm not seeing the potential problem.
 

rpg_el

Veteran
Veteran
Joined
Sep 3, 2020
Messages
83
Reaction score
35
First Language
English
Primarily Uses
RMMZ
"Web export" isn't exactly going to do what I need
I brought it up because other people are going to use it. And Apple devices can not display WebP when it's via Safari in a website, at least until recently, which affects web export only. The way you tested worked because nw.js is based on Chromium which supports WebP even in its MacOS version, which wouldn't apply for a web exported website game.

I'm not seeing the potential problem.
The problem is that RPG Maker wouldn't usually allow importing resources that just don't work via some common export approaches. So yes, adding this would possibly take that protection away.

As I already said above this might change soon with new Safari updates anyway, I was just pointing out it should be investigated to see what the actual numbers are of who would be possibly affected, and consider whether that is small enough to do it anyway.
 
Last edited:

Alexandr_7

Veteran
Veteran
Joined
Apr 22, 2016
Messages
106
Reaction score
29
First Language
Russian
Primarily Uses
1. Are you sure browsers support WebP. I doubt it. Considering that projects on mz are web games, it will be problematic to implement support for a format that will not work on all platforms.
2. In general, KADOKAWA somehow got rid of m4a so as not to use 2 music formats, and you suggest adding WebP to the png format, which will obviously have problems and obviously will not eliminate the need to use png
 

ロリ先輩

ロリだけど先輩だよ
Veteran
Joined
Mar 13, 2012
Messages
379
Reaction score
96
Primarily Uses
webp is supported in iOS 14, and will come to Mac OS later with the Big Sur release.

This means that it is not backwards compatible with older version of iOS, since either in the iOS web view or the iOS browser on iOS 13 and older, it will not be supported.
 

Dope

Veteran
Veteran
Joined
May 29, 2017
Messages
132
Reaction score
16
First Language
English
Primarily Uses
RMMV
I appreciate the comments on browser support. Honestly, when I posted this I wasn't thinking about web export so it's an unexpected discussion that I suppose needs to happen. That said, the issues pertaining to web browser deployment and the issues, or lack thereof, pertaining to windows/mac os deployment are two separate things and shouldn't be mixed. At least in my opinion.

Macs can play games and display webp images. I know this for a fact as I've been doing it with MV for years. I'm not sure what version the OS is but I haven't updated it in a while. I don't really know about Safari displaying webp images though as I've never tried.

But seriously. You've kinda derailed my original thought. That's ok though. Discussions happen. I'm all for that. In any event, to keep things on track I'll make a slight modification to my original post.

I would like webp support for MZ to be used in conjunction with windows/mac os deployment. That is to say, web browser deployment is not supported with webp but could be in the future if web development allows for it. Problem solved.
 

rpg_el

Veteran
Veteran
Joined
Sep 3, 2020
Messages
83
Reaction score
35
First Language
English
Primarily Uses
RMMZ
MZ resolved the problem that audio needed to be in different formats depending on export approach. (MV needed m4a for iOS, ogg for Android, ...) Your suggestion would however reintroduce something similar, which I personally would think is a step back - unless MZ would automatically convert to a supported format if I pick another export option. But that seems a lot of hassle when the current image formats work mostly fine.
 

Dope

Veteran
Veteran
Joined
May 29, 2017
Messages
132
Reaction score
16
First Language
English
Primarily Uses
RMMV
MZ resolved the problem that audio needed to be in different formats depending on export approach. (MV needed m4a for iOS, ogg for Android, ...) Your suggestion would however reintroduce something similar, which I personally would think is a step back - unless MZ would automatically convert to a supported format if I pick another export option. But that seems a lot of hassle when the current image formats work mostly fine.
I disagree. I don't really see it as introducing a problem. I mean I get what you're saying, but I still disagree.

It's like this, a dev could set an event to auto run somewhere in their game and said event could crash/freeze the game because it should've been parallel not auto run. But just because the improper use of an auto run event can freeze a game doesn't mean I think the ability to make auto run events should be removed.

It's the same with webp, or file formats in general, to me. The game developer should understand the platform that they are developing on. Should Kadokawa implement this feature and people start deploying games for browser, then it's the devs responsibility to make sure that the browser can display their game properly.

As the software developer, Kadokawa should be in the business of give the game developer all the tools they can in order for developers to develop games. But at the same time, it's not Kadokawa's responsibility to babysit users in using said tools. FAQs are fine. Forums are lovely. But don't limit my choices because somebody else might mess something up. It makes no sense to limit/deny a feature when the "problem" only affects 1/5 people. Windows Deployment is fine. Mac Deployment is fine. Browser Deployment on windows is fine. Browser Deployment for mac is iffy, if you use Safari. If not, it's probably fine.

Webp works for every conceivable form of deployment except on Safari. Currently. That's not a webp "problem". That's a Safari problem, which might not even be an issue in the future, and shouldn't be an excuse to block a feature for everybody but Safari developers. No, seriously, you're basically saying a person shouldn't be allowed to do something because given the choice another person may try to do the same thing and F it up. What?
 

Archeia

Level 99 Demi-fiend
Developer
Joined
Mar 1, 2012
Messages
15,138
Reaction score
15,462
First Language
Filipino
Primarily Uses
RMMZ
This might be hard to support because not every browser or device supports this either:

Opera and Chrome are browser that can both view WebP images and officially accepts the image/webp content type. In summary, Opera and Chrome are supporting webp, and Mozilla is taking a closer look.
- Oct 14, 2020
As of September 2020 the latest news I can found about WebP
1603463241712.png
 

casper667

Casper Gaming
Veteran
Joined
Mar 15, 2012
Messages
224
Reaction score
309
First Language
English
Primarily Uses
RMMZ
Just wanted to add but if you want to see what all supports what, "caniuse.com" is a great resource for anything related to what you can use in what browser/version. Since RPG Maker is web based, it is also useful for RPG Maker development. Now obviously you don't need 100% support for something before switching. No one cares that RPG Maker games can't run on IE 6, for example. But Apple's Safari is a pretty major browser still widely used so it should be considered when looking at what is all supported.

webp:

all things supported in each browser:

You can also see the successor to webp "AVIF" which has even better file sizes, about half the size of webp on average, but much worse support across browsers. Unfortunately support varies greatly across browsers, and always has, and likely always will. That's just the nature of web dev. Since RM can be embedded directly in websites in an officially supported manner, it is also the nature of RM dev. If rpg maker should support webp, should it also support AVIF or some other image formats that someone might want to use?

As for the OP, I do not think webp should be supported baseline as you'll get a lot of people wondering why their web deployment doesn't work on their iphone's browser. If you want to optimize image size for your game and you know it won't be played in safari browser, you can use a plugin to switch to webp. There are many optimizations you could make in many areas depending on where you deploy. The default RM imo should be a "best-fit" for all possible deployments and right now that is png for images. If you want to optimize for a certain environment, you can do that with RM just as you would do it in Unity or other game/app dev engines.

If you want to use webp, you should be able to paste this in your plugins (or find the same function in rmmz_managers.js and change the extension from ".png" to ".webp"):
Code:
ImageManager.loadBitmap = function(folder, filename) {
    if (filename) {
        const url = folder + Utils.encodeURI(filename) + ".webp";
        return this.loadBitmapFromUrl(url);
    } else {
        return this._emptyBitmap;
    }
};
I just tested it real quick with the title screen but it seemed to work for that so should work elsewhere as well.
 

Archeia

Level 99 Demi-fiend
Developer
Joined
Mar 1, 2012
Messages
15,138
Reaction score
15,462
First Language
Filipino
Primarily Uses
RMMZ
Just wanted to add but if you want to see what all supports what, "caniuse.com" is a great resource for anything related to what you can use in what browser/version. Since RPG Maker is web based, it is also useful for RPG Maker development. Now obviously you don't need 100% support for something before switching. No one cares that RPG Maker games can't run on IE 6, for example. But Apple's Safari is a pretty major browser still widely used so it should be considered when looking at what is all supported.
I was looking for that site but had no luck so I had to rely on latest articles LOL.; And yes, I am aware, that's why I always check for web browser support first if it's worth supporting already. We don't want premature implementation of features.
 

Alexandr_7

Veteran
Veteran
Joined
Apr 22, 2016
Messages
106
Reaction score
29
First Language
Russian
Primarily Uses
MZ resolved the problem that audio needed to be in different formats depending on export approach. (MV needed m4a for iOS, ogg for Android, ...) Your suggestion would however reintroduce something similar, which I personally would think is a step back - unless MZ would automatically convert to a supported format if I pick another export option. But that seems a lot of hassle when the current image formats work mostly fine.
As far as I know, browsers support ogg. Plus, neither MV nor MZ has precise Android / IOS support. Only through the browser which many support ogg. Even if you port it, it will still work through a browser and a local server.
 

Dope

Veteran
Veteran
Joined
May 29, 2017
Messages
132
Reaction score
16
First Language
English
Primarily Uses
RMMV
Just wanted to add but if you want to see what all supports what, "caniuse.com" is a great resource for anything related to what you can use in what browser/version. Since RPG Maker is web based, it is also useful for RPG Maker development. Now obviously you don't need 100% support for something before switching. No one cares that RPG Maker games can't run on IE 6, for example. But Apple's Safari is a pretty major browser still widely used so it should be considered when looking at what is all supported.

webp:

all things supported in each browser:

You can also see the successor to webp "AVIF" which has even better file sizes, about half the size of webp on average, but much worse support across browsers. Unfortunately support varies greatly across browsers, and always has, and likely always will. That's just the nature of web dev. Since RM can be embedded directly in websites in an officially supported manner, it is also the nature of RM dev. If rpg maker should support webp, should it also support AVIF or some other image formats that someone might want to use?

As for the OP, I do not think webp should be supported baseline as you'll get a lot of people wondering why their web deployment doesn't work on their iphone's browser. If you want to optimize image size for your game and you know it won't be played in safari browser, you can use a plugin to switch to webp. There are many optimizations you could make in many areas depending on where you deploy. The default RM imo should be a "best-fit" for all possible deployments and right now that is png for images. If you want to optimize for a certain environment, you can do that with RM just as you would do it in Unity or other game/app dev engines.

If you want to use webp, you should be able to paste this in your plugins (or find the same function in rmmz_managers.js and change the extension from ".png" to ".webp"):
Code:
ImageManager.loadBitmap = function(folder, filename) {
    if (filename) {
        const url = folder + Utils.encodeURI(filename) + ".webp";
        return this.loadBitmapFromUrl(url);
    } else {
        return this._emptyBitmap;
    }
};
I just tested it real quick with the title screen but it seemed to work for that so should work elsewhere as well.
Thanks for your post, super informative! Will absolutely try this!

That said, I get and totally understand what people are saying. Webp definitely has some issues when it comes to browsers, I completely agree. The thing is though, I don't think it's fair to say we're not going to allow one group to do something because another can't. Especially when considering that webp development has nothing to do with Kadokawa and they can't make browsers support it even if they wanted to.

The way I look at it is this, if the software has options and can handle it in house, that is if the program can make an exe, or whatever macs use, and have that program run fine, then those options should be allowed for people to use. Web development is constantly in flux, how are you going to use that as the standard as what to allow and not allow rpg maker to do? It just seems unreasonable. I mean webp support on browsers has 0 to do with Kadokawa. Will be looking into this avif format too. Good stuff!

Edit: I tried that code and it works! However, I'd need to replace all the basic png files with webp files, which I could do but... is there any way to have the code

Code:
ImageManager.loadBitmap = function(folder, filename) {
    if (filename) {
        const url = folder + Utils.encodeURI(filename) + ".webp";
        return this.loadBitmapFromUrl(url);
    } else {
        return this._emptyBitmap;
    }
};
add webp recognition instead of replacing png?
 
Last edited:

Archeia

Level 99 Demi-fiend
Developer
Joined
Mar 1, 2012
Messages
15,138
Reaction score
15,462
First Language
Filipino
Primarily Uses
RMMZ
how are you going to use that as the standard as what to allow and not allow rpg maker to do? It just seems unreasonable. I mean webp support on browsers has 0 to do with Kadokawa. Will be looking into this avif format too. Good stuff!
RPG Maker games are web games (HTML5). Browsers are important.
 

Dope

Veteran
Veteran
Joined
May 29, 2017
Messages
132
Reaction score
16
First Language
English
Primarily Uses
RMMV
RPG Maker games are web games (HTML5). Browsers are important.
I understand what you, and people who echo your sentiment, are saying. But you all do not seem to be understanding what I am saying.

Lets strip everything away and look at the basic premise of what I'm asking. I am asking for a piece of software to be added a feature. The end. Adding this feature does not detract or take away from any other feature and every other feature will still function as intended with the addition of the new feature. The new feature is simply an addition to the software. No more. No less.

That being the case, some people are arguing against the addition of said feature because it may not work for a specific subset of people. Aside from the fact that the issue created would be an external one, not internal, the issue could still be amended by placing a disclaimer noting that their game may or may not work on specific browsers. But ignoring that, yes RPG Maker makes web games but it also makes executable games. What about those developers? F them, right?

Look, I get what people are saying, I understand the issues they have. But as far as I'm concerned, arguing against the proposition is selfish because there are no problems created on the software side. It's not my fault webp isn't supported on some browsers and my development shouldn't be limited because of that fact. If there was a feature that was beneficial for web development, but as an OS developer I tried to block it when it had no recourse on what I was doing, how would that look?
 

Archeia

Level 99 Demi-fiend
Developer
Joined
Mar 1, 2012
Messages
15,138
Reaction score
15,462
First Language
Filipino
Primarily Uses
RMMZ
Adding features need to take into consideration the benefits, cost and what it meant for customer support. That's all I'll say.
 

Dope

Veteran
Veteran
Joined
May 29, 2017
Messages
132
Reaction score
16
First Language
English
Primarily Uses
RMMV
Adding features need to take into consideration the benefits, cost and what it meant for customer support. That's all I'll say.
That's fair. But while I've got your attention... thanks to you and everybody else at VisuStella for all your work :)
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,238
Reaction score
7,618
First Language
German
Primarily Uses
RMMV
because there are no problems created on the software side.
unfortunately that is only an assumption, not a fact.

quite on the contrary I can think of several problems that are created on the software side by this proposition.

first, as soon as there is a selection of multiple possibilities (png and webp), the engine needs to branch and detect which option is used in which case. That changes the code from a simple "display png" to a "check file, if png then display png else display webp".
even if the code is bug-free, it will still mean that more commands are executed and the engine will run slower, using up more resources (especially as the code for both displays is to be kept in RAM even if only one is used).
So if nothing else, you're slowing down the engine to add this option - and unfortunately due to the way it works, lag is always a problem with RM games, so that is not neglectable.

second (and that is completely independent of any proposal, has nothing to do with webp) every code added has a chance to contain bugs. That is simply because the programmers are just humans and can make mistakes.
And bughunting becomes more problematic the more features are added, especially if those features were not originally planned for.

So each feature added not only needs to be bugtested for itself, it will also increase the complexity of the engine for future bugtesting and bughunting, when other (and perhaps more important) features are added.
So that also needs to be adressed in the decision whether or not to add any feature...
 

Dope

Veteran
Veteran
Joined
May 29, 2017
Messages
132
Reaction score
16
First Language
English
Primarily Uses
RMMV
@Andar Thanks for the response!

I can't even really argue against that. I would've liked to be able to use webp for story images and png for the ui and such but when you put it like that... it's not really worth it if it might cause lag by default.

That being the case, since it's a situation where a developer needs to chose either or, since webp images can be displayed in games I would still like it if RPG Maker could recognize webp images in the editor.

A person can decide to go all in on webp and convert all the images in their game to webp. This would be fine for most things, probably (I'll find out soon enough), but webp images still won't show up in the editor when using the "Show Picture" command. You have to use png files first then replace them with webp files or already have those files in place, then delete the png files.

I'll concede that having both options isn't really viable, but being able to chose webp over png should be. Maybe? So with everything taken into account, would it be hard/problematic for Kadokawa to give developers the option to use either or webp or png? How would they program that, how would the software know which a developer chose?

Edit:
Since these options seem to be controlled in rmmz_managers.js, could Kadokawa simply offer two different versions of this plugin and based on the plugin the editor knows to look for either webp or png images? Possible?
 
Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

I made some sideview closets for MV!
You can find them in my MV resource thread.
People1.png & SF_People1.png added!!!!

Adventurer:
"Why your body looks like a bird?"

Stranger:
"Because I'm harpy"

Adventurer:
"Clap along if you feel like a room without a roof"

*Both dancing to Pharrell Williams song*
Stream will be live shortly with a make-up session of the Interactive Text Adventure! Feel free to drop by!

Forum statistics

Threads
105,507
Messages
1,014,276
Members
137,178
Latest member
negociant
Top