RPY to RPYC

Palanto

Active Member
Game Developer
Oct 4, 2017
964
1,835
What do you mean "outside renpy"? :D Usually it autogenerates the .rpyc files from the .rpy files if you just start the game
 

Passion3D

Well-Known Member
Modder
Nov 10, 2017
1,258
6,857
What do you mean "outside renpy"? :D Usually it autogenerates the .rpyc files from the .rpy files if you just start the game
I develop an installer and I need to compile rpy in rpyc without launching the game
 

Palanto

Active Member
Game Developer
Oct 4, 2017
964
1,835
I don't know what you are planning with it, but your best bet would be to ask around on the , maybe someone there knows how you could go about it... I mean, even if you build an installer, there's no reason to compile the rpyc files through it. Either do it beforehand as a dev would anyways, or do it without compiling the .rpy files and then when a player starts the "installed" game it auto generates all the .rpyc files... But like I said, your best bet would probably be the if you really want that feature in your installer for whatever reasons ;)
 
  • Like
Reactions: Passion3D

Passion3D

Well-Known Member
Modder
Nov 10, 2017
1,258
6,857
I generate rpy during the installation, and I want to be able to compile in rpyc.
I will ask the question about discord, thanks;)
 
  • Like
Reactions: Palanto

Passion3D

Well-Known Member
Modder
Nov 10, 2017
1,258
6,857
I had Renpytom, but he did not want to answer me :( so I still have no solution!
I'll have to analyze Renpy's source, but it's going to take a lot of time,

The question remains so, if someone has the answer I'm all ears
 

BeardLord

New Member
Nov 18, 2017
8
16
When you say you are building an installer, do you mean building something like Installshield or Inno Setup?

This type of workflow works as follows (adjusted slightly for RenPy):
  1. Developer writes the code in .rpy files.
  2. Developer runs the game to generate .rpyc files.
  3. Developer runs a program/script to package only the .rpyc files into a setup.exe.
  4. Developer distributes setup.exe to users.
  5. Users run setup.exe to install game.

I think you are asking for an alternative to running the game in step #2. Is this right?

Vanilla Python offers a module in their standard library called , which might do what you are asking, but I am not familiar enough with the inner workings of RenPy to see would this be easily translatable.
 
  • Like
Reactions: zerlkung

Passion3D

Well-Known Member
Modder
Nov 10, 2017
1,258
6,857
When you say you are building an installer, do you mean building something like Installshield or Inno Setup?
Yes that's it ;)
I think you are asking for an alternative to running the game in step #2. Is this right?
Some developper does not execute this step and distribute the sources (rpy).
This poses a problem if, for example, a mod is installed over it and modify the same file(s). The compilation of the 1st mod will overwrite the rpyc of the 2nd mod.
So I want to be able to fix this problem by compiling the mods as the installation progresses.
Vanilla Python offers a module in their standard library called
Yes but i need to know, how Renpy use this for generate rpyc.
 

Palanto

Active Member
Game Developer
Oct 4, 2017
964
1,835
Hmmm yeah well that's a problem for the mod writers, if they don't take the time to mod the game correctly it's their fault, why bother with the errors of modders in an installer? X_x
 
  • Like
Reactions: anne O'nymous

Palanto

Active Member
Game Developer
Oct 4, 2017
964
1,835
Not always easy to make some modders understand how to do and broadcast a mod correctly :) And I should ignore them, but it's for the players ;)
Well in that case, if it's for the players, and you want to use several incompatible mods, why not install them first on your game, and pack the whole thing as an installer afterwards? :D
 

Passion3D

Well-Known Member
Modder
Nov 10, 2017
1,258
6,857
Indeed, it is an idea that I had thought of ;)
At first, it's the solution yes :)

My final project is to make a universal installer. An xml file will contain the necessary informations like, the name of the game, its version, the download link, the mod (s) with their links etc ... And usable by the game developers (like you :))
The user can choose what he wants to install with checkboxes.
 
  • Like
Reactions: Palanto

Rich

Old Fart
Modder
Respected User
Donor
Game Developer
Jun 25, 2017
2,461
6,925
As far as the RPY-to-RPYC bit goes:

In theory, you could extract the relevant code from the Renpy Github area and use it to build your own RPY-to-RPYC compiler that operated without Renpy itself.

In practice, without support from Pytom, that would be difficult (not impossible, but difficult) since you'd have to learn the entire compiler structure so that you could pick out the portions that were needed and the portions that weren't. And you'd be constantly chasing Pytom as he makes enhancements to the language, ATL, screen language, etc.
 
  • Like
Reactions: Palanto

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,110
14,787
My final project is to make a universal installer. An xml file will contain the necessary informations like, the name of the game, its version, the download link, the mod (s) with their links etc ... And usable by the game developers (like you :))
The user can choose what he wants to install with checkboxes.
Honestly, even if it was possible, it's way too much works to do just because some modders don't want to correctly mod Ren'py. Here you are thinking about the compilation of the source code, but you forget that it's in fact the last of your problem :
Firstly you'll have to deal with the fact that two different mods doing something different can change the same line in two different and incompatible way. Secondly you'll have to deal with the fact that one mod will completely change the source in such way that you'll have to guess where the change made by the second one should be inserted. And there's probably other problems which don't cross my mind.

And at the end of this, anyway why do you think that you need to compile the generated file ? I mean, the process is :
1) Check the mod to install ;
2) Edit the source to "install" the mods inside them ;
3) Compile the result ;
4) Run the game later.
The point 4 already take care of the step 3, so you don't need to know how to generate a rpyc file.

Personally, I would say: Don't bother with this. Let the players rage because mods are incompatible and perhaps that more modders will decide to correctly mod a Ren'py game without editing the source file. It's possible 95% of the time and not difficult to do if you read the doc.
Take a look at everything done by . It replace the randomization by a choice, it change a +15 into a +30/45 (depending of the case), change the User Interface, and many other things, this without the need to edit the source code. @bossapplesauce made at least two mods which act as incest restoration, without editing the source code.
The solution is not to create an universal installer, but to teach modders how to do their works in the right way.


Yes but i need to know, how Renpy use this for generate rpyc.
Ren'py parse the source code, create the objects related to each statement, store them in an AST, then pickle the AST. So, if Tom don't wanted to answer, it's simply because you need a complete copy of Ren'py to do this. So, to do this you need 100% of Ren'py. There isn't a single line of the code, not a single one of the included module, that you can forget, because it can be used by a python statement of the code you want to compile.
 
  • Like
Reactions: Palanto and bas

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,110
14,787
help
What is the solution to this problem??
Hmm... I really doubt that you are facing a case where you need to compile .rpy files outside of Ren'py ; even OP wasn't effectively facing this problem. So, what is "this problem".