How do I do a Timed choice?

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.
Message
Author
Counter Arts
Miko-Class Veteran
Posts: 649
Joined: Fri Dec 16, 2005 5:21 pm
Completed: Fading Hearts, Infinite Game Works
Projects: Don't Save the World
Organization: Sakura River
Location: Canada
Contact:

How do I do a Timed choice?

#1 Post by Counter Arts »

This is a feature is some ren'ai games like Sakura Wars and Love Hina Advanced.

I was wondering if it was possible to do something like this.

I also wanted to put in another feature in a game where the player can enter a different mode where his selection of choices actually changes completely.

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: How do I do a Timed choice?

#2 Post by PyTom »

Counter Arts wrote:This is a feature is some ren'ai games like Sakura Wars and Love Hina Advanced.

I was wondering if it was possible to do something like this.
One can fake it using ui.pausebehavior() along with renpy.display_menu(). I personally consider such a feature misguided, so I never really went in and added an easy way to use it.
I also wanted to put in another feature in a game where the player can enter a different mode where his selection of choices actually changes completely.
What do you mean by this?
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Dre
Regular
Posts: 118
Joined: Tue Jan 25, 2005 8:55 pm
Location: Allugic.com
Contact:

#3 Post by Dre »

I also wanted to put in another feature in a game where the player can enter a different mode where his selection of choices actually changes completely.
Use if statements.

If mode is "mastery" jump to these choices.

Or something along the lines of that.

Counter Arts
Miko-Class Veteran
Posts: 649
Joined: Fri Dec 16, 2005 5:21 pm
Completed: Fading Hearts, Infinite Game Works
Projects: Don't Save the World
Organization: Sakura River
Location: Canada
Contact:

#4 Post by Counter Arts »

Well I suppose I just want the player to always have an option to go into a "mode" where the character starts to think differently and actually thinks of different options. However, using this ablitiy costs some mental energy points. Also, although the options might be better... sometimes it's not.

I would like to experiment with timed choices and a mode like this to create...

"Bullet Time"

Okay... maybe I've just been playing too much Viruta Cop 3. But it could be used in an interesting way though.

Like with Sakura Wars, certain options appear and disappear with time. One example is when a girl runs away. You have a quarter of the normal reaction time to actually stop her before that option disappears.

If you combined it with bullet time you can slow down events involving actual time including the reaction time. At the same time, you're given more time to think of more options and eventually more options appear earlier.

For a climax of a tragic girl's plotline (a side/secret one probably) this can be done well. The situation is you kill her or you die yourself.

You are at first given one choice, to shoot her. If you just wait it out you will be killed and get a bad ending. However, you go to bullet time as you start and eventually you get another option. You have to wait a long time in bullet time to actually figure out something else. While you are waiting, you are watching the reaction time meter go down with the option of shooting her always highlighted. All you have to do is just press select.

Of course, the other option doesn't appear at all if you don't use bullet time. Which introduces an interesting problem.

For every choice you make, there "could" be more choices. Of course, you can't just overthink everything because that would drain away too much energy. Include multiple levels of "bullet time" and you just got a few degrees of complexity too much for blind choice making when you're playing.

This also kinda helps the problem of ren'ai games having "limited" options.

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

#5 Post by PyTom »

I think this is a bad idea, as visual novels are really a form of storytelling, and to toss in random arcade elements seems to me like it would tend to distract from that storytelling. If the VN form isn't enough, then one should consider if a VN is the right medium for your story.

Anyway, here's some code that does implement a timed menu.

Code: Select all

init:
  python:

    def timeout_menu(choices, default, timeout):
        time = 0
        
        while True:
            if time >= timeout:
                return default
            
            menu_choices = [ ]

            pausefor = timeout - time
            
            for label, rv, show_time in choices:
                if show_time <= time:
                    menu_choices.append((label, rv))
                else:
                    pausefor = min(pausefor, show_time - time)

            ui.pausebehavior(pausefor)

            renpy.display_menu(menu_choices, interact=False)

            rv = ui.interact()
                   
            if rv is not False:
                return rv

            time += pausefor


