RenPy is a popular game engine mainly used for creating visual novels. It is one of the most popular engines out there, used by thousands of creators to create stunning interactive stories without needing to have a deep knowledge about programming. The engine. It uses Python scripting language, making it accessible for developers of varying skill levels.
Today, I will teach you how you can Port any PC Game built with RenPy engine to Android. The process is the same for every game however you might come across some games that are built differently with different modules that will not be compatible for mobile devices, it that case you may have to edit the code and make the appropriate changes to the game which we will not cover in this tutorial.
I will only show the general way to port games, which works almost 90% of the time. Also, this works with Linux and MAC games as well, it doesn’t really matter.
Things you will need:
1) Basic knowledge about how to use a computer, how to download stuff from the internet, and how to edit files, etc.
2) RenPy engine download and installed on Your PC – Get it from here
3) You’ll need version 8 of the JDK (Download the correct one according to your PC) – Get it from here
4) Android SDK (You can install directly from RenPy Later)
5) Notepad++
6) Windows PC
Let’s begin
1) For this tutorial, we will be porting a game called – Cafe in the Clouds by Cafe Nemo From ITCH – So download it, it’s free.
2) Once you have downloaded, move the ZIP file to the RenPy directory and extract it.
3) Navigate to the Game’s Folder and then go to “game”
Many games will archive their content in RPA form (scripts.rpa, images.rpa, music.rpa), which stands for (Ren’Py Archive), it is a way to organize their content and protect it from being extracted since it includes art works, stories, videos, audios, etc.
To port the game, we’ll need to extract all content from ALL the RPA files. If the game hasn’t archived its content, this step may not be necessary.
To do that, we will use a tool called “UnRen” – You can download it from here.
Extract the UnRen-forall.bat from the ZIP file and then place it inside the RenPy folder, you will need it many times in the future.
Now move the UnRen-forall.bat to the root folder of the game, as shown in the pic below.
Run the UnRen-forall.bat file if windows give you warning, then click on More Info > Run Anyway and then press enter when you see a screen open. After you hit enter, you will get a MENU screen as shown in the pic below.
Choose the FIRST option to extract RPA Packages – Enter 1 and hit ENTER
It will then ask you whether you would want to Remove RPA archives after extraction. Just type “y” and hit enter, since we won’t need the RPA
If all goes well, then it should extract all the content for you.
Now Go back to the “game” folder, and you will find all the files and folders.
4) Now we will be working with 2 Files which is gui.rpy and screens.rpy and in most cases we will only be working with these 2 files. In RARE Cases, the developers will name these files to something else or place them in different folders. So you will have to find them.
ALSO, sometimes after extracting the files you will notice all files have an RPYC extension, RPYC files are precompiled, which means they can be executed faster than the original. They also serve as a way to protect the game’s source code. While they can be decompiled back into readable code, it’s an extra step that makes it harder for casual users to access or modify the game’s script.
UNREN file, which we talked about above also has the option to decompile the code and convert the RPYC files back to RPY. So in case you find RPYC files, then just use that tool.
5) Open both the files in Notepad++
In gui.rpy scroll down until you find this part
Look for mobile devices or the code as shown in the pic. Remove all the stuff inside here, please make sure you do not remove anything else. Sometimes developers add other blocks below this. If you see another init python: below this, then do not remove that, only remove whatever is above it.
Now open screens.rpy
Scroll down until you find this part, usually is at the bottom completely. Remove all the stuff inside it. Same as above, if you see any other code below this, do not remove it.
If you find any other code below style etc, etc. then do not remove it.
6) Now save both of the files and open RenPy game engine.
RenPy will be able to find the game, as long as you have kept it inside the RenPy folder as shown in step 2
7) Click on the game name, then click on Android under Build Distributions
8) You should be presented with the screen as shown in the pic below
Click on phone, at this Point if RenPy asks you to install the SDK then just do it. It will automate the installation for you so you can emulate the game on your PC before building it. Also, make sure JDK is already installed. If you are getting any errors here then comment below.
But if all goes well, then the game should load. But wait I got an error
Getting such errors is common, so that is why i didn’t wanted to remove this part from the tutorial. Though it is not always the case, sometimes the game can load just fine, but you might get errors later down the road, so it is better to completely test the game before porting to make sure there are no errors, if you find any then fix them.
I’m sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.File “game/investigation.rpy”, line 236: non-default argument follows default argument
screen dream_actions(actions={}, mousepos):
^Ren’Py Version: Ren’Py 8.1.2.23090503
Mon Jan 1 20:16:15 2024
The error indicates there is a non-default argument which follows a default argument in game/investigation.rpy line number 236
So let’s take a look.
So now we need to fix it.
Simply change the code to the following
# FROM screen dream_actions(actions={}, mousepos): # TO screen dream_actions(mousepos, actions={}):
Now reload the game and it should work
Now test the game completely, and see if everything works, and everything is aligned properly.
9) If all is good, then quit the game and click on Generate keys, give it a name, it can be anything you want and click continue.
Then click YES on the next screen then click Continue
10) Now go back to the Game’s Folder and delete everything inside except the “game” folder and the keystore files
11) Now go back to RenPy and click Configure
It will ask you to configure your game, like adding name, version, and other things. So do it.
It package name, enter the package name you want the game to have.
Now click Continue and leave most of the settings as default, just keep clicking continue until you come back to the main screen
Click on Build Package and RenPy will build the APK file for you. This process might take a few minutes depending on your PC. So just wait. If you get any errors along the way, then comment below so I can help you.
The building process should begin.
If all goes well, then RenPy should open the Output window with the File APK.
12) Move the APK file to your Android device and sign it again if necessary.
The game should work perfectly fine, like it was made for Android.
That’s it
Conclusion
When you are just starting out porting games, you might face many errors, so please just comment below so I can help you out. Also, if you get errors while running the game then google the error to find solutions or simply ask ChatGPT, and it will give you a solution on how to fix it.
This game was very basic, some games are harder to port. So always begin by porting easy games until you understand everything, then move on to porting harder and larger games.
Larger games also need compression, since large games do not run very well on Android devices. There are RenPy compression tools built by Fans, so just google it out or comment below, and I will send you a link.
You can also customize many aspects of the game then, adding your credits, adding your own splash screen, changing fonts, and much more.
Happy Porting!