RPG Overworld Engine

A place for Ren'Py tutorials and reusable Ren'Py code.
Forum rules
Do not post questions here!

This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
Message
Author
User avatar
Dragonstar89
Regular
Posts: 163
Joined: Mon Aug 12, 2013 11:28 pm
Projects: TBA
Organization: Self
IRC Nick: dstar89
Deviantart: senpai-jake
Skype: dstar_891
Location: West Virginia, USA
Contact:

Re: RPG Overworld Engine

#31 Post by Dragonstar89 »

Hello! This script is great, and the examples in the source are pretty easy to follow with. The only thing I'm trying to find out, is how are buildings being specifically placed? I'm wanting to try and write around this script to handle multiple maps, and make different areas using custom tiles and such. I found the array of assets, where I added my skyscraper for example:

Code: Select all

["4", "cute_buildings/4", (258,320),None,False,"scinterior1"],
Script runs with no errors returned, but I have no clue how to actually draw in the image? I found this in overworld.rpy:

Code: Select all

                        for tile in tileList:
                            if col == tile[0]: #make buildings
                                self.buildings.append(OverworldDisplayable.Scenery(x,y, tile[1] + ".png", tile[2][0], tile[2][1], 2, tile[4], tile[5], tile[6]))
                                self.sceneryList.append(self.buildings[bldngCount])
                                self.NPCObstacles.append(self.buildings[bldngCount])
                                self.zList.append(self.buildings[bldngCount])
So, I might be staring at a snake I don't see, but I still don't have an idea of the actual placement of buildings here. Any ideas, or where the function is at? Thanks!
Beginning pre-production work on a project in Renpy. After being away for 5 years, it's time to get back in the game 8)

User avatar
Dragonstar89
Regular
Posts: 163
Joined: Mon Aug 12, 2013 11:28 pm
Projects: TBA
Organization: Self
IRC Nick: dstar89
Deviantart: senpai-jake
Skype: dstar_891
Location: West Virginia, USA
Contact:

Re: RPG Overworld Engine

#32 Post by Dragonstar89 »

Of course I figured it out as soon as I posted my question.

For anyone who wants to know, here's how the map layout gets drawn:

1)Tiles get defined. Define your tiles with their signifier (used in the actual matrices that draw the map), file source path (minus the extension, currently it uses .png automatically), size (XxY, the actual photo dimensions), roof dimensions (same thing, but for the roof tile image if the building has one), has roof (True if you have a roof for the building), goToLabel (string to jump to, good for switching maps or scenes to the interior), and the action which can be a text string. Here's the example code, with my own custom skyscraper tile added as "4":

Code: Select all

    #TILESETS
      
    #signifier, base name, building size, roof size, has roof, goToLabel, actionLabel (used for descriptions)
    moordell_tiles = [
    ["1","cute_buildings/1", (256,216), (256,256),True,None,"building_locked"],
    ["2","cute_buildings/2", (256,216), (256, 256),True,None,"building_locked"],
    ["3","cute_buildings/3", (256,216), (256,256),True,None,"building_locked"],
    ["*","cute_buildings/inn", (342,216),(342,256),True, "inn","inn_desc"],
    ["n", "cute_buildings/wall", (128,128),None,False,None,None],
    ["e", "cute_buildings/wall", (128,128),None,False,None,None],
    ["w", "cute_buildings/wall", (128,128),None,False,None,None],
    ["s", "cute_buildings/wall", (128,128),None, False,None,None],
    ["4", "cute_buildings/4", (258,320),None,False,None,"inn_desc"],
    ["p", "dirt", (128,128),None, False, None,None],
    ["g", "grass", (128,128),None, False, None,None],
    ]
2)Next, the program uses the signifiers of sprites, objects, etc., in a matrix to layout the map. Here's my example one:

Code: Select all

    moordell_layout =[
    "nnnnnnnonnnnnnn",
    "w3oo*ooo4oo4ooe",
    "woooooo+ooooooe",
    "woooooooooooooe",
    "w3oooooo1oooooe",
    "woooooooooooooe",
    "woooooooooooooe",
    "w2o3ooooo1oo2oe",
    "woooooooooooooe",
    "woooooooooooooe",
    "w3ooo4o3o2oo1oe",
    "woooooooooooooe",
    "woooooooooooooe",
    "w1o2o2ooo3o4ooe",
    "woooooooooooooe",
    "woooooooooooooe",
    "sssssssssssssss",
    ]
Notice the number '4" in there. That's where my Skyscraper tile will be placed in the graph/map when it is drawn out. The same goes for the other buildings, and even the walls ("w" = west wall, "e" = east wall, "s" = south wall and so forth).

