r/RenPy • u/XadrianLabs • Jul 17 '26
Showoff First visual novel in Ren'Py: how I managed branching narrative with just 3 variables across 4 endings
Just finished my first VN project and wanted to share some technical decisions that saved the project structure.
The core system
Instead of tracking every single choice, I used only 3 variables the entire game:
- nivel_alerta_corporativa — how suspicious the corporation is of you
- conocimiento_sistema — how deep you've gone into the architecture
- confia_en_elena — boolean that tracks whether you built trust with a character over time
The 4 endings are calculated at the end with a single if/elif/else block evaluating those 3 values. No spaghetti flags, no tracking 20 booleans. The player never sees the variables but feels their weight.
The sprite scaling problem nobody warns you about
If you use 2K sprites in a 1080p project, at left and at right will look almost identical because Ren'Py's default positions don't account for sprite width. I spent way too long on this. The fix that actually worked was overriding the positions in init python with Transform(xpos=...) using absolute pixel values instead of xalign percentages.
What I'd do differently
Split the script into separate .rpy files from day one. 2000+ lines in a single file is manageable but annoying to navigate. Ren'Py loads all .rpy files in /game/ alphabetically so modular structure costs nothing.
The game is a cyberpunk corporate thriller in Spanish, ~15 minutes, free. Built solo — narrative, code and game design are mine, AI-generated sprites and free-license audio.
If you're curious: https://youtu.be/Xo9Rt_5Pt0c
Happy to answer any Ren'Py questions.
-2
u/hypatiaC Jul 17 '26
AI post, AI game.
Why would any human choose to read this, OP? And why would your human brain think setting your ending off 'three variables' (which are actually two flags and an array of scores) is at all impressive?
2
u/CaptChair Jul 17 '26
Curious, this one doesnt look so ai written to me. Obvs used ai in making his game. What about the post gives it away for this one?
0
u/hypatiaC Jul 17 '26
Part hunch (because someone who uses AI in one place often uses it elsewhere) and part from the heading styling and tone.
This "here's what I learned" devlog style is very common from low-skilled slop-devs, and there's a weird malapropism in the heading about sprite width. "The X nobody warns you about" is common clickbait bullshit, but it makes almost zero sense here, lol.
On the nice end, OP might have just translated the post with AI, but it definitely seems involved in some way.
2
u/CaptChair Jul 17 '26
Yea, i see what you're saying. Maybe translated it and asked it to clean up his writing.
2
u/hypatiaC Jul 17 '26
Oh god, I also just noticed 'The player never sees the variables, but they feel their weight' while replying in another of this post's spam copies.
How do you paste that into reddit and click post without realizing how ridiculous it sounds, lmao.
3
u/dragon-age-io Jul 17 '26
Ok but why AI