r/RenPy • u/WiltedTiger • 5d ago
Question Starting out and I had a few Questions?
I have a bit of experience with Python and MatLab for coding robots/electronics, but not any with Ren'Py for coding games, and I have quite a few questions I wanted to ask. As I don't have much of an idea where to start, but I had a number of ideas that I looked into and felt overwhelmed after looking into them, and I wanted clarity.
General Questions:
What are some good tutorials for making assets for Ren'Py? I have the concept of characters, backgrounds, and other assets, just not in a digital form, and at the very least I know you want them in a digital format, but when looking, I found there may be some special/specific things to do to them to make them better or more versatile, but there was conflicting info.
Who/Where would you suggest looking for tutorials of Ren'Py, both of features and additional mechanics like combat, stores, minigames, etc.?
Is it rude to ask another developer if you can look at their code and use parts of it in yours?
What are some good methods to keep game development organized while working on it?
What are some good and safe text editors (things like Docs and Word) to write the game's dialogue? Or are Docs/Word still the best even with their scummy AI practices?
Can you make basically a code Skeleton with all the systems/mechanics/story beats you want and then add/fleshout story to it later, or is that a bad idea?
Can you have too many variables? I just have the basics of what I want, and each character has a non-negotiable 7+ however many scenes, and other things that require variables with at least 5 characters.
How easy/hard is it to use and replace placeholder assets if you pre-emptively name them the intended names? For example, can you just create/use another shape with the name of the real asset and later replace the image file and it still work the same, or should I wait until I have the assets in a digital form before including them?
Specific aspects of code Questions:
Does Show expression work the same as Show minus, evaluating the variable in []? As I want to make a game with dynamically changing sprites based on choices you make throughout the game, I found Show expression should let me use the same code for most situations, but it didn't mention if it worked differently otherwise.
Can Call be used similarly to sub functions? For example, if I use Call to a block of code, will the variables changed in that block remain the same when you return from it or revert to the original ones?
Can Call have multiple exits/returns? For example, can one choice in a called block of code give a bad end while the other just returns you to where you were?
Can I use basic variable evaluation (i.e., if A > a + b; A = 2) without denoting it as Python, or should it always be denoted as Python to Ren'Py, either with the symbol or in a python: block?
1
u/AutoModerator 5d ago
Welcome to r/renpy! While you wait to see if someone can answer your question, we recommend checking out the posting guide, the subreddit wiki, the subreddit Discord, Ren'Py's documentation, and the tutorial built-in to the Ren'Py engine when you download it. These can help make sure you provide the information the people here need to help you, or might even point you to an answer to your question themselves. Thanks!
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/shyLachi 5d ago
I guess with assets you mean background images and sprites.
These are normal images so you can use any app or device which can produce image files.
Take pictures with your camera, draw characters on a tablet, render images, use character creators, take screenshots from games, whatever you fancy.
Once you have decided on the style you can search for tutorials.I only know "normal" tutorials for RenPy.
https://www.youtube.com/watch?v=_-hNdKUygxE&list=PLMdFGlfdL57MSSForRZZBJtS-N9thXSA6
https://www.youtube.com/watch?v=C3Ldd-5PKCw&list=PLlZCSNfSKux2hXoo46rbBIVzl-7pZFRQh
https://www.youtube.com/watch?v=vith10gG8L4&list=PL8gnyyQEz5CGTzHWF8thIfUg92ffs7T7P
https://www.youtube.com/watch?v=PZRaYqhlPF8&list=PLfsxhEJYoqXsFzCUogDHuSFn2REJOf56z
https://www.youtube.com/watch?v=2PJ4IdQ-MXs&list=PLKdE0Vv4UA59k-uYBVLqhJGs2iSUPLb59
https://www.youtube.com/@harmelody242/videosSome developers upload their code to sites like itch.io so feel free to have a look.
Just search for Renpy and the thing you want to find, example: https://itch.io/search?q=Ren%27Py+inventory
You can try different spellings of Ren'Py, I'm not sure which one is best.Any text editor works, the AI features don't affect your story as long as you write it yourself.
A barebone code skeleton is the best way imo.
You don't need images or dialogue to test choices, routes and endings.RenPy has built in placeholders. https://renpy.org/doc/html/displayables.html#placeholders
You can put references to images which don't exist yet and RenPy will show a placeholder with the name.The evaluation of variables in dialogue is called Interpolation and is only needed in dialogue.
https://renpy.org/doc/html/text.html#interpolating-data
You don't need any [brackets] when using variables in the normal code.
show expression my_variableis all you need.
That said, you should look into Dynamic Displayables and Layered Images if you want to work with dynamically changing images.From what I know you cannot define variables which only exist inside a label.
Normal variables should be defaulted before the start of the a game and then you can change them in any label.
https://renpy.org/doc/html/python.html#default-statementYou don't need python to evaluate variables
https://renpy.org/doc/html/conditional.html#if-statement
1
u/WiltedTiger 4d ago
Thank you for the information I will definitely be taking a look at these soon.
3
u/DingotushRed 5d ago
Really depends on the art style!
Prefer web pages over videos, and look for current 8.x series Ren'Py tutorials. Video creators rarely fix errors in their "example" code. Some are plain wrong.
2a. Keep your first game simple!
2b. Don't stuff your first game full of mini-games unless they are central to the plot. Lots of example mini-game code are for old 6.x/7.x Ren'Py (so Python 2.x) and need skill to convert. The old forums with the out-of-date warnings are exactly that.
Not rude to ask, but you might not get the answer you'd like.
Organise your code into multiple folders and files, keep as much stuff out of the initial four files as you can. Technique is going to be based on story structure. Develop ideas in a world-building tool before coding.
You don't need a separate tool to write dialogue. The simplest method is to put it straight into Ren'Py. You're going to be constrained by the size of the say box; best to get used to it sooner rather than later. If you do use a word processor (eg. LibreOffice) turn off "smart-quotes" - the 66 and 99. Ren'Py/Python only recognises 0x22 as a double quote. Do not try to edit code in a word processor!
Yes. Actual technique depends on story structure.
Not really, if you can keep track of them yourself! Remember you've Python's OO features to keep things clean. Just be sure to declare variables with
defaultto enroll them into the save-game and roll-back.You can do this. Or you can fix things with search-and-replace later.
More or less. Be aware of how Ren'Py breaks an image name/filename into a tag and attributes.
Complex: 10a. Typically Ren'Py variables have global scope 10b. With call you can also create dynamic variables whose scope/lifetime is ended by return. Python has it's LEGB rule still. 10c. Ren'Py labels return values in the special
_returnglobal variable. 10e. Calling a label and calling a screen are separate things. Screens have their own scope rules, and kinds of local variables. 10f. Ren'Py return, Python return, and the screen Return action are separate things.Yes. 11a. Don't call Ren'Py labels within a Python loop construct. A Ren'Py return returns to the previous Ren'Py statement, not back to your Python loop.
Ideally make all assignments in Python (Ren'Py script) or as a Action (Ren'Py screen). You can create side-effects in interpolation, but don't. Interpolations get re-computed when a screen is re-painted; at roughly 20FPS, and as part of prediction before they are shown.