Text Adventure Engine for Ren'Py

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.
Post Reply
Message
Author
cetra777
Newbie
Posts: 1
Joined: Tue May 03, 2016 9:03 pm
Projects: Text Adventure Engine for Renpy, See my itch
Github: cetra777
itch: autistmouse
Contact:

Text Adventure Engine for Ren'Py

#1 Post by cetra777 » Thu Mar 28, 2019 6:51 pm

Hello I think this is the right place for this.

I am new to the forums. I could not find a text adventure system for Ren'Py that met my needs. So I decided to give making one a try. It works pretty well. It is licensed under MIT, the same as Ren'Py and I hope you enjoy it. Please feel free to let me know if you have questions and I will answer what I can. Also I would love to see where it goes in terms of developing as a tool. So please let me know if you make any changes. The git for it is public. Cheers.

To use it just clone the repository and run it in your ren'Py launcher.

There is a two room demo with an item to pick up in each room. Gives the functionality pretty well. I will continue to make improvements (especially in commenting) as I have time. Cheers!

https://github.com/cetra-777/renpy-text ... ure-engine

NaeemBolchhi
Newbie
Posts: 9
Joined: Sun Sep 03, 2017 10:59 am
Contact:

Re: Text Adventure Engine for Ren'Py

#2 Post by NaeemBolchhi » Wed Sep 25, 2019 6:02 am

This is really interesting. With some background music and maybe some basic bgs, this could easily create enjoyable games. But maybe instead of having to type commands, a list of commands should be visible on the screen at all times. For example, if you're playing on Android, typing every time would be pretty annoying.

Hseo
Regular
Posts: 37
Joined: Thu Sep 24, 2009 10:42 am
Completed: High School Life:HSL
Deviantart: greeeed
Contact:

Re: Text Adventure Engine for Ren'Py

#3 Post by Hseo » Fri Oct 04, 2019 5:54 pm

NaeemBolchhi wrote:
Wed Sep 25, 2019 6:02 am
This is really interesting. With some background music and maybe some basic bgs, this could easily create enjoyable games. But maybe instead of having to type commands, a list of commands should be visible on the screen at all times. For example, if you're playing on Android, typing every time would be pretty annoying.
It's an old system / game type.
Where you play by writing your answer instead of clicking on visible button.
Some have eastern eggs answer.

Thanks op!

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3038
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor
Contact:

Re: Text Adventure Engine for Ren'Py

#4 Post by Imperf3kt » Fri Oct 04, 2019 6:10 pm

Hseo wrote:
Fri Oct 04, 2019 5:54 pm
NaeemBolchhi wrote:
Wed Sep 25, 2019 6:02 am
This is really interesting. With some background music and maybe some basic bgs, this could easily create enjoyable games. But maybe instead of having to type commands, a list of commands should be visible on the screen at all times. For example, if you're playing on Android, typing every time would be pretty annoying.
It's an old system / game type.
Where you play by writing your answer instead of clicking on visible button.
Some have eastern eggs answer.

Thanks op!
There were some upgrades to the genre that included a list of available commands displayed on screen to take out the guessing factor, but I would agree that the attraction to this style of game is indeed in the writing your own answer rather than pressing a button.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py
Free Android GUI - Updated occasionally

verysunshine
Veteran
Posts: 328
Joined: Wed Sep 24, 2014 5:03 pm
Organization: Wild Rose Interactive
Contact:

Re: Text Adventure Engine for Ren'Py

#5 Post by verysunshine » Sat Mar 21, 2020 8:40 pm

Some of the choices in the code here are strange. Firstly, only using if statements for player movement is weird. You've already made an error by leaving out commands for "e" and "w", but the bigger issue is how the game decides where to go once you have an input.

Code: Select all

        elif command == "n":
            if location == "room":
                dialog = "There is no way to go north."
                return

            if location == "room2":
                dialog = "You move into another room. It seems like a generic room."
                renpy.jump("room")
                return
There are only two rooms in the demo, but anyone who would want to make an adventure game would want more rooms. If a player can travel north in ten different rooms, that's ten instances of "if location==". The code will be repetitive, difficult to modify, and much more complex than it needs to be. There are better ways to store that data. Even someone who's new to coding could probably point out the response for not being able to go a certain direction should be last in the list.

Code: Select all

        elif command == "n":

            if location == "room2":
                dialog = "You move into another room. It seems like a generic room."
                renpy.jump("room")
                return
                
            else:
                dialog = "There is no way to go north."
                return
Second, much of the code isn't used at all. Special mention goes to the code to make icons spin.

The code contains what looks like a very fancy character and equipment system. A simpler version of that would probably be fun in a text adventure game. I wanted to add a character, but I can't put him in a room because there's no function to do that. Even if I could, all the combat-related code is gone.

This could be a really useful text adventure base, but the strange choices indicate it might not be an engine yet.

Build the basics first, then add all the fun bits.

Please check out my games on my itch.io page!

User avatar
gas
Miko-Class Veteran
Posts: 718
Joined: Mon Jan 26, 2009 7:21 pm
Contact:

Re: Text Adventure Engine for Ren'Py

#6 Post by gas » Mon Mar 23, 2020 6:00 am

Where is the engine?
For people to know:
A text adventure engine should own a parser that process the input (verb, verb+subject, errors).
It should have a global routine for movement and location check.
It should own a way to process game statuses (like puzzle conditions, one way routes and similars).
Items are managed by a location/owned mechanic (as you can drop them).

It can be easily done in python (so, in Renpy) and there's a lot of documentation and tutorials around, being text adventures '70 default projects to learn coding.
There you can find a complete code, it's really easy to convert it to renpy.
https://blog.trinket.io/python-text-adventure/
If you want to debate on a reply I gave to your posts, please QUOTE ME or i'll be not notified about.

10 ? "RENPY"
20 GOTO 10

RUN

Post Reply

Who is online

Users browsing this forum: No registered users