Hope it helps.
Beginning pre-production work on a project in Renpy. After being away for 5 years, it's time to get back in the game 8)

User avatar
Mole-chan
Veteran
Posts: 333
Joined: Thu Aug 27, 2009 12:46 am
Completed: DUAEL, Escape from Puzzlegate
Projects: A Bird with Gold-Mended Wings
Deviantart: mole-chan
Skype: mole-chan
itch: moleworks
Contact:

Re: RPG Overworld Engine

#33 Post by Mole-chan »

Dragonstar89 wrote: Sat May 18, 2019 4:08 pm Of course I figured it out as soon as I posted my question.

For anyone who wants to know, here's how the map layout gets drawn:
<snip snip for brevity>
Haha, it's alright. Happens to the best of us.

I'm sure any visitors would appreciate the explanation, anyway. :wink:

User avatar
Dragonstar89
Regular
Posts: 163
Joined: Mon Aug 12, 2013 11:28 pm
Projects: TBA
Organization: Self
IRC Nick: dstar89
Deviantart: senpai-jake
Skype: dstar_891
Location: West Virginia, USA
Contact:

Re: RPG Overworld Engine

#34 Post by Dragonstar89 »

I do have a question regarding roof tiles.

Are character sprites enabled to move through them? As in, behind them? I set one of my buildings to utilize the roof, but it still has collision as if it were a normal object, which is causing problems for making a city-themed map.

Any enlightening would be much obliged.
Beginning pre-production work on a project in Renpy. After being away for 5 years, it's time to get back in the game 8)

User avatar
Mole-chan
Veteran
Posts: 333
Joined: Thu Aug 27, 2009 12:46 am
Completed: DUAEL, Escape from Puzzlegate
Projects: A Bird with Gold-Mended Wings
Deviantart: mole-chan
Skype: mole-chan
itch: moleworks
Contact:

Re: RPG Overworld Engine

#35 Post by Mole-chan »

Dragonstar89 wrote: Tue May 21, 2019 4:23 pm I do have a question regarding roof tiles.

Are character sprites enabled to move through them? As in, behind them? I set one of my buildings to utilize the roof, but it still has collision as if it were a normal object, which is causing problems for making a city-themed map.

Any enlightening would be much obliged.
Hello!
I'm so sorry I didn't see this earlier. I never even got an email, so I hope my answer is still useful after such a massive delay.

The roof tiles should not have any collision for either the player or NPC's, as long as hasRoof is set to true in the array, and the filename matches the building's file name with a "_roof" suffix. If those are both true, the roof will be set to its own collision group that neither the player or NPC's check against.

User avatar
luat1995
Newbie
Posts: 24
Joined: Mon Nov 07, 2016 8:27 am
Completed: Home Alone
Github: https://github.com/luatsenpai
itch: https://luatsenpai.i
Location: vietnamese
Contact:

Re: RPG Overworld Engine

#36 Post by luat1995 »

Mole-chan wrote: Wed Jan 14, 2015 2:05 am ImageImage


