Quixe development questions

Howdy,

I’ve been eyeballing the Quixe code a bit and would like to take a stab at working on adding graphics, sound and perhaps, style hints. I have a couple of questions:

Are these items currently being worked on? I’d hate to duplicate an effort already in progress.

Are there any particular “show stoppers” for adding these missing capabilities? I’ve been a coder for some time in traditional languages, C/C++, etc. but I’m still learning JavaScript. My ability to identify “brick wall” problems in Javascript isn’t well developed so if there are significant “gotchas” it would be helpful to know.

Any information, or cautions or “Are you really that crazy?” comments would be appreciated.

Cheers.

I’ll continue my diatribe on SoC, also known as separation of concerns.

Game logic and game output should be distinctly different things. If course IF is all about the text, so you do need to be able to emphasize text, have line and paragraph breaks where desired, but outside of that, the layout, sound, style…these should all be separate concerns from the game itself.

I’m in the process of having FyreVM sort-of ported to JavaScript. The nuts and bolts are Quixe without Glkote and instead Channel IO. I don’t have a timetable, but hoping this fall.

So then that leaves all the layout stuff to the browser, to standards like HTML5, CSS3, SASS or LESS, JQuery or AngularJS, maybe Ionic for mobile templates, Bootstrap or Foundation for a layout framework, and then figuring out sound and graphics.

So for my money, I’d like to see someone building viable web templates for IF given the one requirement that the data being displayed will come in a JSON package from you don’t care where.

David C.
www.textfyre.com

Looks like there’s a sound library to be used:

ionden.com/a/plugins/ion.sound/en.html

Hello David,

I appreciate your insights and I think we’re of similar minds on this. Given the huge number of Internet capable devices and the browsers that run on them, it makes sense to leave the layout, sound and graphics to the browser. I guess what I need to do now is spend some time and investigate how this might be done. I’m sure it won’t be trivial, it never is. I’ll take a look at JSON and the sound lib you posted too. Can never have enough ideas. :slight_smile:

I’m a little confused about exactly what it is to leave the sound to the browser, though. Suppose I want my game to play certain sounds at certain times – how would this work? Would it be that my story file would send a sound call out and then the browser or interpreter would play the sounds? Because that sounds fine–all I’d want as an author is that I can tell the story to play a sound and somehow, no matter what system is running it, it gets played (as long as the system supports sound).

There’s a pull request floating at github.com/erkyrath/quixe/pull/3 . I haven’t had a chance to take a look at it. Been busy this month, you understand.

That’s what GlkOte is. A web framework for IF which accepts data updates as JSON from the Quixe engine.

I guess I should qualify and say the data should be semantically oriented…output from Shadow (Win8 version) game is shown below. Outside of line breaks, bold, italics, and noun/verb tagging (used for touch usage, but could be linked), there’s no layout information here.

You create the widgets in HTML or some templated system like Angular and bind your data to that template.

<div id="myTemplate">
    <div class="title">{{viewModel.title}}</div>
    <div class="chapter">{{viewModel.chapter}}</div>
    <div class="main">{{viewModel.main}}>/div>
</div>

Then as the view model is updated from the game engine, the template is automatically updated. This is not a complete example, but it shows the gist of my efforts.

–dc

