r/RenPy•
Anthaus

Looking for a guide to learn the ropes

Hello everyone.
I've got an idea for a visual novel (it's something of a cathartic writeup for me). I already have, on paper, chapters, characters, event, scenes and so on...

What resources do you recommend for a tutorial, in order to let a complete noob learn the basics to do an at least 'alright' work?

Or should I just stick to what I do best, and find a coder do the tech-wizardry for me?

Thanks a lot.

Posted Feb 9, 2021, 8:31 AM UTC

212

RenPy is very easy to learn. YouTube tutorials and Lemmasoft forums will get the job done.

4
SecondTalon•

The real questions is -

aside from basic True/False yes/no variables and maybe some numeric counting, what mathematical mechanics does your game have? What do you need to randomize, if anything? What game functions do you need to implement beyond "Read things on a screen and pick an option from a menu on occasion" ?

If there's nothing much else to do, if you just need to track what the player selected in a spot, if you maybe need to count how many times they spoke to someone or went fishing or whatever and that's it..

Then you can learn everything you need to know to make it yourself in under four hours. Probably under an hour, but I'm padding the time for testing.

Actual implementation will take however long it takes, obviously.

3
AnthausOP•

Thank you. Such kind of planning may appear obvious to someone used to planning games, not so much to a simple player.

I wish to provide as many choices as I can, and perhaps keeping tabs on some recurring characters (think like 'Morality Tracker') in order to pick one of the possible endings. So I think I'd need something very basic.

1
SecondTalon•

A big part of it is simply a matter of readjusting how you think about your story, breaking it down in to just the moving parts by abstracting the text.

Basically, don't think of it as a 15 minute conversation between the player and Alice, think of it as

(Conversation)

Alice Choices 1 - Two options, A or B

(conversation continues)

If A picked, do this.

If B picked, do that.

(Conversation ends)

The bits in the (conversation) part might be dozens of lines of dialog, but in planning out what you need - you don't care about that at the moment.

You care about tracking what the player picked in the first choice.

So you could call that AliceFirstChoice = True/False

Where you set it to True if the player picks A, or False if they pick B.

That only works for binary two choice options, though.

For something more complex, you'd want a numeric variable maybe.

AliceFirstChoice = 0, but if they pick A you set it to 1, B you set it to 2, C you set it to 3....

That tracks what the player picked, but doesn't do much else.

If, for example, you wanted a Morality Tracker, then you could do

AliceMoralityDecisions = 0

at the start, then have option 1 remove one, setting it to -1, option 2 leaving it alone, and option 3 adding one, so it's now 1.

Something like that is useful if it's not really important to remember which options the player chose specifically, but more about the outcome or tone of them. Your basic Good/Evil kind of thing, where you may not care that the player stole a cookie in Chapter 1, but you do care that their Good/Evil ratio is on the Evil side of the equation.

In short - you want Boolean variables (that is, the True or False ones) to track very specific things. If you can ask a Yes/No question about it and want to know the answer later (Did the player slap Bob? Did the player steal Claire's pie? Did the player crash Dave's party?) then you want a Boolean variable.

If it's something like a long term thing - Has the player talked to Alice about every part of her relationship with Bob? - then you want a numeric one. In that instance, every time the player learns more about their relationship, you'd add 1 to a variable (AliceBobRelationshipRevealed, maybe?) and at the end of the game display one thing if it's 5 or less, a second thing if it's 6-10, and a third thing if it's 11 or 12, and then the secret True Ending at 13 as there's only 13 possible points.

Another thing you can do is, like you said, a morality tracker. Every time the player does something good, add +1 to a numeric variable. Every time they do something bad, remove one. Have options later only appear if the morality is 5 or higher, and other options only if it's -5 or lower. That's pretty straightforward to do.

And then there's Variable Strings. That's where you make a variable a piece of text. They're a little harder to put in to place, but they let you do things like let the player give characters nicknames, or let the player tell the characters something rather than selecting it from a list. You do end up writing things like "You like [variablename]? I like it too!" with the understanding that someone will absolutely answer for the lulz with things like "horsecock" or whatever, and can put in things to see if they did so the story gives a different response instead of the expected line.

