Would this be possible?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
Hollow Gourd
Regular
Posts: 79
Joined: Wed Dec 01, 2010 11:25 pm
Projects: Gatemaster!
Contact:

Would this be possible?

#1 Post by Hollow Gourd »

[Removed]
Last edited by Hollow Gourd on Mon Apr 05, 2021 4:09 am, edited 1 time in total.

Hollow Gourd
Regular
Posts: 79
Joined: Wed Dec 01, 2010 11:25 pm
Projects: Gatemaster!
Contact:

Re: Would this be possible?

#2 Post by Hollow Gourd »

Don't all post at once, now...D:

KimiYoriBaka
Miko-Class Veteran
Posts: 636
Joined: Thu May 14, 2009 8:15 pm
Projects: Castle of Arhannia
Contact:

Re: Would this be possible?

#3 Post by KimiYoriBaka »

renpy isn't very suited for anything in real time (though it has been done). python, however, is really only limited by it's inefficiency as a high-level interpreter language. your ideas are no where near the limits of python.

as for the individual things you mentioned:

-varying the location based on seasons
this just requires you to keep track of the season as a variable and then display a different menu/imagemap for each season. quite simple as long as you can understand the basics of renpy

-varying the plant life
a bit more fun. for this you would use either renpy.random.choice or renpy.random.randint (depending on how you want to do it) and just display the plants accordingly. as for clicking on them:

-interacting with the environment
I just used this one in a recent game actually. I don't know if there's a more efficient way, but I did by making a list containing each of the things the player could click on, then putting up a screen that shows each thing in the list as an imagebutton using a for loop. still well within the power of renpy

-cooking up concoctions with motion detection
this one would be harder. user defined displayables could accomplish this, as they basically are just python functions that put stuff on the screen, but they're somewhat confusing. whether or not you use them, you'll probably also need to use renpygame to check the mouse position and movement. as far as I know the standard renpy tools don't include that. as for how to go about it, I would use a timer that checks the position and then uses it to calculate the average velocity over some amount of time (less than a second).

Hollow Gourd
Regular
Posts: 79
Joined: Wed Dec 01, 2010 11:25 pm
Projects: Gatemaster!
Contact:

Re: Would this be possible?

#4 Post by Hollow Gourd »

Thank you for responding!

I don't quite know the full extent of the functionality behind renpy.random.choice, but if it is truly as random as the name implies, that's not quite what I'm going for. It wouldn't be all that realistic if every time a player left and returned to a particular location, no matter how much time has elapsed, the available plants would be completely different. Additionally, I would need for certain flora/fauna to show up more rarely than others.

Based off of what you've said, though, it most certainly seems to be well within the parameters of both the language and the engine to execute all of what I have in mind. I suppose I'll cross the "how" hurdle when it actually comes up...xD;

Gavrilo
Newbie
Posts: 10
Joined: Thu Feb 16, 2012 4:19 pm
Contact:

Re: Would this be possible?

#5 Post by Gavrilo »

Hollow Gourd wrote:I don't quite know the full extent of the functionality behind renpy.random.choice, but if it is truly as random as the name implies, that's not quite what I'm going for. It wouldn't be all that realistic if every time a player left and returned to a particular location, no matter how much time has elapsed, the available plants would be completely different. Additionally, I would need for certain flora/fauna to show up more rarely than others.
You could always manually increase/decrease the probabilities by repeating items in a list. For example, if you want roses to show up 75% of the time and violets 25% of the time, then your list could include 3 roses and 1 violet: {'rose', 'rose', 'rose', 'violet'}. Another possibility is using a separate list only for rare items, so it's decided at random whether one of those will show up or not. As for your concern on the environment changing too quickly, consider using information about how long the player last visited a particular location in order to restrict randomization (maybe not "how long", just how many other environments visited or events activated). Maybe there are easier ways, though, I am kinda new to Ren'Py myself.

sciencewarrior
Veteran
Posts: 356
Joined: Tue Aug 12, 2008 12:02 pm
Projects: Valentine Square (writer) Spiral Destiny (programmer)
Location: The treacherous Brazilian Rainforest
Contact:

Re: Would this be possible?

#6 Post by sciencewarrior »

Hollow Gourd wrote:I don't quite know the full extent of the functionality behind renpy.random.choice, but if it is truly as random as the name implies, that's not quite what I'm going for. It wouldn't be all that realistic if every time a player left and returned to a particular location, no matter how much time has elapsed, the available plants would be completely different. Additionally, I would need for certain flora/fauna to show up more rarely than others.

Based off of what you've said, though, it most certainly seems to be well within the parameters of both the language and the engine to execute all of what I have in mind. I suppose I'll cross the "how" hurdle when it actually comes up...xD;
You can spend months writing an algorithm to simulate an entire ecosystem with complex rules if you really want to, but there's no guarantee that after you are done you will have something that is more fun than if you just used renpy.random.choice with different lists per season. If you want to work with percentages, you can use randint:

Code: Select all

die = renpy.random.randint(1,100)
if (die <= 75):
  # 1 .. 75 -> 75% chance
  item = "something very common"
elif (die <=99):
  # 76 .. 99 -> 24% chance
  item = "something less common"
else:
  # 100 -> 1% chance
  item = "something rare"
Keep your script in your Dropbox folder.
It allows you to share files with your team, keeps backups of previous versions, and is ridiculously easy to use.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]