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 / Efficient coding for a text-game

Author
Message
Shadow
23
Years of Service
User Offline
Joined: 17th Oct 2002
Location: In the shadows
Posted: 16th Jun 2003 00:44
I am going to make a text-game, a kind of "interactive story". (I know, not very ambitious for DBPro, but I'm doing it anyway).

Can anyone tell me if there is a way to make a kind of text-game engine, so that I only have to include the texts, inkey$()s and ifs once, and then just type in questions and choices?
BatVink
Moderator
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 16th Jun 2003 01:16
No.

You should really build your game on a database structure. Then you create what is known as a Parser. Google for parser, you'll find stacks of info.

The parser determines what you are trying to do. Then it goes to the database to see if that's allowed from your current position in the game, and what the result of that action is.

Thanks in advance.
All the Best,
StevieVee
Dazzag
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Cyprus
Posted: 16th Jun 2003 01:40
Dunno, in DB I would say a project of "Interactive Fiction" (IF) ie. text adventures would be much more complex (to code) than, say, a simple platformer. If you look at some of the information around text adventure parsers, it can be very very complex. Not as simple as a IF COM$="look at the sword" THEN...

If I was you I would look at some of the adventure game creators out there. They are designed for text (with some handling graphics) adventures, and some are very good. Basically DB is for 3D games, and IF creators are for what you want, as the take a hell of a lot of the effort out of it (and there is a hell of a lot). Luckily most are free too.

Oh, there's also a yearly compo that looks pretty good, and some decent games can be found.

Cheers

I am 99% probably lying in bed right now... so don't blame me for crappy typing
Dazzag
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Cyprus
Posted: 16th Jun 2003 01:44
Thought I still had it...

Check out http://www.ifcomp.org/

Cheers

I am 99% probably lying in bed right now... so don't blame me for crappy typing
Shadow
23
Years of Service
User Offline
Joined: 17th Oct 2002
Location: In the shadows
Posted: 16th Jun 2003 19:13
Hmmm...I think you're over-estimating what I'm trying to do. It's only going to be a simple piece of fun, and as such I will just use the inefficient but easier to program method. Thanks for the help anyway.

I will make a 3D game once I have got to grips with Anim8or.
FurEffect
23
Years of Service
User Offline
Joined: 7th Mar 2003
Location:
Posted: 16th Jun 2003 21:27
Hey, I started a text book adventur not too long back... Here is the source code I was using... If you havnt already feel free to use this as a skeleton for your own adventure.

DaZ

"There is only two ways of this island, the first is in pieces and the seconds with me." -(ReX/DaZ)
Dazzag
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Cyprus
Posted: 17th Jun 2003 00:56
Depends what you are trying to do. If you are trying to make a text adventure about the same complexity level of a spectrum game like Gnome Ranger or Knight Orc, then I would say they would be a tough task. When it comes to the complexity of the english language, a good parser isn't simple. You only have to read articles about IF parser writing to get an idea. On the other hand if you are trying to make a simple one command text adventure that has really simple syntax with no characters etc. Then fair enough, quite straight forward. Or a text game with a "game book" type feel to choose different tasks would be far simpler.

Cheers

I am 99% probably lying in bed right now... so don't blame me for crappy typing

Login to post a reply

Server time is: 2026-07-11 14:55:32
Your offset time is: 2026-07-11 14:55:32