Text Parser

A place to discuss things that aren't specific to any one creator or game.
Forum rules
Ren'Py specific questions should be posted in the Ren'Py Questions and Annoucements forum, not here.
Post Reply
Message
Author
FromMomsBasement
Newbie
Posts: 6
Joined: Fri Apr 19, 2013 10:15 pm
Contact:

Text Parser

#1 Post by FromMomsBasement » Fri Apr 19, 2013 11:26 pm

I want to make a graphic text adventure in the vain of Cypher
http://www.youtube.com/watch?v=23T4s_usZio
Would I be able to do this in renpy? Could I make the Parser in renpy, and if not, could I make a parser in python and import it to renpy?

gekiganwing
Lemma-Class Veteran
Posts: 2472
Joined: Wed Sep 29, 2004 1:38 pm
Contact:

Re: Text Parser

#2 Post by gekiganwing » Sat Apr 20, 2013 7:50 am

That's a good question. There are quite a few things that can be done with Ren'py, but I don't know if you would be able to create a text parser with it. You may benefit more by trying other game engines such as Inform 7, TADS 3, or ADRIFT 5 Developer.

Also, were you referring to Cypher: Cyberpunk Text Adventure?

FromMomsBasement
Newbie
Posts: 6
Joined: Fri Apr 19, 2013 10:15 pm
Contact:

Re: Text Parser

#3 Post by FromMomsBasement » Sat Apr 20, 2013 8:11 am

gekiganwing wrote:
Also, were you referring to Cypher: Cyberpunk Text Adventure?
Yes, visually I want something very similar. I thought about using Interactive Fiction engines like Hugo, but I want a specific graphical layout and effects that I don't think they can do. Plus, I want this to be a commercial game and games made with traditional IF engines seem to only draw the attention of those already part of the community.

User avatar
kankan
Regular
Posts: 80
Joined: Tue Mar 06, 2012 1:47 am
Contact:

Re: Text Parser

#4 Post by kankan » Sat Apr 20, 2013 8:11 am

