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:
Does anyone have the link to the Quixe documentation I read? The one that describes the metrics, updates, windows, etc.
Can anyone let me know what I’ve done (or not done) that my implementation doesn’t get the “lines” entry in its update?
…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 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:
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.