Ren'Py Free roam scenes without button

shitcrap1

Newbie
Game Developer
Aug 15, 2023
79
374
Hi everyone, I need help.
I've been trying to do free roams scenes but without a Navigation map, I've been looking for this but I only find Navigation screen tutorials
 

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,559
2,175
If not a navigation screen - then what do you plan instead?
It's difficult for us to offer advice about a solution, when we don't know what type of solution you are aiming for.

A common solution is different form of map, where the background is the picture of the current location and the clickable buttons are presented as a toolbar across the bottom (or top) of the screen. In a lot of ways, it's the same solution as a more recognizable map - with a background image and some clickable imagebuttons, only the position of those imagebuttons change.

Or are you thinking of something completely different? Perhaps pressing WASD or arrow keys to move around between locations?
 

crabsinthekitchen

Well-Known Member
Apr 28, 2020
1,539
8,421
You could also make parts of background as buttons so you have click on doors or stairs or stuff like that but that will be annoying if there's a lot of going back and forth through empty locations
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,132
14,815
I've been trying to do free roams scenes but without a Navigation map, I've been looking for this but I only find Navigation screen tutorials
If I consider your title as being more accurate than your question, what you want is a navigation screen that do not rely on a button bar presenting the different reachable locations. And, as implied by 79flavors, then crabsinthekitchen, it's done in the same way that the navigation screen tutorials you found. The only difference being the position and visual used for the clickable elements.

