News for hackers. Stuff that matters.
Re:How to program a text adventure in C (2016) by franze on Sunday March 22, 2020 @06:11AM (#22653928)
Ask HN: what's a good JS (browser focused) text adventure engine? I see me making a text adventure (adding one mini chapter) each day as a good lockdown project.

Note: I might call it "Everything is better in quarantine." The goal would be to (not) go mad.

Re:How to program a text adventure in C (2016) by kd5bjo on Sunday March 22, 2020 @06:19AM (#22653958)
The classic engine is Inform, and a quick look in the manual says it can publish to a playable webpage: http://inform7.com/
Re:How to program a text adventure in C (2016) by indigochill on Sunday March 22, 2020 @06:40AM (#22654031)
Inform is definitely the leader in parser fiction and there's been some amazing games made from it (Counterfeit Monkey and Hadean Lands being two of my favorites).

I would throw Ink (from Inkle, creators of 80 Days, Steve Jackson's Sorcery!, and Heaven's Vault) in the ring for the choice-driven variant of IF. It also publishes a playable webpage. I made a sort of unconventional portfolio-like page with it here: https://maxsond.github.io/

Re:How to program a text adventure in C (2016) by pickdenis on Sunday March 22, 2020 @12:35PM (#22656214)
I'm working on a text adventure that is simply hyperlinked HTML pages with some snippets of JS for state management (just a bunch of localstorage get/put) and fancy effects. It's refreshing to go back to using the "kiddie" tools to make things.
Re:How to program a text adventure in C (2016) by acdw on Sunday March 22, 2020 @02:10PM (#22657115)
This is awesome! Do you have the code anywhere? This is the kind of text adventure I want to do but I don't know much js.
Re:How to program a text adventure in C (2016) by pickdenis on Sunday March 22, 2020 @03:23PM (#22657759)
I haven't put the code up anywhere yet but here is all of the JS (minus some trivial inline scripts):

tools.js: https://pastebin.com/p7MQE7KD

The rest of it is like:

    <p>You stand before a cave.
    <p><a href="explore.html">explore the cave</a>
Re:How to program a text adventure in C (2016) by acdw on Sunday March 22, 2020 @07:26PM (#22659781)
Thank you so much!
Re:How to program a text adventure in C (2016) by app4soft on Sunday March 22, 2020 @08:29AM (#22654476)
> Ask HN: what's a good JS (browser focused) text adventure engine?

Take a look on ISTEAD - Simple Text Adventure Interpreter.[0]

It has JS-based version[1,2] and native versions (SDL-based in pure C) for Android[3,4], Windows and Unix-like platforms (including Linux, macOS/iOS, Maemo/MeeGo, Symbian 9.x, various consoles, etc.).[5]

Text adventures for INSTEAD could include Lua-scripts (text adventure itself & modules) and various media assets (images, sounds, fonts).[6]

There is repo with free games & demos for INSTEAD, which in most cases could be installed directly from INSTEAD clients.[7]

[0] https://github.com/instead-hub

[1] https://github.com/instead-hub/instead-js

[2] http://instead.itch.io/

[3] https://github.com/instead-hub/instead-android-ng

[4] https://apt.izzysoft.de/fdroid/index/apk/org.emunix.insteadl...

[5] https://github.com/instead-hub/instead/releases

[6] https://instead-hub.github.io/en/#doc

[7] http://instead-games.ru

Re:How to program a text adventure in C (2016) by tobr on Sunday March 22, 2020 @07:03AM (#22654105)
Ink[1] is pretty great, and has a nice editor you can download to get started quickly. I found it really interesting to learn. It is unlike any other language I know, because it deals with such a specific problem.

1: https://www.inklestudios.com/ink/

Re:How to program a text adventure in C (2016) by brlewis on Sunday March 22, 2020 @09:00AM (#22654635)
Single- or multi-player? I'm thinking of figuring out why https://evolvingstory.juliablewis.com/ keeps crashing, cleaning it up and open-sourcing it. Also thinking of rewriting it using a different event system.
Re:How to program a text adventure in C (2016) by brlewis on Sunday March 22, 2020 @11:50PM (#22661105)
I fixed the logging so should be able to diagnose next time it crashes. Doesn't crash just for me.
Re:How to program a text adventure in C (2016) by BeetleB on Sunday March 22, 2020 @02:06PM (#22657072)
Inform and TADS are the two main ones out there. If you want to do the basic stuff, Inform is probably easier. I hear TADS is more powerful if you want to extend the capabilities, though.