Command line gamebook player script

Command line gamebook player script

Postby Sauer2 » 12 Jan 2013, 02:17

Happy new year everyone!

Gamebooks, nowadays rather known in form of visual novels are books where you can decide and jump to a refering page.
Attached is a Perl script which can parse and play command line gamebooks in form of JSON files, which I made for practising Perl.
You can run the example with:
{l Code}: {l Select All Code}
perl gamebook.pl demobook.json

It's really small, because writing JSON is a PITA, but it demonstrates the possibilities.
Maybe I will create an editor for the books if someone is interested.
EDIT: Made an update, so that you don't need to choose if there is only one link to another scene.
Attachments
gamebook.zip
(3.56 KiB) Downloaded 359 times
Last edited by Sauer2 on 13 Jan 2013, 00:54, edited 1 time in total.
User avatar
Sauer2
 
Posts: 430
Joined: 19 Jan 2010, 14:02

Re: Command line gamebook player script

Postby Evropi » 12 Jan 2013, 03:22

It... it... already exists!

https://groups.google.com/forum/#!topic/tweecode/

There's even been a FreeGamer article on Twine!

It hasn't been updated in a while until a certain 'Philip Sutton' made a new version of Twine for Windows (the 'twee' command-line compiler is much more advanced) that *gasp* actually works with Unicode. You could take up the project if you're really into gamebooks. A potential problem could be that TiddlyWiki is being phased out by a complete rewrite of TiddlyWiki, called TiddlyWiki5.

Anyway, the point is, great artists need a graphical tool - a JSON parser is just not enough. And you can't expect normal people to manipulate JSON. YAML is much more user-friendly I find, and I can imagine there will be fringe cases that your planned UI editor will be less-than-perfect. YAML parses somewhat slowly indeed, but it is also very powerful and comprehensive... I dig it! I can imagine people sharing YAML source code on forums already... ah, the dreams...