Python:
screen map():

    add map_background

    imagebutton:
        auto "clickable_element1_%s.png"
        xpos x_position_for_this_element
        xpos y_position_for_this_element
        action Jump( "corresponding_label1" )

    imagebutton:
        auto "clickable_element2_%s.png"
        xpos x_position_for_that_element
        xpos y_position_for_that_element
        action Jump( "corresponding_label2" )

    [And so on as long as there's clickable elements in the map]
But it's really all that can be answered to you due to the total lack of precision you gave. "Free roaming" mean so many things, and can be done in so many different way. It can be a old school 3D, like in Sakura Dungeon. A top view map, like in HS Tutor by example. A menu, like in Dark Magic by example. A first person view, like in Bad Memories by example. It can even be a real map like in Lust Hunter by example.

Anyway, as I said, except for the menu and the old school 3D, all rely on the same mechanism, a background with clickable elements on top.
 

shitcrap1

Newbie
Game Developer
Aug 15, 2023
79
374
If I consider your title as being more accurate than your question, what you want is a navigation screen that do not rely on a button bar presenting the different reachable locations. And, as implied by 79flavors, then crabsinthekitchen, it's done in the same way that the navigation screen tutorials you found. The only difference being the position and visual used for the clickable elements.

Python:
screen map():

    add map_background

    imagebutton:
        auto "clickable_element1_%s.png"
        xpos x_position_for_this_element
        xpos y_position_for_this_element
        action Jump( "corresponding_label1" )

    imagebutton:
        auto "clickable_element2_%s.png"
        xpos x_position_for_that_element
        xpos y_position_for_that_element
        action Jump( "corresponding_label2" )

    [And so on as long as there's clickable elements in the map]
But it's really all that can be answered to you due to the total lack of precision you gave. "Free roaming" mean so many things, and can be done in so many different way. It can be a old school 3D, like in Sakura Dungeon. A top view map, like in HS Tutor by example. A menu, like in Dark Magic by example. A first person view, like in Bad Memories by example. It can even be a real map like in Lust Hunter by example.

Anyway, as I said, except for the menu and the old school 3D, all rely on the same mechanism, a background with clickable elements on top.
I'm talking about a free roam events that happens after the regular scenes, just like in games like AOA academy, university of problems or being a dik, without needing a clickeable object or a menu to trigger the locations and the navigation map
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,132
14,815
I'm talking about a free roam events that happens after the regular scenes, just like in games like AOA academy, university of problems or being a dik, without needing a clickeable object or a menu to trigger the locations and the navigation map
I'm surely missing something important here, because I'm really tempted to answer that, if what you want is the map to appear automatically, then you just have to make it appear automatically.

But it can't be that simple... The answer to your question can not be "put call screen myMap every time you want the map to automatically appear". It's too obvious, too basic ; the first thing someone who is currently developing a game would try.
 
  • Sad
Reactions: 79flavors

Saki_Sliz

Well-Known Member
May 3, 2018
1,403
995
I know I've seen some creators abuse the image transformation mechanic to allow them to create side scrolling games, but I can't seem to find anything other than videos by .
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,132
14,815
I know I've seen some creators abuse the image transformation mechanic to allow them to create side scrolling games, but I can't seem to find anything other than videos by .
It's off topic, but since you talk about it, there's not really need to transforms for that. Something like this would already be a strong base:

Python:
screen horizontalScroll():

    timer 0.01 repeat True action Function( scroller.update, allBadies, allShoots, player )

    key "K_space" action Function( player.shoot, allShoots )
    key "K_up" action Function( player.jump )

    #  Play on negative values for x to make it move outside of the screen
    #  Strictly speaking would need a too big image for smooth performance, but
    # there's way to pass from one image to another.
    add scroller.background pos ( scroller.x, 0 )

    for i in allBadies:
        add i.picture pos (i.x, i.y )

    for i in allShoots:
        add i.picture pos (i.x, i.y )

    add player.picture pos ( player.x, player.y )

init python:

    class Scroller( renpy.python.RevertableObject ):

        def update( self, badies, shoots, player ):
            for i in shoots:
                i.update()
            for i in badies:
                i.update( shoots )
            player.update( shoots )
            self.x = self.x + 1


    class Badies( renpy.python.RevertableObject ):

        def update( self, shoots ):
            self.tick += 1
            if self.tick >= self.speed:
                self.tick = 0
                self.x += 1
                # eventually change the y value is the progression isn't linear

            for i in shoots:
                if i.x, i.y == COLLISION:
                    self.destroyed = True
                    i.shoots.destroyed = True
                    return

            if renpy.random.randint( 0, 10 ) >= 7 :
                shoots.append( Shoot( self.x, self.y, toLeft = True ) )

    class Player( renpy.python.RevertableObject ):

        def update( self, shoots ):
            self.tick += 1
            if self.tick >= self.speed:
                self.tick = 0

                self.x += 1

                if self.jump 
                    if self.jumpToUp:
                        self.y += 1
                    else:
                        self.y -= 1

                    if self.jumpY + JUMP_AMPLITUDE >= self.y:
                        self.jumpToUp = False

            for i in shoots:
                if i.x, i.y == COLLISION:
                    self.destroyed = True
                    i.shoots.destroyed = True

        def jump( self ):
            self.jumpY = self.y
            self.jump = True
            self.jumpToUp = True

        def shoot( self, shoots ):
            shoots.append( Shoot( self.x, self.y, toLeft = False ) )


    class Shoot( renpy.python.RevertableObject ):

        def update( self ):
            self.tick += 1
            if self.tick >= self.speed:
                self.tick = 0
                if self.toLeft:
                    self.x -= 1
                else:
                    self.x += 1
                # eventually change the y value is the progression isn't linear
 
  • Wow
Reactions: Saki_Sliz

Saki_Sliz

Well-Known Member
May 3, 2018
1,403
995
It's off topic, but since you talk about it, there's not really need to transforms for that. Something like this would already be a strong base:

Python:
screen horizontalScroll():

    timer 0.01 repeat True action Function( scroller.update, allBadies, allShoots, player )

    key "K_space" action Function( player.shoot, allShoots )
    key "K_up" action Function( player.jump )

    #  Play on negative values for x to make it move outside of the screen
    #  Strictly speaking would need a too big image for smooth performance, but
    # there's way to pass from one image to another.
    add scroller.background pos ( scroller.x, 0 )

    for i in allBadies:
        add i.picture pos (i.x, i.y )

    for i in allShoots:
        add i.picture pos (i.x, i.y )

    add player.picture pos ( player.x, player.y )

init python:

    class Scroller( renpy.python.RevertableObject ):

        def update( self, badies, shoots, player ):
            for i in shoots:
                i.update()
            for i in badies:
                i.update( shoots )
            player.update( shoots )
            self.x = self.x + 1


    class Badies( renpy.python.RevertableObject ):

        def update( self, shoots ):
            self.tick += 1
            if self.tick >= self.speed:
                self.tick = 0
                self.x += 1
                # eventually change the y value is the progression isn't linear

            for i in shoots:
                if i.x, i.y == COLLISION:
                    self.destroyed = True
                    i.shoots.destroyed = True
                    return

            if renpy.random.randint( 0, 10 ) >= 7 :
                shoots.append( Shoot( self.x, self.y, toLeft = True ) )

    class Player( renpy.python.RevertableObject ):

        def update( self, shoots ):
            self.tick += 1
            if self.tick >= self.speed:
                self.tick = 0

                self.x += 1

                if self.jump
                    if self.jumpToUp:
                        self.y += 1
                    else:
                        self.y -= 1

                    if self.jumpY + JUMP_AMPLITUDE >= self.y:
                        self.jumpToUp = False

            for i in shoots:
                if i.x, i.y == COLLISION:
                    self.destroyed = True
                    i.shoots.destroyed = True

        def jump( self ):
            self.jumpY = self.y
            self.jump = True
            self.jumpToUp = True

        def shoot( self, shoots ):
            shoots.append( Shoot( self.x, self.y, toLeft = False ) )


    class Shoot( renpy.python.RevertableObject ):

        def update( self ):
            self.tick += 1
            if self.tick >= self.speed:
                self.tick = 0
                if self.toLeft:
                    self.x -= 1
                else:
                    self.x += 1
                # eventually change the y value is the progression isn't linear
this is just what I was thinking about, navigating without a map.
But Jesus Christ, I didn't actually expect you to code a fricken graphics mod. I probably should have known better, knowing you. Coming across side scrolling Ren'py games or games that really took advantage of ren'py's mechanics to make graphically interesting experiences (in a vn engine) is what first turned me to explore ren'py, but since then haven't really looked into using ren'py more than just for VN and prototyping.
 

shitcrap1

Newbie
Game Developer
Aug 15, 2023
79
374
It's off topic, but since you talk about it, there's not really need to transforms for that. Something like this would already be a strong base:

Python:
screen horizontalScroll():

    timer 0.01 repeat True action Function( scroller.update, allBadies, allShoots, player )

    key "K_space" action Function( player.shoot, allShoots )
    key "K_up" action Function( player.jump )

    #  Play on negative values for x to make it move outside of the screen
    #  Strictly speaking would need a too big image for smooth performance, but
    # there's way to pass from one image to another.
    add scroller.background pos ( scroller.x, 0 )

    for i in allBadies:
        add i.picture pos (i.x, i.y )

    for i in allShoots:
        add i.picture pos (i.x, i.y )

    add player.picture pos ( player.x, player.y )

init python:

    class Scroller( renpy.python.RevertableObject ):

        def update( self, badies, shoots, player ):
            for i in shoots:
                i.update()
            for i in badies:
                i.update( shoots )
            player.update( shoots )
            self.x = self.x + 1


    class Badies( renpy.python.RevertableObject ):

        def update( self, shoots ):
            self.tick += 1
            if self.tick >= self.speed:
                self.tick = 0
                self.x += 1
                # eventually change the y value is the progression isn't linear

            for i in shoots:
                if i.x, i.y == COLLISION:
                    self.destroyed = True
                    i.shoots.destroyed = True
                    return

            if renpy.random.randint( 0, 10 ) >= 7 :
                shoots.append( Shoot( self.x, self.y, toLeft = True ) )

    class Player( renpy.python.RevertableObject ):

        def update( self, shoots ):
            self.tick += 1
            if self.tick >= self.speed:
                self.tick = 0

                self.x += 1

                if self.jump
                    if self.jumpToUp:
                        self.y += 1
                    else:
                        self.y -= 1

                    if self.jumpY + JUMP_AMPLITUDE >= self.y:
                        self.jumpToUp = False

            for i in shoots:
                if i.x, i.y == COLLISION:
                    self.destroyed = True
                    i.shoots.destroyed = True

        def jump( self ):
            self.jumpY = self.y
            self.jump = True
            self.jumpToUp = True

        def shoot( self, shoots ):
            shoots.append( Shoot( self.x, self.y, toLeft = False ) )


    class Shoot( renpy.python.RevertableObject ):

        def update( self ):
            self.tick += 1
            if self.tick >= self.speed:
                self.tick = 0
                if self.toLeft:
                    self.x -= 1
                else:
                    self.x += 1
                # eventually change the y value is the progression isn't linear
Fuck, I got busy with making the phone app in my game because I truly couldn't understand how this shit works and after learning a few things about the screen maps in the phone code I realized how to do it hahaha, it was so fucking simple thanks for the help and the patience dude