label try_timeout_menu:
    "Before the menu."

    $ result = timeout_menu(
        [ ('Make a choice:', None, 0),
          ('Shoot.', 'shoot', 0),
          ('Duck.', 'duck', 2.0),
          ('Run.', 'run', 4.0) ],        
        'get_shot', 5.0)

    $ run_time = time.time() - start_time

    "Chose %(result)s."
I should point out thar right now the timing in Ren'Py is fairly imprecise. (Think about 20hz or so.) I may try improving that in 5.4, but for now realize that the timing can be off by a bit.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Counter Arts
Miko-Class Veteran
Posts: 649
Joined: Fri Dec 16, 2005 5:21 pm
Completed: Fading Hearts, Infinite Game Works
Projects: Don't Save the World
Organization: Sakura River
Location: Canada
Contact:

#6 Post by Counter Arts »

Well I can argue that bullet time was used in the matrix as a tool for storytelling. It's not really a random arcade feature.

Actually, it's already present in written stories somewhat. "Bullet Time" could actually be when the author starts to really discribe a moment. They say how the sweat drips off the character's face, how dangerously close the spear was to killing them, how soon they are to running out of options, etc...

At least, that's how I see it.

I kinda realized this after watching an anime based on an VN was. Some event that took a long time in the VN lost some meaning in the anime. This really wasn't because the anime was linear and the VN was not.

Of course I was quite annoyed with how some events in the VN could not be captured in the anime because of various reasons that did make sense. It just couldn't be helped.

I do have other ways of doing something like an "enhanced" mode. Bullet time is just one way. Also, deductive story writing is fun too.

User avatar
mikey
Lemma-Class Veteran
Posts: 3249
Joined: Sat Jan 10, 2004 6:03 am
itch: atpprojects
Contact:

#7 Post by mikey »

I would also say bullet time isn't all that good. Somewhere around here I suggetsted that for this effect the Vn could have commands like

- run after her
- wait

and subsequently
- run now
- wait even more


et cetera.

I believe that if you want "action", it's better to perhaps look at turn-based strategies and make the action in a VN in this manner. Unless you want to do an all-out arcade thing like I/T, a typical VN player won't be thrilled, because the VN is all about being static, text and the reading.

The way I see it, button- and reflex-based action in a VN it always sounds better than it actually is when it's implemented.

For bullet time, you can also consider the effects that the Phoenix Wright games gave (disappearing BG), or simply adding heartbeat and loading sepia pictures - the words accompanying will do the rest. They are often more powerful than on-screen action.

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

#8 Post by PyTom »

For the record, I agree with mikey... I think integrating arcade aspects into a VN is probably a bad idea, as they're likely to take people by surprise, and not in a good way.

That being said, I updated the timed_choice code. Here's the updated version.

Code: Select all

init -100:
  python:


    class TimerBar(renpy.display.behavior.Bar):

        def __init__(self, timeout, range, *args, **properties):
            super(TimerBar, self).__init__(range, 0, *args, **properties)
            
            self.timeout = timeout

        def render(self, w, h, st, at=0):
            fraction = min(st / self.timeout, 1.0)

            if fraction < 1.0:
                renpy.display.render.redraw(self, 0)

            self.value = fraction * self.range

            return super(TimerBar, self).render(w, h, st, at)
            

    def timeout_menu(choices, default, timeout):
        import time

        start = time.time()
        
        while True:
            if time.time() >= start + timeout:
                return default
            
            menu_choices = [ ]

            pausetil = start + timeout
            
            for label, rv, show_time in choices:
                if show_time + start <= time.time():
                    menu_choices.append((label, rv))
                else:
                    pausetil = min(pausetil, start + show_time)

            ui.pausebehavior(pausetil - time.time())

            renpy.display_menu(menu_choices, interact=False)

            rv = ui.interact()
                   
            if rv is not False:
                return rv

