Can you convert ren'py games to html5?

Palanto

Active Member
Game Developer
Oct 4, 2017
964
1,839
There were some projects around trying to achieve a conversion. But none that worked for me so far ;) So either do it manually yourself... or write a transpilation from renpy+python -> html, css, javaScript
 
  • Like
Reactions: Jim.Satyr

Jim.Satyr

Jim
Donor
Game Developer
Aug 9, 2018
331
657
There were some projects around trying to achieve a conversion. But none that worked for me so far ;) So either do it manually yourself... or write a transpilation from renpy+python -> html, css, javaScript
So it is possible? could there be a logarithm made that converts/makes ren'py games into html games?
 

Palanto

Active Member
Game Developer
Oct 4, 2017
964
1,839
Maybe it could, I don't know. Just looked it up some days ago to see what is possible and what isn't... All projects I found were either abandoned or not working in any way :-\
 

HiEv

Member
Sep 1, 2017
384
780
So it is possible? could there be a logarithm made that converts/makes ren'py games into html games?
It's definitely possible, but there is no automatic converter.

If you have the Ren'py game source, images, and sound files, then if you know HTML, CSS, and JavaScript you should be able to convert it into using the story format.
 
  • Like
Reactions: Jim.Satyr
U

User_920791

Guest
Guest
uses a syntax very similar to that used in Ren'py. Depending on the project, it is quite simple to manually convert:
Code:
...

let script = {
"English":{
    "Start": [
        "notify Welcome",
        {
            "Input": {
                "Text": "What is your name?",
                "Validation": function (input) {
                    return input.trim().length > 0;
                },
                "Save": function (input) {
                    storage.player.Name = input;
                    return true;
                },
                "Warning": "You must enter a name!"
            }
        },

        "h Hi {{player.Name}} Welcome to Monogatari!",

        {
            "Choice": {
                "Dialog": "h Have you already read some documentation?",
                "Yes": {
                    "Text": "Yes",
                    "Do": "jump Yes"
                },
                "No": {
                    "Text": "No",
                    "Do": "jump No"
                }
            }
        }
    ],

    "Yes": [

        "h That's awesome!",
        "h Then you are ready to go ahead and create an amazing Game!",
        "h I can't wait to see what story you'll tell!",
        "end"
    ],

    "No": [

        "h You can do it now.",

        "display message Help",

        "h Go ahead and create an amazing Game!",
        "h I can't wait to see what story you'll tell!",
        "end"
    ]
  }
};
 
  • Like
Reactions: Jim.Satyr

Aeilion

Member
Jun 14, 2017
125
144
It's been a while since I have not looked at what could be done in html etc ... But it seems to me that the save part will pose problem.

Apart from that, in theory, I do not see what could be a problem. In practice against ...

The worst being that there are a lot of games that are coded by taking liberties or with obsolete syntaxes etc ...

For a game type VN (image, text, choice) it's fine. But as soon as there is something extra ...

For a sandbox or rpg etc ... Forget. Not that it is especially complex (though ...) but mostly because I doubt to find two sandbox or RPG game style coded the same way.
 
  • Like
Reactions: Jim.Satyr

Hones

Forum Fanatic
Compressor
Aug 10, 2018
4,156
8,611
It's defiantly doable - checkout -
 

Rich

Old Fart
Modder
Donor
Respected User
Game Developer
Jun 25, 2017
2,498
7,101
There's another forum post discussing this:
This particular project seems to have attracted PyTom's attention, so with some time it might become "official." Until then, however, there isn't an "official" way to do this.
 
  • Like
Reactions: Jim.Satyr

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,427
15,334
There's another forum post discussing this:
This particular project seems to have attracted PyTom's attention, so with some time it might become "official." Until then, however, there isn't an "official" way to do this.
OMFG !!!!!!!! He let the console enabled...

Whatever you do, if you put something like a Ren'py game playable online like this, do NOT let the console enabled. If the tools you use behind don't strongly enforce disk operation, it's breach in your security ; one that can goes from small to enormous, depending of the actual state of the server you use.
 

HiEv

Member
Sep 1, 2017
384
780
It's been a while since I have not looked at what could be done in html etc ... But it seems to me that the save part will pose problem.
The HTML game development tool I mentioned above (Twine/SugarCube) has saving built-in (along with a bunch of other features), so that should make saving a lot easier.
 
  • Like
Reactions: Jim.Satyr