Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / working on a text adventure

Author
Message
WebSlingerBoy
14
Years of Service
User Offline
Joined: 31st Jan 2012
Location: MARS
Posted: 8th Feb 2012 00:29
i have posted this several different places, and have found no step-by-step tutorials yet, so i ask this here, i am a starting indy dev trying to make one of my epic novels into a text adventure. people say you need to be a talented writer to script a TAD. no real problem, i have enough raw ideas and written books and parts of books to adapt into several TADs. i found some TADs on my ol Win98 PC under the title WINTADS, i then downloaded the entire ZORK trilogy from activision, and finished ZORK I in less than a day. i tried inform 7, but it was tedious. i am trying to find it in C++, BASIC, C#, or anything really. i tried to edit a TAD in QB64, but i could barely manage to sift through the code. i would like some tips about this. i will not use any "no coding" or "code free" or "click together" engines, i just want to make a fully immersion interactive book that i can sell however i wish, without paying anything.

"Do or do not, there is no try"
Yoda in: Star Wars Episode: V The Empire Strikes Back
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 8th Feb 2012 00:51
Well any language will be Ok, I just think that Basic is your easiest option. Here is a sort of rubbish example...

Print "You are in a room, you can go North, South"

Input a$

If a$ = "North" then Room = 100
If a$ = "South" then Room = 90

If Room = 100 then print "You went North"
If Room = 90 then print "You went South"


That example is just to give you some idea of what the code is like. It is going to be a bit more complex when you start using mid$, and Dims, but not much more complex. It is quite simple.

WebSlingerBoy
14
Years of Service
User Offline
Joined: 31st Jan 2012
Location: MARS
Posted: 8th Feb 2012 02:36
yeah, i figured that out already, but i need to parse it for normal language so people can type in wutevr they want, if "pick up watch" could be made to read even "claim chronograph" or "procure timepiece"

"Do or do not, there is no try"
Yoda in: Star Wars Episode: V The Empire Strikes Back
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 8th Feb 2012 12:17
I've actually got a basic text adventure engine, would be happy to share it.

It uses a script file to designate locations, items, and the dictionary....

To translate a word:
trans(GET;take;t;aquire;grab;collect;steal;pinch)

So GET is used in place of the ; seperated words. I just have a load of these at the start of the script, then the user input is split at each space, and the whole string is then translated.

To specify a location:
@Beach(Sandy Beach)
{
Whole location information is kept inside this, to allow free editing, no quotation marks, and to preserve sanity. Also the round brackets contain the location name, so like @ID(ID Description)
}

Then an exit after the location description:

exit(N;NorthBeach)

So when the player inputs N, it goes to the specified location 'NorthBeach'.

And an item:
item(Key;A small key)

The second parameter is what is displayed when examining the item.


It is possible to lay out a whole map with items and exits, I still have to add in some logic handling. Thing is, I don't have the skills to write a decent script, I'd be happy to plod along on the engine while you write the script. I just want to get an easy but capable text adventure engine done, not so that I can necesserily write text adventures, but more so other people can write them, and I can play them . Something that is quite organic, like I can imagine someone making a text adventure with it using just a notepad and some graph paper to lay out the map - or nothing at all!, or sitting on the train ride home. I was planning on just re-creating Colossal Cave, but that just seems tedious now that I've seen the code, I'd rather develop the engine in colaboration with someone writing the adventure.

This could work out pretty sweet for us both, all I would ask is that you write a small 10-room example adventure for the engine at some point, I'm not looking to make money from this, I just have a soft spot for text adventures.

Health, Ammo, and bacon and eggs!
zenassem
23
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 8th Feb 2012 18:08 Edited at: 8th Feb 2012 18:19
The books I have on this genre are written for antiquated 8-bit B.A.S.I.C. However, there is a lot of info, concepts, that can be learned from them. It's a daunting task to work through the short variable names, careless use of GOTO's without reservation, and the like; but it still worth reading. The key is to adapt the concepts and make use of more modern practices and code structure that a modern BASIC like DBpro offers.

Compute!'s Guide to Adventure Games
Gary McGath
©1984, COMPUTE! Publications, Inc.
ISBN 0-942386-67-1


I'll post back in a few minutes with a link to a digital scan of the text (I believe it's been archived and released to the public domain on Compute!'s electronic archive site)... I own an actual printed edition,, but it can be extremely difficult to find one in good condition, if at all.

http://www.scribd.com/doc/55339038/Compute-s-Guide-to-Adventure-Games

~ZENassem
WebSlingerBoy
14
Years of Service
User Offline
Joined: 31st Jan 2012
Location: MARS
Posted: 8th Feb 2012 18:18
ok, thanks for that! i will try these out soon!

"Do or do not, there is no try"
Yoda in: Star Wars Episode: V The Empire Strikes Back
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 10th Feb 2012 19:46 Edited at: 10th Feb 2012 19:46
Quote: "Compute!'s Guide to Adventure Games"


Wow! That brings back memories. Look what I've just found lurking in my bookcase next to my shader books:

WebSlingerBoy
14
Years of Service
User Offline
Joined: 31st Jan 2012
Location: MARS
Posted: 11th Feb 2012 18:58
cool! i read quite a bit of that book, covers the basics of a TAd, pretty neat!

"Do or do not, there is no try"
Yoda in: Star Wars Episode: V The Empire Strikes Back
zenassem
23
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 12th Feb 2012 00:38
@GG I have all three plus 'Compute!'s ATARI Collection Volume 2', and 'Compute!'s The AtariBasic Source Book'; all of which were great resources for the Atari programmer. =)

@WebSlingerBoy,, Yeah the basic foundation is there. Even a simple verb->object parser has it complexities; which I think catches many a programmer off guard. It is often more difficult to write a text input parser,, than say a menu-based system or graphical click adventure.

~ZENassem
WebSlingerBoy
14
Years of Service
User Offline
Joined: 31st Jan 2012
Location: MARS
Posted: 12th Feb 2012 03:56
i just want to make a semi simple game and apply a story i came up with to it and make an immersion novel

"Do or do not, there is no try"
Yoda in: Star Wars Episode: V The Empire Strikes Back
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 13th Feb 2012 02:21
Quote: "I have all three plus 'Compute!'s ATARI Collection Volume 2', and 'Compute!'s The AtariBasic Source Book'; all of which were great resources for the Atari programmer."


Aah! Those were the days.
WebSlingerBoy
14
Years of Service
User Offline
Joined: 31st Jan 2012
Location: MARS
Posted: 14th Feb 2012 15:55
i played ZORK from activision, and i had some older TADs on my Win98 PC.

"Do or do not, there is no try"
Yoda in: Star Wars Episode: V The Empire Strikes Back
WebSlingerBoy
14
Years of Service
User Offline
Joined: 31st Jan 2012
Location: MARS
Posted: 21st Mar 2012 21:54
not finding anything that's helpful so i return to here

"Do or do not, there is no try"
Yoda in: Star Wars Episode: V The Empire Strikes Back
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 26th Mar 2012 13:52
I'm not sure we can offer any more help than we have already, people have suggested books, offered engines, and lots of advice.

You are on a road, there is a lake to the west.
You see: a thirsty Horse.

>Lead horse to water

You lead the horse west, to the lake.

>Make horse drink

Does not compute.

Health, Ammo, and bacon and eggs!
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 26th Mar 2012 14:20 Edited at: 26th Mar 2012 14:20
You need to find the spaces, and when someone types in a sentence you chop the sentence up by finding the spaces. Mid$ is used to chop the sentences up. Then people can type in anything, and you can parse it into a vocabulary tree. But this is something that you should be able to figure out gradually. I made my own version in the 80's, and being as I hadn't been programming very long, it can't be that difficult to figure out.

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 26th Mar 2012 14:21
I played a text adventure once. I got frustrated at one of the robots (he wouldn't let me continue) so I said:

>eff you!

That is biologically impossible.



I'll look forward to playing one of your text adventures though, and I'm interested in reading one of your writings if that's at all possible.

TheComet

WebSlingerBoy
14
Years of Service
User Offline
Joined: 31st Jan 2012
Location: MARS
Posted: 26th Mar 2012 18:26
ok, i am progressing slowly but (somewhat)surely

"Do or do not, there is no try"
Yoda in: Star Wars Episode: V The Empire Strikes Back
sheffieldlad
15
Years of Service
User Offline
Joined: 28th May 2011
Location:
Posted: 17th Apr 2012 13:07 Edited at: 17th Apr 2012 13:25
I'm working (slowly) on a text parser for a text based adventure game at the moment.

One thing thats always frustrated me is the linear nature of this kind of game.
They can often descend into 'guess the verb' affairs to progress.

I'm trying to make my parser as open ended as I can to include as many possible words as I can in an effort to keep the user from getting frustrated with stock answers such as 'I don't understand'

It's early days yet but I have so far...

taken user input, seperated the strings into seperate words.
I am now working on comparing the list of words with other words to firstly dump none needed words such as if, it, and etc...

I'll then compare it to other lists to pull out actions, objects, rooms etc so that 'pickup the brown box' will translate to something i can work with like 'get box'

I can then check if the box is in the room and is takeable by the player.

Or I can respond with 'the box is too heavy to lift' or 'the box is up on a high shelf, you cannot reach it' or anything else I want to.

I am a novice coder and it's taking time.

edit: Retracted. I didn't see Van B's earlier offer of colaberating. Apologies.

Paul.

pogo: http://dl.dropbox.com/u/65597655/pongo.zip
Breakout clone: http://forum.thegamecreators.com/?m=forum_view&t=185535&b=6
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 17th Apr 2012 13:46
Quote: "They can often descend into 'guess the verb' affairs to progress."


That used to be very annoying.

I guess there's no reason why you can't provide the player with a dictionary of valid words - with perhaps new words made available as the player completes various tasks. That would remove the tedious element of trying to guess whether the program author meant you to use "leap" or "vault" rather than "jump". That would simplify your parsing task as well.
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 17th Apr 2012 14:20 Edited at: 17th Apr 2012 14:24
There were some text adventures with a hieroglyphs panel at the bottom of the screen. You would click the hieroglyphs to make a sentence. Like a picture of a hand would be take, then you would click on the object on the screen.

Here's a similar idea....



Maybe you could open up an entire bunch of words using a more advanced text tree.

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 17th Apr 2012 14:30 Edited at: 17th Apr 2012 14:30
I'm sure I've seen that plant somewhere else.

sheffieldlad
15
Years of Service
User Offline
Joined: 28th May 2011
Location:
Posted: 17th Apr 2012 16:38
@Gandalf I plan to translate jump, leap , vault back to jump.
Same with things like throw, toss, chuck etc.
I want to avoid any potential situation where a user types 'jump gap' and the program won't continue because it's looking for the word 'leap' instead.

After the parser is complete I'll put a few rooms together and a few objects just to test it.

@Pincho thats a god idea. I was playing a browser based text adventure the other day written in Java. That had a bunch of actions and a compass in the right hand side of the screen.

It worked quite well. It's something I'll look at a little later.

pogo: http://dl.dropbox.com/u/65597655/pongo.zip
Breakout clone: http://forum.thegamecreators.com/?m=forum_view&t=185535&b=6
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 17th Apr 2012 16:48
Quote: "@Gandalf I plan to translate jump, leap , vault back to jump.
Same with things like throw, toss, chuck etc.
I want to avoid any potential situation where a user types 'jump gap' and the program won't continue because it's looking for the word 'leap' instead."


I know. That's why I suggested giving the user a dictionary (i.e. a list of valid words) so if "jump" isn't on the list don't use it. No need to make things complicated for yourself. It's up to you though.
sheffieldlad
15
Years of Service
User Offline
Joined: 28th May 2011
Location:
Posted: 17th Apr 2012 17:12 Edited at: 17th Apr 2012 17:14
@Gandalf.

COmplicated isn't the issue.
I'm only really doing this to learn and improve my skills.
I'm learing tons.
I've never used an array before starting this now I'm pretty confident I can declare one dynamically depending on how many elements it will need, save data to it, empty it and reload at a later time should I need to.
I don't really expect anyone to play the game at this stage. Not unless I can come up with a good story and add something a little different to other text adventures anyway...

Hmmmm... Multiplayer text adventure anyone?



[edit]

I appreciate your advice by the way, Thank you.

[/edit]

pogo: http://dl.dropbox.com/u/65597655/pongo.zip
Breakout clone: http://forum.thegamecreators.com/?m=forum_view&t=185535&b=6
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 17th Apr 2012 17:16
Quote: "I'm only really doing this to learn and improve my skills.
I'm learing tons."


That's my main reason for doing all this too.
WebSlingerBoy
14
Years of Service
User Offline
Joined: 31st Jan 2012
Location: MARS
Posted: 17th Apr 2012 17:43
Quote: "Hmmmm... Multiplayer text adventure anyone? "



anyone heard of a MUD?

"Do or do not, there is no try"
Yoda in: Star Wars Episode: V The Empire Strikes Back
sheffieldlad
15
Years of Service
User Offline
Joined: 28th May 2011
Location:
Posted: 17th Apr 2012 18:06
I hadn't until I just looked at it on wiki.
Having a quick play on a mud server now.

pogo: http://dl.dropbox.com/u/65597655/pongo.zip
Breakout clone: http://forum.thegamecreators.com/?m=forum_view&t=185535&b=6
sheffieldlad
15
Years of Service
User Offline
Joined: 28th May 2011
Location:
Posted: 17th Apr 2012 19:43
Ok.
I just gave it a go and here are a few observsations where I would like my game engine to differ.

PvE combat is automated runs on its own until someone runs away or dies.
I would rather have turn based combat (like mud) but instead of automating it give the player choices attack, defend, run away, cast spell etc.

I don't know about PvP combat, I haven't got that far.

I got lost in a dungeon. Every room is the same.
I can't get out.
This has bored me already and I won't be playing it again which is a shame because the concept is great.
The implementation seems poor though at least on the server I played on (continents I think it was called.)

I can't 'read' anything. I have to use 'look sign' or 'look plaque'
This annoys me because It's not a logical thing to type when you want to read something.

I'm going to try to avoid this scenario.

I was joking when I said multiplayer text adventure but the possibilities are great.

It's far too advanced a project for me though, my abilaties would not allow me to code such a complex program.

pogo: http://dl.dropbox.com/u/65597655/pongo.zip
Breakout clone: http://forum.thegamecreators.com/?m=forum_view&t=185535&b=6

Login to post a reply

Server time is: 2026-07-10 11:40:26
Your offset time is: 2026-07-10 11:40:26