{
  "channels": [
    {
      "MAIN": "\n\n\n\n\n\nIf I thought Abbots lived in luxury, then I was dead wrong. Even my attic's cozier than this. The <noun>Abbot<\/noun>'s got no furniture at all, except a <noun>desk<\/noun> and a <noun>cot<\/noun>, and no decoration except for a <noun>bust of St. Newton<\/noun>. None of the axle-mounted, bevelled mobiles I was expecting. There's barely even any sunlight: one thin <noun>window<\/noun> to catch the sunrise, opposite the <noun>door<\/noun> to the hallway back west.\n\n<noun>St. Newton<\/noun> is staring at the <noun>Abbot<\/noun>'s unpolished <noun>Grandfather clock<\/noun> with a severe frown.\n\n"
    },
    {
      "HINT": "{ \"hints\": \"\" }"
    },
    {
      "CHAP": "Between a Rack and a Gear-Trace"
    },
    {
      "PLOG": "When the monks took me, aged six months, into their care, they named me Wren. Maybe because I was small, insignificant, and happy to eat any crumbs they threw my way. But these days I'm Wren, 2nd Assistant Clock Polisher... and that's a role that's about as important in the workings of the Cathedral of Time as the large deaf man who re-stretches the worn-out springs.\n\n\"<Italic>HEY WREN!<\/Italic>\"\n\nUh-oh.\n\n\"We've got a job for you!\"\n\n\"Yeah, a promotion!\"\n\nThis, coming from <noun>Drake and Calvin<\/noun>, means something horrible is about to happen.\n\n\"You've got your <noun>rag<\/noun>, don't you?\"\n\n\"And your <noun>polish<\/noun>?\"\n\n\"Yes,\" I bleat, holding up the <noun>glass tumbler<\/noun> they've given me.\n\n\"Course you do. Well, we've got something for you to do.\"\n\n\"Yeah,\" chimes <noun>Calvin<\/noun>.\n\nOne on each arm, they march me down the hall, towards the <noun>Abbot<\/noun>'s <noun>door<\/noun>. Am I in trouble? Going to be thrown out of the <noun>Cathedral<\/noun>?\n\n\"On three!\" shouts <noun>Drake<\/noun>.\n\n\"Tick!\" <noun>Calvin<\/noun> counts. \"Tick! <Italic>Tock!<\/Italic>\"\n\nThey shove me through the <noun>door<\/noun>. I fall into the <noun>Abbot<\/noun>'s personal chamber. I might not know much about the Abbey but I do know that I <Italic>really<\/Italic> shouldn't be in here.\n\n"
    },
    {
      "TITL": "<Bold>The Shadow In The Cathedral<\/Bold>\n"
    },
    {
      "CRED": "The Shadow In The Cathedral by Textfyre Inc\nVersion 2.0 (Windows 8 Store)\nCopyright 2013 by Textfyre, Inc.\nDesigned by Ian Finley and Jon Ingold\nWritten by Jon Ingold\nGame Engine (FyreVM) by Jesse McGrew\nInform 7 Story Programming by Jon Ingold and Brady Garvin\nCustom Library Messages extension by David Fisher\nTesting by Jon Ingold, Ian Finley, Paul O'Brian, Eric Eve, and Peter Berman\nSpecial thanks to Graham Nelson and Emily Short for all of their hard work on Inform 7.\nAll rights reserved\n"
    },
    {
      "LOCN": "<noun>Abbot's Quarters<\/noun>"
    },
    {
      "TUTR": "Some of the things you can do here include: \"EXAMINE COT\", \"EXAMINE DESK\", \"LOOK UNDER COT\", and \"LOOK AT CLOCK\". You could also try to \"POLISH THE CLOCK\" in case Drake or Calvin check on your work. But they won't, don't worry.\n"
    },
    {
      "WRDS": "<suggestions><verb>wait<\/verb><verb>go<\/verb><verb>enter<\/verb><verb>look<\/verb><verb>inventory<\/verb><verb>examine<\/verb><verb>search<\/verb><verb>take<\/verb><verb>drop<\/verb><verb>put<\/verb><verb>throw<\/verb><verb>open<\/verb><verb>close<\/verb><verb>push<\/verb><verb>pull<\/verb><verb>say<\/verb><verb>talk<\/verb><verb>hit<\/verb><verb>polish<\/verb><substantive>me<\/substantive><substantive>abbey<\/substantive><substantive>Calvin and Drake<\/substantive><substantive>door<\/substantive><substantive>clock<\/substantive><substantive>cot<\/substantive><substantive>desk<\/substantive><substantive>Newton<\/substantive><substantive>window<\/substantive><substantive>lucky key<\/substantive><substantive>rag<\/substantive><substantive>tumbler<\/substantive><substantive>polish<\/substantive><compass point>inside<\/compass point><compass point>west<\/compass point><article>a<\/article><article>an<\/article><article>the<\/article><preposition>at<\/preposition><preposition>in<\/preposition><preposition>on<\/preposition><preposition>under<\/preposition><preposition>with<\/preposition><\/suggestions>"
    },
    {
      "PRPT": ">"
    },
    {
      "SCOR": "0"
    },
    {
      "TIME": "900"
    },
    {
      "TURN": "1"
    }
  ]
}

I would implement this with some basic JSON sent from the game…

To play the bird song:
    select the sound channel;
    say "{ \"sound\": \"birdsong.ogg\", \"duration\": 5000, \"repeat\": 0 }";
    select the main channel.

…and then in the web template, we’d look at the sound channel everytime the data changed and run the according local JS function to handle it…

–dc

Note that the JSON call can be hidden with I7 code…

So we could change it to:

To play the bird song:
    play "birdsong.ogg" for 5 seconds without repeating.

…which would get turned into the previous example. (I7 syntax not tested, but the idea is workable)

–dc

Quite understandable. I’m updating my clone of the repository automatically so I’ll get it when you have time to verify and commit.