Since Ren'py lets you program in Python, you can do close to whatever you want. I'd agree with gekiganwing in saying that it's not the ideal engine for text parsing though. You'd probably end up having to use either a ton of "does the string contain these words" (the tedious way) or regular expressions/regexes which are a pain to use (heck, I've never even tried using Python regexes). I strongly suggest you use an engine built specifically for text adventures though; parsing is a huge pain unless you force the player to follow formats pretty closely.

FromMomsBasement
Newbie
Posts: 6
Joined: Fri Apr 19, 2013 10:15 pm
Contact:

Re: Text Parser

#5 Post by FromMomsBasement » Sat Apr 20, 2013 8:30 am

kankan wrote:Since Ren'py lets you program in Python, you can do close to whatever you want. I'd agree with gekiganwing in saying that it's not the ideal engine for text parsing though. You'd probably end up having to use either a ton of "does the string contain these words" (the tedious way) or regular expressions/regexes which are a pain to use (heck, I've never even tried using Python regexes). I strongly suggest you use an engine built specifically for text adventures though; parsing is a huge pain unless you force the player to follow formats pretty closely.
I'm not under any delusions that this will be easy, and I'll probably have to make a few small prototypes before I even get started on the main project.
But anything I work out I'll share with the renpy, python, and IF community.

User avatar
kankan
Regular
Posts: 80
Joined: Tue Mar 06, 2012 1:47 am
Contact:

Re: Text Parser

#6 Post by kankan » Sat Apr 20, 2013 8:47 am

Ah, well. If you're set on Ren'py, try giving this book a lookover. I probably have more of a personal grudge against regex than it actually being horrible to learn (to be fair, who wants to be stuck using regex for 30+ hours? Pray you never have a required project that needs it). Getting simple instructions through shouldn't be too bad, it's just when you have people entering riddles as commands that gets tricky.

It's a good idea though; now I'm tempted to try my hand at parsing again sometime. Best of luck to you!

FromMomsBasement
Newbie
Posts: 6
Joined: Fri Apr 19, 2013 10:15 pm
Contact:

Re: Text Parser

#7 Post by FromMomsBasement » Sat Apr 20, 2013 9:14 am

Thanks.

User avatar
Greeny
Miko-Class Veteran
Posts: 921
Joined: Sun Dec 20, 2009 10:15 am
Completed: The Loop, The Madness
Projects: In Orbit, TBA
Organization: Gliese Productions
Location: Cantankerous Castle
Contact:

Re: Text Parser

#8 Post by Greeny » Sat Apr 20, 2013 5:49 pm

It's definitely doable in Ren'Py, but it'll take a skilled programmer to do it with any form of elegance.
In Orbit [WIP] | Gliese is now doing weekly erratic VN reviews! The latest: Halloween Otome!
Gliese Productions | Facebook | Twitter
Image

User avatar
PyTom
Ren'Py Creator
Posts: 15893
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: Text Parser

#9 Post by PyTom » Sun Apr 21, 2013 12:16 pm

Ren'Py isn't really meant for traditional text IF games. While you might be able to get it to work with a lot of effort, there isn't a text parser ready for you, and you'll be spending a lot of time fighting Ren'Py, rather than letting it help you. There are systems that are meant for traditional text IF - I know of TADS, INFORM, and ADRIFT, but my knowledge might be a few years out of date.

Ren'Py tries to occupy a fairly specific niche - VNs, and VN-like sim games. (People also seem to use it for VN-like RPGs.) Once you leave that niche, you begin to fight against it.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
TrickWithAKnife
Eileen-Class Veteran
Posts: 1261
Joined: Fri Mar 16, 2012 11:38 am
Projects: Rika
Organization: Solo (for now)
IRC Nick: Trick
Location: Tokyo, Japan
Contact:

Re: Text Parser

#10 Post by TrickWithAKnife » Sun Apr 21, 2013 3:08 pm

I was working on something a few weeks ago that processes user text input in 2 different ways.

They're really basic and incomplete, but perhaps it could be useful as a starting point. If you send me a PM, tomorrow night I'll upload some .rpy files or copy some code to pastebin or something. A little late for me to do it tonight as I'm about to head to bed.

The coding side of it isn't actually that tough.
If you include a few examples of what you might like the user to be able to input and the responses, I can tweak it a bit.
"We must teach them through the tools with which they are comfortable."
The #renpy IRC channel is a great place to chat with other devs. Due to the nature of IRC and timezone differences, people probably won't reply right away.

If you'd like to view or use any code from my VN PM me. All code is freely available without restriction, but also without warranty or (much) support.

User avatar
SusanTheCat
Miko-Class Veteran
Posts: 952
Joined: Mon Dec 13, 2010 9:30 am
Location: New Brunswick, Canada
Contact:

Re: Text Parser

#11 Post by SusanTheCat » Sun Apr 21, 2013 5:19 pm

Thera'py (http://lemmasoft.renai.us/forums/viewto ... 11&t=19128) uses a basic parser that is written in Python. The code should be included in the game. If it isn't, PM me.

I think a Ren'py / IF cross breed would be cool. Ren'py does visuals and dialogue really well and IF does more open ended
puzzles well.

Susan
" It's not at all important to get it right the first time. It's vitally important to get it right the last time. "
— Andrew Hunt and David Thomas

FromMomsBasement
Newbie
Posts: 6
Joined: Fri Apr 19, 2013 10:15 pm
Contact:

Re: Text Parser

#12 Post by FromMomsBasement » Mon Apr 22, 2013 6:40 pm

Thank you all for all the help and suggestions.
I'm also planning to make plenty of visual novels to get use to ren'py. I have two in mind already.

Post Reply

Who is online

Users browsing this forum: No registered users