Live data from Hacker News

How to program a text adventure in C

helderman.github.io

11–20 of 56 posts

Re: How to program a text adventure in C

#11
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…

Aaron Reed's 50 Years of Text Games[1][2] is a fantastic journey into the history and the possibilities of text-based games. I got the physical book and was surprised to find it as engaging as a novel. Each chapter takes one year between 1971 and 2020 and picks a game from that year to discuss in depth. While it might not help with the writing per se, you might good ideas there (several of the games discussed are in the "Adventure" lineage).

[1] https://if50.substack.com/archive?sort=new

[2] https://if50.textories.com/

Re: How to program a text adventure in C

#13
post #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 bra…

Yeah, I like things like Ink a great deal. It's really easy to overcomplicate narrative design if you're not careful, but Ink (and so forth) do a good job of keeping things simple and staying out of your way.

Re: How to program a text adventure in C

#14
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…

Ron Gilbert's 1989 "Why Adventure Games Suck And What We Can Do About It" https://grumpygamer.com/why_adventure_games_suck/

Re: How to program a text adventure in C

#15
The best way to implement a text adventure in C would be to implement a simple lisp interpreter in C and then implementing the actual game in a lisp DSL. Lisp lends itself surprisingly well to this, and defining game logic declaratively instead of imperatively is much more intuitive. Here are a few examples:

[1] http://www.ulisp.com/show?383X

[2] https://github.com/mswift42/MetalHead

[3] https://github.com/xlxs4/lisp-spels/blob/main/spel.el

Re: How to program a text adventure in C

#18
post #15

The best way to implement a text adventure in C would be to implement a simple lisp interpreter in C and then implementing the actual game in a lisp DSL. Lisp lends itself surprisingly well to this, and defining game logic declaratively instead of imperatively is much more intuitive. Here are a few examples: [1] http://www.ulisp.com/show?383X [2] https://github.com/mswift42/MetalHead [3] https://github.com/xlxs4/lisp…

[dead]

Re: How to program a text adventure in C

#19
post #15

The best way to implement a text adventure in C would be to implement a simple lisp interpreter in C and then implementing the actual game in a lisp DSL. Lisp lends itself surprisingly well to this, and defining game logic declaratively instead of imperatively is much more intuitive. Here are a few examples: [1] http://www.ulisp.com/show?383X [2] https://github.com/mswift42/MetalHead [3] https://github.com/xlxs4/lisp…

That's like saying the best way to drive to New York is to drive down the block to the train station and then take a train lol

Re: How to program a text adventure in C

#20
post #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

Just use _s for each stdlib function
Post reply on HN