Variables are variables, it's all about thinking about them.

I'm not saying you couldn't find someone to code it, but I am saying it may be faster and easier (and cheaper, as even if someone does it for free, there's still a cost) to learn to do it yourself.

5
[deleted]•

[deleted]

1
SecondTalon•

I wouldn't say I know my stuff, but I know enough to answer basics.

Reversing your questions as they're easier to answer that way.....

also is there a way to draw on the screen? Like with a pen on a tablet?

You personally, on your computer? Dozens of ways. You can get a Wacom tablet or similar and connect it to your computer, they range from economical models that are a couple hundred bucks to high end professional models that are thousands of dollars (and amazing to use). If you have an iPad (and I presume Android) you can get some software to connect it to your computer over wireless to use as a secondary monitor, then just use your stylus of choice.

If you mean the player - That would be complex to encode, and I'd find someone versed in Python to write it for you (and pay them for it).

Are there plugins for that or something (for combat) built into the program already?

There are likely plugins somewhere for it, the issue is that "Combat" is a nebulous term that means something different for everyone who hears it, so it really depends on what precisely you mean.

Do you know if you can add combat to renpy? And have a character add weapons and gear that effect combat?

Yes, but see above re:Combat and how that means different things.

Continuing....

The easiest way I know is to create your own Combat System. You'll need several variables, and you'll need to write it down on paper first.

I'm going to describe a pseudosystem here to illustrate my point.

Let's say that you have D&D stats (Strength, Dexterity, Constitution, Intelligence, Wisdom, Charisma), you have base character skill (Attack Skill) and you have weapons that add 1-5 to the skill. You want Dexterity to add to the chance to hit, and you want strength to add to damage. Each weapon does differing amounts of damage, so you need to account for that too. Lastly, you've mimicked D&D in that there is a single number - Protection - used to control if the player gets hit, and you want that to be a combination of equipped armor pieces and Dexterity.

So nothing complicated (sarcasm!)

So step 1 - Setting up the Variables.

Each stat gets a variable. I'd go with p_str, p_dex, and so on. The p_ standing for Player. You also want e_ versions, for the Enemy. And if you have NPCs who can contribute (like Alice, the Knight, or Bob, the Mage) then you want a_ and b_ versions, for Alice and Bob respectively.

Attack Skill gets a variable. So p_attack, e_attack, and each NPC gets one too.

You also want a variable for the total combination of everything - let's call it the Player's Final Attack. p_finalatt. Guess what also exists? If you answered e_finalatt and a_finalatt for Alice while b_finalatt is for Bob, you're thinking like I am and I can assume you're going to do that for the rest of it.

p_protection is for our Player's Protection variable.

Now for armor... you can do a single p_armor variable, if you want, and call it done. If you want a piecemeal armor system, where the player can have a bronze breastplate and iron greaves and chainmail gauntlets and.... then each armor location needs it's own variable. If you plan on your NPCs having different, equipable armor, then you need something similar for them, otherwise you can probably just leave it alone with their a_protection variable as is.

So out of the gate for the player alone we've got a minimum of (ignoring the 4 unused stats) like six different variables - p_str, p_dex, p_protection, p_attack, p_finalattack, p_armor.

But we're not done! You want to also have a current_damage variable that'll be a floating variable we use for everyone's damage as, when we're delivering damage we only give a shit about the last amount done, so we can reuse it endlessly. We need something like p_wdamage to track the Player's Weapon Damage, and we obviously need e_hitpoints to track the enemy's hit points.

(You are absolutely going to want to learn how Calls work for all this)

Now how do we actually get this as something useful?

Whenever the character attacks, we probably want to do something like...

p_finaltattack = p_attack + p_dex

if p_finalattack > e_protection

    current_damage = p_strength + p_wdamage

    "Your strike is true!  You have hit your enemy for [current_damage]!"

    e_hitpoints -= current_damage

    if e_hitpoints <= 0

        "You have slain your foe!"

        [something here to go to the victory section, probably a call?]

    else:

        "Your enemy still stands!"

elif p_finalattack == e_protection

    "Your attack almost gets through, but is deflected at the last second!"

else:

    "Your attack does not get through the enemy's defense!"

[a call back to the start of combat, where the enemy then gets a chance to hit the player]

And that's just how to work one hit from a player. You are absolutely going to put that in as a function because you do not want to type that every single time, which means you're going to be using a lot of nested calls and returns. You probably would use a [current_enemy_name] string variable where I typed enemy in the code, so it customizes to "You have hit the Demon of Azagard for 19 damage!" or "You have hit the defenseless peasant for 8 damage!" It starts getting complicated at that point - and no, we have not hit complicated yet. This is still easy.

Creating a full-ass combat system is, therefore, going to take a lot of programming on your part, a lot of testing, and knowing how calls work. You're going to do things like p_weaponequipped = "Sword" and then setting p_wdamage to 5, or even having an entire separate function dedicated to randomizing the weapon damage every round, so that a sword does 1d8 damage instead of a flat 5 or whatever.

And all of this is just for the combat code itself. I haven't even touched on the screens to make it not look like a menu choice, or inventory screens that show even just "Weapon Equipped : Mace" as text.

As I said, you can probably find someone's code that does all this for you, but odds are very good that it'll be in python, which can be a little harder to read. Even if it's in Renpy code, the variable names alone may be hard to decipher - p_wd may be there instead of player_weapon_damage, or mcdw, or any number of different methods.

My honest advice is the same sort of thing I tell people over in the RPGMaker section - Assess the software you're using critically, and determine if it really is the best choice for the job. People can make a FPS in RPGMaker. That doesn't mean it's a good idea. You can make a robust RPG-style combat system in Renpy. That doesn't mean it's a good idea.

2
tallsy_•

Not OP, but a game I am working on needs to use probability. Like you trigger this event, and there's a 1/6 chance of X state. You trigger another event, and there's a 1/6 chance of X state. But you trigger both events and there's a 2/6 chance of X state, etc. Up to being able to trigger some scenarios where theres so many stacked triggers that it's 6/6 guaranteed.

I was thinking that at some point I would have to look up the probability logic for that.

Any links or tips?.

1
SecondTalon•

Yep.

With your variables, default a variable you plan to use for randomized "I need it for the next line or two and then literally do not care anymore" type things. I typically use rng as my variable name for that, so...

default rng = 0

When you need to randomize something, use this

$ rng = renpy.random.randint([low number], [high number])

And then provide some basic if/elif/else logic.

In your specific case..

   $ rng = renpy.random.randint(1, 6)

Then do some If/Elif/Else logic

if rng == 6:

  "Do the thing."

else:

   "The thing didn't happen"

or whatever you need.

That's a basic "Gimme a random result."

If needed, you can also have the success add to another variable, rng_weight, which you use to weigh results by having it add +1 to rng_weight every time the check succeeds.

$ rng = renpy.random.randint(1, 6)

$ rng = rng + rng_weight

Then do the checks again. That way, the result is gradually getting higher and higher. Do note that instead of rng == 6, you'd want to use rng >= 6, so it runs if rng is equal to or greater than 6.

If you need to add a bunch of different random numbers together - like, say, you're rolling stats... then you'd probably need rng1, rng2, rng3 variables and three different lines randomizing them, a fourth line adding them to rng_result or something, and then a final line making rng_result = dexterity or whatever.

2
tallsy_•

Thank you!! Saving this to come back and review it when I am ready. Appreciate the help. :D

1
SecondTalon•

No problem.

There's probably far more efficient ways of doing it with straight python, but I don't know straight python.

2
qirien•

You can do it! If you download Ren'Py, it comes with a very simple project that shows how to do most of what you need.

2