A question that I have been asked by a few people is what I use in my development environment. Every developer has their own environment that they use either for familiarity or feature capability. When considering the required tools, it boils down to three things: development SDK, text editor, and version control. So I have decided to break this down based on each of those things.
If anyone wants to develop in Ren’Py, the first thing they must have is the Software Development Kit (SDK). This allows you to actually run the Ren’Py code that you write and see the results. For this item, I simply use the latest SDK offered at Ren’Py.org’s site: https://renpy.org/. This is the simplest way to get the code and I don’t really know if there are any other SDK’s one could use.
One other important question about the SDK is what OS I use on my development machines. The SDK is offered in many different packages depending on the OS you choose. They offer Windows, MacOS, Linux, Android 5.0+, iOS 11+, and HTML 5 (beta). For me, my primary OS that I work with both in work and on a personal level is MacOS. If anyone does not know, MacOS X and above is actually based on the BSD variant of Linux at the basic level. This means that MacOS offers the development stability of a Linux platform with the strong GUI for MacOS. I also added Brew to my Mac because it makes it easy to quickly get key packages you may need or want. I do have Windows on my gaming laptop and Ren’Py is installed on there as well but I rarely develop on it as I’d rather be gaming!
The internet is full of text editors of every flavor, variation, name, OS, and style. Trying to find ‘the best’ text editor for all things is impossible. Even finding the best editor for your operating system is pretty much impossible as well. So, to decide what text editor to use, is – at its core – a personal choice. However, if you are going to code Ren’Py, know that although it is based on Python, a standard Python-capable text editor may not offer Ren’Py capabilities even if the text editor has some sort of package capability to build on support.
When I began studying Ren’Py, three of the different videos I watched set theirs up using Atom. I did actively use this tool for many years but in recent news, the company has announced that it will sunset the product in December 2022. Though I am sad to see Atom go, I have found feature parity exists in Visual Studio Code. Ren’Py does have an interpreter in VSCode and it works fine so that is what I will be using this.
If you are already a developer with a text editor of choice, it is very wise for you to see if your editor has Ren’Py support either natively or with some sort of package component. You certainly can use an editor that has no Ren’Py support, but this will quickly become a major pain as you develop longer and more complex programs. I used to swear by the Sublime text editor and still use it for most things, but I found that although it offers Ren’Py support, the integration does not seem as clean as VSCode. Whatever text editor you choose, you will find good and bad things about it.
Text Editor Extensions
As I mentioned in the earlier section of this document, I have begun using VSCode to edit my applications. Much like my former favorite, Atom, VSCode has many extensions that can make the tool easier to use and improve the workflow used in coding. As my programming needs have changed, I have found some very nice Text Editor Extensions that I enjoy using. While you don’t have to use these extensions, you may find them to be useful.
- Jupyter Notebooks – Jupyter Notebooks is the standard for online code testing and troubleshooting in real-time. Though Jupyter Notebooks do not have specific Ren’Py functions, if you wish to make higher Python code elements to complement your Ren’Py code, you will find it is invaluable in testing. There is also a handy Jupyter Extension for VSCode. NOTE: VSCode uses Jupyter Keymap to help with keymaps and you should likely install it as well.
- Material Icon Theme – Okay, so this is something that is almost entirely aesthetic but it does have practical applications. Material Icon Theme is a theme that gives your VSCode editor different icons to depict different items. This means that lib file will look altogether different than an XLSX file or a CSV file. This may not impact your workflow much but when I am dealing with 15 different file types across many layers of folders, I like to know what I am editing rapidly and this extension does that. You can download the Material Icon Theme directly into your VSCode editor.
- Prettier – Again, this is another aesthetic thing but it is nice to have a tool that can automatically organize my code in cleanly indented and properly organized code. With Python being dependent on whitespace for proper code identification, and the need for some linters to contain a certain number of characters occasionally breaking format, Prettier will provide one-touch code organization and make your code that much easier for someone else to look at in the future. And, of course, Prettier has an extension for VSCode already so installing it is easy!
- Pylance – Though Ren’Py draws its basis from Python, it is a highly specialized version of the language. I have a history in coding with Python (which made Ren’Py easier to jump to) and sometimes I still like to create Python functions to do more advanced things in Ren’Py and to do that, it is important to have an internal Python server and that is exactly what Pylance does. So if you expect to be writing more advanced Python code, you should install this extension into your VSCode.
- Draw.io Integration – This is something that visual people like myself will find very useful. I am a big fan of Draw.io (aka Diagrams.net) which is an online flowchart/diagramming tool using JSON to generate nice diagrams. I find that if I have a diagram of the process I am trying to make, it’s nice to be able to quickly check the diagram or even make on the fly edits. That is what the Draw.io extension will do for you.
If you spend any time in the software development world, you will eventually hear someone talking about version control. But if you are just one person developing games for your own enjoyment, should you even care about version control? The answer is YES! While it’s true that you are unlikely to find yourself working on a team of several developers on a team to deliver a game, you still should use version control. Not only will you develop good habits for software development, but also you can quickly collaborate with people to help you with your code and if you did start working with a team (even a group of friends), version control will be a lifesaver.
If you are not already familiar with version control, I can quickly summarize what it is, but a deep dive into the concept is not the purpose of this page. Version control, at its core, is finding a way to store your code in a pre-defined location, known as a repository, that will keep track of code changes so that no matter who is working on the code, or what computer they are working on, they can have the updated version of the code anywhere.
Version control also allows you to create ‘branches’ of the code you are writing on and keep it separate from the main code. So, let’s say you are working on a game that is a dungeon crawler but you wonder what might happen if you tried to write a class system. You could just code the class system and hope it works but you could also create a ‘branch’ and call it ‘class-system’ or something of that sort. The version control system will essentially see the branch as a different version of the code and keep it separate. Once you create a branch, you can still return back to the original code with a simple command. If you decide later on that you want to merge the class system back into your game once you work out the bugs, that is pretty easy to do as well but you can continue making releases of the main game while working out the bugs in the branch.
The gold standard for version control, in my opinion, is GitHub. It is used almost universally by software developers the world over. Getting a basic account on GitHub is free and gives you virtually all the features you could ever want. You can make your code available publicly if you so chose, or you can make it private. You can also use capabilities within GitHub to prevent certain files (such as licenses or files with cleartext passwords/keys) from being published, if you want to make the rest of your code public.
If you use GitHub (also known as Git or GH), you will need to install some tools on your device that will allow it to create local repositories and synch them with your GitHub cloud repositories. It will also allow you to download the active repository from the cloud on to your device so that you can have the latest version of the code. You will also need to do some work on your local machine and your GH account to establish key sharing for seamless updates between your devices and the GH repository. If you set this up properly, you will easily be able to update your code and share it with others around the world. The GitHub website has a LOT of great documentation with clear, step-by-step, guides to get you up and running.
The last thing I want to mention about versioning is that if you pick a text editor with Git integration (such as VSCode), the editor will use colors and other icons to let you know if your code has not yet been updated in the repository. This is very useful if you are trying to keep your code updated or sharing with others. In fact, some editors (including VSCode) have built-in Git commands to do updates directly from the editor so there is no reason not to use it!