Live data from Hacker News

How to program a text adventure in C

helderman.github.io

1–10 of 56 posts

Re: How to program a text adventure in C

#2
I was wondering: does anybody know if there are any good resources for writing a good text adventure? Any nice tips and tricks? Mainly related to the content. I guess it overlaps with "writing a good novel", but I bet there're some specific advices that can be applied to the text adventure.

I wanted to write my text adventure, but I'd offer reader to have multiple options, especially for those who are not really practical with english (includes myself ^-^).

Re: How to program a text adventure in C

#4
post #2

I was wondering: does anybody know if there are any good resources for writing a good text adventure? Any nice tips and tricks? Mainly related to the content. I guess it overlaps with "writing a good novel", but I bet there're some specific advices that can be applied to the text adventure. I wanted to write my text adventure, but I'd offer reader to have multiple options, especially for those who are not really prac…

For the technical side of things, use ink script. There's an editor, plugins and it's a mature project.

For the creative side I would recommend trying out all kinds of things. Should your player be able to get stuck/into a dead end? Will players play once or many times. Can you "win" your game or is it more of a narrative? How do you want the player to feel!

For some more specific ideas, think about how your game branches. Branching and decisions in games are far trickier than they might appear. Too subtle and the player misses the choice entirely. Too in your face and they become boring ("kill the baby" vs "save the baby", gee I wonder which one takes me down the evil path)

Also, merely asking a question or giving a choice can influence the player. If you ask "who is the killer?" and give a list of suspects, one of them must have done it, even if the player never considered it. The question also assumes the player knows there was a murder and gives that away if they hadn't worked it out yet.

Re: How to program a text adventure in C

#5
post #2

I was wondering: does anybody know if there are any good resources for writing a good text adventure? Any nice tips and tricks? Mainly related to the content. I guess it overlaps with "writing a good novel", but I bet there're some specific advices that can be applied to the text adventure. I wanted to write my text adventure, but I'd offer reader to have multiple options, especially for those who are not really prac…

Some good places to start:

- https://planet-if.com/

- https://intfiction.org/

- https://grumpygamer.com/why_adventure_games_suck/

- https://grumpygamer.com/puzzle_dependency_charts/

- https://ifarchive.org/

Re: How to program a text adventure in C

#6
post #2

I was wondering: does anybody know if there are any good resources for writing a good text adventure? Any nice tips and tricks? Mainly related to the content. I guess it overlaps with "writing a good novel", but I bet there're some specific advices that can be applied to the text adventure. I wanted to write my text adventure, but I'd offer reader to have multiple options, especially for those who are not really prac…

[deleted]

Re: How to program a text adventure in C

#7
post #2

I was wondering: does anybody know if there are any good resources for writing a good text adventure? Any nice tips and tricks? Mainly related to the content. I guess it overlaps with "writing a good novel", but I bet there're some specific advices that can be applied to the text adventure. I wanted to write my text adventure, but I'd offer reader to have multiple options, especially for those who are not really prac…

The Inform Designer's Manual is mostly about Inform 6 programming, but has a lot of material on game design.

https://www.inform-fiction.org/manual/DM4.pdf

Crimes Against Mimesis was a famous tract in its day. I don't know how things have moved on since then.

https://www.rickandviv.net/index.php/2004/08/18/crimes-again...

Re: How to program a text adventure in C

#8
post #2

I was wondering: does anybody know if there are any good resources for writing a good text adventure? Any nice tips and tricks? Mainly related to the content. I guess it overlaps with "writing a good novel", but I bet there're some specific advices that can be applied to the text adventure. I wanted to write my text adventure, but I'd offer reader to have multiple options, especially for those who are not really prac…

As some of the other comments allude to, the term of art for text adventure is "interactive fiction".

The Interactive Fiction Wiki is a nice place to start:

https://www.ifwiki.org/Main_Page

And if you search for something like "interactive fiction tips" you'll find tons of resources.

Re: How to program a text adventure in C

#9
post #2

I was wondering: does anybody know if there are any good resources for writing a good text adventure? Any nice tips and tricks? Mainly related to the content. I guess it overlaps with "writing a good novel", but I bet there're some specific advices that can be applied to the text adventure. I wanted to write my text adventure, but I'd offer reader to have multiple options, especially for those who are not really prac…

You can find many books on text adventures from the 1980s in the Internet Archive. The Inform manual has also quite a few tips and tricks.

Re: How to program a text adventure in C

#10
I honestly think that writing an adventure can be best done by first creating an adventure-writing DSL (in C, if you like).

A few observations on the C code (I didn't read all of it):

- please, no strtok

- a little more concentration on the UI, for example not using strcmp to test inputs

- make all preprocessor definitions be uppercase

- those conditional operators confused the hell out of me - just use if/else

Post reply on HN