Quixe status line

Hello again all!

I’m still piecing together my custom Quixe interface and it’s time to get the status line working. I remember reading documentation on Quixe when I first started learning about it but now I can’t find the docs. I’ve looked all over @zarf’s site with no success.

I’ve compared my own results to that of an unblemished version of Quixe and I think I see the problem but don’t understand its cause.

When Quixe runs my game, it gets two important pieces of info in the update function:

windows: [
  {
    "id": 707,
    "rock": 202,
    "type": "grid",
    "gridwidth": 100,
    "gridheight": 1,
    "left": 4,
    "top": 4,
    "width": 821,
    "height": 28
  },
  {
    "id": 705,
    "rock": 201,
    "type": "buffer",
    "left": 4,
    "top": 36,
    "width": 821,
    "height": 862
  }
]

AND

Content [
  {
    "id": 707,
    "lines": [
      {
        "line": 0,
        "content": [
          "normal",
          " Communication's Station                                                 Score: 0     Moves: 0      "
        ]
      }
    ]
  },
  {
    "id": 705,
    "text": [
      {
        "content": [
          "normal",
          "You materialize in the centre of a room filled with flashing lights and beeping consoles. Now you just have to figure out how they work..."
        ]
      },

When I run my game in my own implementation, I get a similar “windows” value (with both the grid and buffer windows) but I don’t get the “lines” entry with the beautiful status line info, just the “text” entry with the main console information.

So I have two questions:

  1. Does anyone have the link to the Quixe documentation I read? The one that describes the metrics, updates, windows, etc.
  2. Can anyone let me know what I’ve done (or not done) that my implementation doesn’t get the “lines” entry in its update?

Thank you!

The documentation is here:

https://eblong.com/zarf/glk/glkote/docs.html

…or in the glkote github repo. It’s written from the opposite point of view – it’s addressed to someone who has GlkOte and is replacing Quixe – but it gives the protocol both ways.

Missing the “grid” window’s “content” – that I’m not sure about. It sounds like the game has successfully opened the status window, but doesn’t realize it, so it never prints any text there.

That’s the one!

That would make sense. Is there some kind of “window acknowledgement” that needs to be sent that my replacement GlkOte isn’t doing? Quixe’s GlkOte is quite complicated but I don’t see anything, so far, that suggests a special response…

It appears to have had something to do with the values I was passing in as the metrics. This seems to be working so far as I’m getting the “lines” now:

game.accept({
    type: 'init',
    gen: 0,
    support: ['external', 'timer', 'graphics', 'hyperlinks'],
    metrics: {
      left: 100, top: 100, width: 100, height: 100,

      gridcharheight: 25, gridcharwidth: 100,
      gridmarginx: 0, gridmarginy: 0,
                 
      buffercharheight: 75, buffercharwidth: 25,
      buffermarginx: 0, buffermarginy: 0,
                 
      graphicsmarginx: 0, graphicsmarginy: 0,
   }
});

I’m not using GlkOte to create my interface windows, so the values I’m passing in don’t matter at the moment but those seem to make Glk happy :slight_smile:

Nope, @zarf, I’m wrong. I am getting the “line” entries now but the text properties are strange…

When in the room “Communication’s Station”, I get:

 Apex.js:306:25
	Content: [
  {
    "id": 855,
    "lines": [
      {
        "line": 0,
        "content": [
          "normal",
          " Com0/0ica"
        ]

and for the room “The Oubliette”, I get:

Content: [
  {
    "id": 501,
    "lines": [
      {
        "line": 0,
        "content": [
          "normal",
          " The0/0bli"
        ]
      }
    ]

Does Glk take pains to “resize” the text to fit the metrics?

Yes.

More precisely, Glk computes the status window size (in characters) based on the metrics. It provides this information to the game, and then the game code places the score/moves info (“0/0”) based on that size.

Glk also limits the total line length based on that computed size.

The important bit (which you might be missing) is that gridcharwidth/gridcharheight are supposed to be the size of a single character in screen units. (The same units as width/height.)

For what you’re doing, you might as well set gridcharwidth and gridcharheight equal to 1 (screen units are character cells) and then give width/height in characters (80 by 50 is traditional). This is what GlkTerm does.

And, just like magic, everything is fixed :stuck_out_tongue: