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 / Making a Text Adventure game

Author
Message
Skyfox
14
Years of Service
User Offline
Joined: 19th Apr 2012
Location:
Posted: 20th Apr 2012 14:02
Hello, I really want to make a text adventure game, but I am unsure of the best way to go about this and am already having trouble with text clarity, position and colour.

The thing is I would really like to be able to download an open-source adventure game with heavy annotations and tinker with it to learn how it works, but I can't find anything like that at all!

Could someone direct me to one, or a really good tutorial that tells you everything you need to know? I've already googled this quite a bit but all I can find are ones where you just wander between three or so pre-set rooms using the 'print' command. :/
Sergey K
22
Years of Service
User Offline
Joined: 4th Jan 2004
Location:
Posted: 20th Apr 2012 14:58


run this code.
its the simplelest text game method i know.
from this point you can expand it even more by ur self.
no need a demo or opensource for that one.

more 3d models .x/.obj and more foramts here:
[href]https://www.turbosquid.com/Search/Index.cfm?keyword=gogetax1&x=0&y=0[href]
Skyfox
14
Years of Service
User Offline
Joined: 19th Apr 2012
Location:
Posted: 20th Apr 2012 16:03
That's still basically the same thing, I'm afraid, wandering around between a couple of locations with the print command. I did find this tutorial after posting, but the guy who wrote it did so in a very confusing way. He tells you to do it in this rather complicated and labyrinthine way first, then tacks on a completely different, and much better way. It's also quite hard to understand because he often tells you to add something without being very clear about where.

What I really want to do is make my adventure as easy to add to as possible. I'd like to learn the modular file-based method described in the thread (and seen in numerous games) where everything has its own file. For example: each location and monster in the game gets its own file. Instead of everything being messily hard-coded into one file you get a single master program that acts like an electronic 'Dungeon Master'.

It sounds like a much, much neater way of working that leaves the way open for more complex locations, NPCs and monsters as I get better at coding.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 20th Apr 2012 19:34
Quote: "I'm afraid, wandering around between a couple of locations with the print command"


What do you mean by a text adventure?
Ranietz
AGK Gold Backer
21
Years of Service
User Offline
Joined: 2nd Sep 2004
Location: Norway
Posted: 20th Apr 2012 19:35 Edited at: 20th Apr 2012 20:02
Take a look at this thread: http://forum.thegamecreators.com/?m=forum_view&t=187120&b=8

Edit: maybe I misunderstood what you meant by text adventure...
mr Handy
18
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 20th Apr 2012 19:36
nah it is so simple.
world (cube-type or plain-type) just array of rooms. each room has its x and y position, exits and event script. make an editor, that will handle all of your room script files. in simple way it's just minimap with room selector, then just text editor with add event wizard feauture.
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 20th Apr 2012 19:45 Edited at: 20th Apr 2012 19:47
Quote: "I did find this tutorial"


In your link you can go straight to page 3, and get the complete tutorial code. Then read the examples below the code for adding your own changes.

I think that you should spend a few days on messing around with the code on page 3. Using other people's code is a bit harder than writing things from scratch, so you need a few days to figure it all out.

Skyfox
14
Years of Service
User Offline
Joined: 19th Apr 2012
Location:
Posted: 21st Apr 2012 11:44
Ok, my text adventure idea is for a fairly simple puzzle game with strong horror elements. The user is given simple adventure-game style commands like 'look at'. Essentially, version one will be like Hugo's House of Horrors, but with no graphics whatsoever (just like Hugo's House of Horrors then! ).

Later on I intend to add monsters that hunt you down and eat you, but for the moment I'm just making the adventure bit and writing the story. I think the Zork-style code is a pretty good starting point in that respect since it lets you wander round and interact with things fairly freely.
DVader
22
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 21st Apr 2012 20:17 Edited at: 21st Apr 2012 20:18
Store your data in an array or several arrays. You can use types for inventory data if you find that easier to work with (most do).

There may be typo's as I am rusty with DB these days, but that's the sort of thing. You can then easily reference any object and check it's properties. Do another for the map, another for characters, and your good to go. Oh possibly verbs, nouns and such also, dependent on what you are doing.

The parser side is obviously more difficult, but it is only a matter of parsing the users string input letter by letter, using the mid command. Add the letters into a new string until you find a space, or the end of the file, and saving each word into a new array. You then compare those words with your games dictionary (the commands you want to be able to use) and check if they match. Save that matched list, and then check that against your available objects, characters, room etc., to see if they exist and such not.
Not sure how that method compares to the examples you are browsing, but it has worked for me in the past when playing about with this sort of thing. If you look at how GAC and the Quill worked, they can give you ideas of how to structure your code. I did start a GAC remake in DB pro, but AppGameKit pretty much killed it, as I have moved to that and have not returned since. The editor was done, but the game engine was still pretty rough and not working with the command parsing properly. I may release it for people to play with maybe, if I still have a copy. My coding can be pretty messy though.

Scene Commander
Support Manager
18
Years of Service
User Offline
Joined: 3rd May 2008
Location:
Posted: 21st Apr 2012 21:06
Hi,

I don't have a lot of free time, but I do have a commercial background in text adventures from the mid 1980's to early 1990's so I might be able to point you in the right direction if you've got any questions..
mr Handy
18
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 22nd Apr 2012 23:21
Quote: "puzzle game"

Oh, that's what do you want... then DVader's advice is good.
thecartm
14
Years of Service
User Offline
Joined: 30th Mar 2012
Location: In your closet, hiding....
Posted: 27th Apr 2012 17:39
If you click this, I had made a simpleish basse for one, nothing to exiting.

Hah, my signature is meaningless.
Physsicz
14
Years of Service
User Offline
Joined: 16th May 2012
Location:
Posted: 17th May 2012 02:01 Edited at: 21st May 2012 00:49
made this last post in error sorry I will be posting my latest code soon as my noob status is over and I dont have to wait to post code..
Physsicz
14
Years of Service
User Offline
Joined: 16th May 2012
Location:
Posted: 21st May 2012 00:42
Sorry I posted some code I did not want to post by mistake. I Just spent a few weeks making an adventure game I will post my adventure game engine soon as I tidy it up..

Login to post a reply

Server time is: 2026-07-22 00:35:42
Your offset time is: 2026-07-22 00:35:42