init:
    image bar5s = TimerBar(5.0, 750, style='prefs_slider', xpos=25, ypos=10, xanchor='left', yanchor='top', xmaximum=750)
    
label splashscreen:

    scene bg whitehouse

    "Hey! Remove zoomwh.jpg! And this file!"

    "You're about to make a timed choice, so get ready."

    show bar5s

    $ result = timeout_menu(
        [ ('She pulls out a gun! You...', None, 0),
          ('Shoot Back!', 'shoot_back', 0),
          ('Take Cover!', 'take_cover', 2.0),
          ('Go into Bullet Time!', 'bullet_time', 4.5) ],        
        'get_shot', 5.0)


    hide bar5s
    
    jump expression result

label shoot_back:

    "You shoot back!"

    "Your aim is true, and she falls down dead."

    "Some time later..."

    "George Lucas comes in and revises things so she shot first."

    "But the internet fanboys won't stand for it, and start printing
     up t-shirts saying \"You Shot First!\""

    "This is all academic, because shooting her leads to a bad ending."

    jump end

label take_cover:

    "You take cover behind a nearby scooter."

    "She fires all of the bullets in the revolver into the scooter,
     leaving her unarmed."

    "Now, where do we go from here?"

    jump end

label bullet_time:

    "You try to do a matrix-like bullet time, dodging the bullets she
     sends at you."

    "Of course, that was just a movie."

    "You're quite dead."

    jump end

label get_shot:

    "She shoots you."

    "There's not much else to say, as you're busy bleeding to death."

    "Well, that's what you get for procrastinating."

    jump end

label end:
    return
Hopefully, people will try this and come to their senses.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

mrsulu
Regular
Posts: 99
Joined: Tue Jan 11, 2005 5:09 pm
Completed: Lady Sugarplum's Bad Day
Contact:

#9 Post by mrsulu »

Yeah, throwing in timed actions in a game that doesn't always have them can be tricky to do well. I don't think it's impossible, though.

I think the design challenge revolves around making sure you A) don't throw the player into a completely new genre of game unexpectedly, B) when the timed sequence starts you have some time to adjust to it, and C) the consequences for failing the timed sequences not be totally devastating.

Those old LucasArts adventure games had simple timed sequences now and then. In Full Throttle, your hero was hanging on the hood of a big airplane/truck/space shuttle that was barreling towards a cliff. You had plenty of time to do the actions during the opportunities (grab the guy's weapon when he was brandishing it), but you still had to do it at the right time. If you waited too long (or didn't understand the puzzle right away), you would actually die. However, as your character fell into the canyon, he would say in a voice-over, "Wait, I don't remember it ending like that..." and start you over again. I think I only needed two tries, but it did make me more tense than if I could have stayed on the front of the truck forever.

It could have a lot of fun applications, like with a fuse to the TNT slowly creeping across the screen while you argue with the villain, or the James Bond-like "excrutatingly slow lowering device." Or even just waiting outside a cafe until the right romantic prospect walked out and catching them before they got in the cab.

User avatar
mikey
Lemma-Class Veteran
Posts: 3249
Joined: Sat Jan 10, 2004 6:03 am
itch: atpprojects
Contact:

#10 Post by mikey »

Well, all the timed events you described were different to timed *choices*. I think that the JB-style thing, as well as the LA timed sequences could work because the timed event was just an obstacle you had to overcome (and you could repeat it forever). The successful completion was just in the correct choices, not really their speed, which is arcade territory.

A choice is a bit different. Many players (including me) like to play their first time "honestly", making choices they identify with etc. They tend to think about how the consequences will be and so on, so a timed *choice* will usually feel wrong unless it's somehow strangely connected to the point of the game (and no I don't like the way, Love Hina Advance did it). When players don't get the arcade part right, in this case it can end the game or make them lose the girl they played for, it will inevitably feel very cheap.

So all in all, timed events can under certain circumstances work, but timed choices are much more problematic.

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

#11 Post by PyTom »