Sorry for the lukewark reception :(
Can you make one for Ruby too? I adore Ruby. :D
I think this will be work when hooked up to a static site generator like Nanoc or Jekyll. There are probably ones for Perl too, but Nanoc and Jekyll are huge in the Ruby community. The former is extremely flexible and if you aren't excited about it you should be. If you don't find it exciting, just listen to the FLOSS Weekly interview. It's a pleasure to listen to and it will certainly get you interested in using this for your personal home page or possible for a client, if you do web design.

Also, uhh... the license... seriously? Seriously? I found it really immature. You can't expect a lawyer to look at that and do anything but laugh. Some comments seem to have an erratic character too, please calm down.
You just wasted 3 seconds of your life reading this.
User avatar
Evropi
 
Posts: 385
Joined: 02 Sep 2012, 16:18

Re: Command line gamebook player script

Postby Sauer2 » 12 Jan 2013, 18:07

Evropi {l Wrote}:It... it... already exists!

https://groups.google.com/forum/#!topic/tweecode/

There's even been a FreeGamer article on Twine!

It hasn't been updated in a while until a certain 'Philip Sutton' made a new version of Twine for Windows (the 'twee' command-line compiler is much more advanced) that *gasp* actually works with Unicode. You could take up the project if you're really into gamebooks. A potential problem could be that TiddlyWiki is being phased out by a complete rewrite of TiddlyWiki, called TiddlyWiki5.

That's a good idea, but I don't feel like picking up the project for various reasons. Also, I'm not really into web design and therefore want to keep it simple and command line based. Maybe add an optional, minimal TK interface at some point.

Anyway, the point is, great artists need a graphical tool - a JSON parser is just not enough. And you can't expect normal people to manipulate JSON. YAML is much more user-friendly I find, and I can imagine there will be fringe cases that your planned UI editor will be less-than-perfect. YAML parses somewhat slowly indeed, but it is also very powerful and comprehensive... I dig it! I can imagine people sharing YAML source code on forums already... ah, the dreams...

Uh, no. A user interface is always the better option. I can assure you, even most application developers and system integrators hate editing markup files. Nobody likes to learn a syntax or encoding facts for writing interactive books.
And since the json structure follows a strict pattern, it won't be a problem to create an editor that writes correct UTF-8 files and represent the file structure properly, hiding also the gory details about IDs and stuff. I'm pretty positive about that point.

Sorry for the lukewark reception :(

That's ok, I'm not even sure if anybody plays command line games these days.

Can you make one for Ruby too? I adore Ruby. :D

I'm not sure if I rather should wait for a stable version of Ruby 2.

I think this will be work when hooked up to a static site generator like Nanoc or Jekyll. There are probably ones for Perl too, but Nanoc and Jekyll are huge in the Ruby community. The former is extremely flexible and if you aren't excited about it you should be. If you don't find it exciting, just listen to the FLOSS Weekly interview. It's a pleasure to listen to and it will certainly get you interested in using this for your personal home page or possible for a client, if you do web design.

Sorry, I can't share your euphoria about web development/design. Thanks for the link anyway, I'm always looking for interesting technical podcasts.

Also, uhh... the license... seriously? Seriously? I found it really immature. You can't expect a lawyer to look at that and do anything but laugh. Some comments seem to have an erratic character too, please calm down.

I really don't care about the license. That is the point of this kind of license. If you find the usage of the word "fuck" immature, well, too bad, i can't help you there.
The point of some of the comments is to keep other guys from trying to discuss the coding style or quirks in the source code structure with me, because it wasn't really important in this stage of prototyping.
User avatar
Sauer2
 
Posts: 430
Joined: 19 Jan 2010, 14:02

Re: Command line gamebook player script

Postby Evropi » 12 Jan 2013, 20:08

Bah! Tk. Looks horrible, even on Linux, but worse yet on Windows. I'd go with Qt instead, looks native and very comprehensive. I think Twine's UI is about as good as it gets. Only thing I don't like about it is the fact that you have to use MediaWiki markup, and I'm saying this as a near=fanatical Wikipaedian (1500+ edits). I'd much prefer a stripped-down form of Textile of Markdown (which is being standardised I hear?).

As for Ruby 2.0, the changes are not expected to be that great. BTW, since YARV became the default in Ruby 1.9.x, it became time to dispel an old myth that has been the curse of Ruby.

As for command line games, #rgrd on Quakenet is your friend. That would be, 'roguelike games, roguelike development', where I hang out a lot! Not technically played by commands though.

I can probably understand not wanting to work with the web. JavaScript is an abomination of a language ({}{}{}{}), and I hate it, as do most.

Anyway, I think you could have something potentially successful on your hands and it would be a shame to lose out because games would only be playable through a command line. Twine gives normal people the power to publish their works relatively easily. But they need a web host. If the program provides free hosting... now that's when Slashdot and Kotaku start to pick it up.
You just wasted 3 seconds of your life reading this.
User avatar
Evropi
 
Posts: 385
Joined: 02 Sep 2012, 16:18

Re: Command line gamebook player script

Postby Sauer2 » 12 Jan 2013, 21:25

Evropi {l Wrote}:Bah! Tk. Looks horrible, even on Linux, but worse yet on Windows. I'd go with Qt instead, looks native and very comprehensive. I think Twine's UI is about as good as it gets. Only thing I don't like about it is the fact that you have to use MediaWiki markup, and I'm saying this as a near=fanatical Wikipaedian (1500+ edits). I'd much prefer a stripped-down form of Textile of Markdown (which is being standardised I hear?).

The problem is, I'm stuck on a windows machine where the cpan client barely works; Qt is quite comlex to work with and the quality of the perl bindings is patchy at best.
Another potential solution might be starting a minimal http server, the default browser and create minimal HTML output.

As for Ruby 2.0, the changes are not expected to be that great. BTW, since YARV became the default in Ruby 1.9.x, it became time to dispel an old myth that has been the curse of Ruby.

Maybe, but according to the german ruby website blog post it will be released at the beginning of March and I will probably be too busy until middle of March to start looking at Ruby. Good timing, actually.

Anyway, I think you could have something potentially successful on your hands and it would be a shame to lose out because games would only be playable through a command line. Twine gives normal people the power to publish their works relatively easily. But they need a web host. If the program provides free hosting... now that's when Slashdot and Kotaku start to pick it up.

But then I need resources and time to create a hosting server, a good looking web interface, user authentification... and BAM! I'm in the the middle of a web application.

For now I think I will continue prototyping with a small script and look, what kind of possibilities could exist in gamebooks...
User avatar
Sauer2
 
Posts: 430
Joined: 19 Jan 2010, 14:02

Re: Command line gamebook player script

Postby Sauer2 » 31 Jan 2013, 22:35

Aaaaaaand another script.
This time, it creates html files.
+ The markup is less confusing this time, it's self-explanatory, no json.
+ You can insert images.
+ You can modify the template to make the output look good.
- There are no boolean states like in the command line script. It would either require some javascript/cookie/html5DB hackery or large amounts of oddly named output files.
Attachments
gbgenerator.zip
(5.8 KiB) Downloaded 333 times
User avatar
Sauer2
 
Posts: 430
Joined: 19 Jan 2010, 14:02

Who is online

Users browsing this forum: No registered users and 1 guest