Well, after a ton of work, and just as much asking silly questions (for which I can't thank you lovely forum-goers enough for answering! Thank you!), I've finally completed this. Hopefully it proves useful enough to pay you back. :'3

It’s a reasonably featured RPG overworld engine for use in Ren’py. The engine is intended to be used alongside Jake’s battle engine, but is versatile enough for pretty much anything that requires real-time movement in a hub world.

Download
(The download is a game directory, not a build. Put it in your Ren'py folder and launch/edit from there)

Features
  • Easy, text based layouts
  • Scrolling and static maps
  • Static and roaming NPC’s with user defined ranges
  • Easy conversation system based on labels
  • Z-ordering, with three layers of depth
Commercial Use
For now, the engine is released under a Attribution-NonCommercial 3.0 United States (CC BY-NC 3.0 US) license. However, I am more than flexible about licensing it to those who are interested. As it is such a modest engine, the terms will be generous to say the least. I can be contacted here, or by email.

Art Credits:
NPC sprite- charas-project
NPC Portrait - sapiboonggames@ Lemmasoft
Tileset - Planet Cute
Hello, I tried creating tall character, but it's stuck

Image

I want change to like this:

Image
What should i do?
Please help me
Sorry for my bad english

User avatar
Mole-chan
Veteran
Posts: 333
Joined: Thu Aug 27, 2009 12:46 am
Completed: DUAEL, Escape from Puzzlegate
Projects: A Bird with Gold-Mended Wings
Deviantart: mole-chan
Skype: mole-chan
itch: moleworks
Contact:

Re: RPG Overworld Engine

#37 Post by Mole-chan »

luat1995 wrote: Sat Aug 17, 2019 3:49 am Hello, I tried creating tall character, but it's stuck

Image

I want change to like this:

Image
What should i do?
Please help me
Sorry for my bad english
Hello,
I'm sorry I wasn't alerted to this earlier.
Unfortunately, due to how the collision system works in this version, there is no way to do this at present, but I'd be happy to look into use cases like this for an update I've been sitting on.

Sorry this was so late, and ultimately not much help.

User avatar
lucky77
Newbie
Posts: 2
Joined: Sat Oct 22, 2022 8:08 pm
Projects: get out of bed
Discord: tiramisu#0601
Contact:

Re: RPG Overworld Engine

#38 Post by lucky77 »

I know this is a really old post, but I have a question that I can't find the answer to no matter how many times I parse the code of all readable files and google whatever I think might help. This is my first time making a game, though, so I apologize if any of these questions I ask are plain dumb.

I can't get the player to interact and activate a label in my own game's build. I put the untouched files into a game folder to see if it worked there while also cross referencing the two files for errors, and the only interactions that worked was the "inn" (not the inn_desc) and the Ari caught scene, along with the portal to leave. I approached the NPC's from all angles, and even tried clicking on them both, but nothing would trigger their interactions. None of the buildings had the "building_locked" description either. I understand that the part that's not working here are the action/conversation labels (but the battle labels somehow work?). But no matter how hard I look, I can't seem to find any way to activate them.

As for my own game, I've set up the map so that you can only move left and right, and "turning to face" (moving "up" towards) an "object" (just a symbol in the ground texture) will have the player interact with it (but actually, you're interacting with the tile above you). So my layout ends up looking something like this, sorry if it's not formatted correctly for this blog;

moordell_layout =[
"sswsssss*ssssss",
"soooooo+oooooos",
"sssssssssssssss",
]

with the tiles in use being:

["*","cute_buildings/inn", (342,216),(342,256),True, "inn","inn_desc"],
["w", "yellow", (300,300),None,False, "pile","pile_desc"],
["s", "white", (300,300),None,False,None,None],
["g", "purple", (300,300),None, False, None,None],

so yellow tiles are meant to be intractable, the white tiles are barriers, while the purple tiles are the ground. I included the inn as I tried to see if I could interact with it in this context, which I couldn't, just like the yellow tile. There is no error message, I simply can't activate these labels. Is there a keybinding?? One of the files, overworld.rpy I believe, says you should be able to interact with objects by facing up when close to them, or getting close to npcs, so am I doing something else wrong, or is it a movement or collision issue? Maybe I'm using an incompatible version of Ren'Py (7.4.11)? I am pulling my hair out trying to figure out how to activate these labels and action labels.

DarthJMG2003
Newbie
Posts: 7
Joined: Thu Aug 20, 2020 11:21 pm
Location: Mexico City
Contact:

Re: RPG Overworld Engine

#39 Post by DarthJMG2003 »

try interacting with them with spacebar, that is what i do, I don't have any problems but code incompability with the latest version of renpy and python, so you are supposed to be fine. The code needs to be updated...

User avatar
lucky77
Newbie
Posts: 2
Joined: Sat Oct 22, 2022 8:08 pm
Projects: get out of bed
Discord: tiramisu#0601
Contact:

Re: RPG Overworld Engine

#40 Post by lucky77 »

DarthJMG2003 wrote: Sun Nov 06, 2022 7:10 pm try interacting with them with spacebar, that is what i do, I don't have any problems but code incompability with the latest version of renpy and python, so you are supposed to be fine. The code needs to be updated...
THANK YOU SO MUCH, the spacebar works to get the descriptions and interact with npcs... I don't know how I missed that one when pressing literally every key to try to activate it lol. Still not sure how to make the "walk into to interact" kind of mechanic work as it has proven to in my other tests of the engine, but just this should be enough to get what I need done in my game for now. Hopefully I don't run into any more problems, and maybe can reconfigure the interact button, as spacebar is kind of out of the way...

Thanks again ;;;;

IVANtheVN
Newbie
Posts: 3
Joined: Fri Aug 25, 2023 1:25 am
Contact:

Re: RPG Overworld Engine

#41 Post by IVANtheVN »

Heya! I know I'm talking in an inactive forum (maybe), but I really need a help. When I try to test the Overworld Engine, appears the ValueError: list.remove(x): x is not in list How can I solve it?

[img]C:\Users\DELL I7\Pictures\Screenshots\Captura de pantalla (62).png[/img]

Post Reply

Who is online

Users browsing this forum: No registered users