I should point out that in the good old LucasArts adventures, while there may have been timed sequences, it was rare that they could hurt you permanently. And in the cases where they could, the conditions were absurd to the point of hilarity? (Ever try holding your breath underwater in Monkey Island... for 16 minutes?)
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

absinthe
Regular
Posts: 194
Joined: Sat Dec 10, 2005 12:26 am
Contact:

#12 Post by absinthe »

The biggest issue I'd see with this is that not everybody reads at the same speed. So what'd be an leisurely choice for one person might be a "what? I only read half of that before I died!" for someone else. The player could always tweak the settings or reload, but that'd be annoying (at least to me).

And the example you gave, of the "Wait, I don't remember it happening like that!" seems like it would have been cute in the first game I saw it in (especially a pulpy Indiana Jones style game) but really annoying after that, since, fundamentally, you're just forcing the player to retry over and over until they "get it right".

But then, most RPGs boil down to "beat the bad guy or reload and beat the bad guy"... it's just a matter of how many times you have to reload (in my case, usually a lot). And I still like RPGs. <g> Although I definitely start to feel bad for the bad guys, because they just don't know they're gonna lose no matter what.

Then again, I could definitely see this trick adding to the drama of a more hybrid game... I really love the VN style, not necessarily for the conventions, but for the plots and the characters. That's what I really want in a game, anyway. :)

[[Edited to add]] Hehehehe, just read the example more carefully. That cracks me up... I need a t-shirt that says "You Shot First!"...
Last edited by absinthe on Thu Feb 02, 2006 11:10 pm, edited 1 time in total.
My 2007 NaNo entry: Eidolon

Counter Arts
Miko-Class Veteran
Posts: 649
Joined: Fri Dec 16, 2005 5:21 pm
Completed: Fading Hearts, Infinite Game Works
Projects: Don't Save the World
Organization: Sakura River
Location: Canada
Contact:

#13 Post by Counter Arts »

Oh... probably it's only a good idea to make a timed choice a real pain only if getting a certain plotline already a big pain

mrsulu
Regular
Posts: 99
Joined: Tue Jan 11, 2005 5:09 pm
Completed: Lady Sugarplum's Bad Day
Contact:

#14 Post by mrsulu »

I like the comment about "...lose no matter what." At my old gaming haunts, we called NPCs euphemistically "the destiny-impaired".

I think there are some expectations/packaging issues, here.

When I sit down to play a romance game (or a LucasArts-style adventure), I don't expect that my reflexes are going to be critical to success unless it's advertised on the cover of the game ("Action/romance game from Counter Arts!"). At the same time, what Counter Arts is saying about "well, if it's the hard storyline then reflexes are OK"---I think what we're seeing there is what I was calling the narrativist vs. mapper approach to gaming. Mikey is all narrativist, but Counter Arts is thinking like a mapper.

See this thread:

http://lemmasoft.renai.us/forums/viewto ... arrativist

I figure if the challenge is clearly demarked (like a warning early on about the hard route), people will either try for the hard storyline or be content to know that it *could* be done. I can remember old arcade-y games that had save points, but the manual told you that you'd get a special ending if you could run the whole 4+ hour game without saving or restarting. Completionist and obssessives have something to work on, and the rest of us can get to the "official" end easily.

(Would Counter Arts put in a difficulty setting for people who weren't up to the reflex challenge? That would be interesting.)

absinthe
Regular
Posts: 194
Joined: Sat Dec 10, 2005 12:26 am
Contact:

#15 Post by absinthe »

mrsulu wrote:I like the comment about "...lose no matter what." At my old gaming haunts, we called NPCs euphemistically "the destiny-impaired".
I'm going to yank that term for my next gaming session... my players will get a kick out of it. :)

I'm definitely a narrativist with simulationist tendencies. Well, I think, anyway... I took this online quiz once, at any rate. :D
My 2007 NaNo entry: Eidolon

Post Reply

Who is online

Users browsing this forum: Google [Bot]