Debate: Clearing the screen?

A more effective approach might be to expand the status line so that it can encompass the description of the entire room, as in Beyond Zork (if you turn the mapping off in Beyond Zork there is a mode in which it can replace the fixed nonscrolling map with a fixed nonscrolling room description – I presume this was done by hacking the status line). Apologies for not remembering the precise commands to achieve this mode change in BZ.

EDIT: Come to think of it, what if you just hacked the status line drawing routine to also clear the screen? Doesn’t it update right before the command prompt is printed? EDIT2: No sorry, this won’t work, because it would still come after the printing of the results of the player’s previous command, which you won’t want to clear. Still, if you write the room description within the status line itself, then clearing the screen may be unnecessary?

Nice hack! :slight_smile: This works, the location is updated:

When play begins: Now the left hand status line is "[the player's surroundings]: [description of the location of the player]"; Now the right hand status line is "";

However, I need some code to make the status line include multiple lines … I read somewhere that Basic Screen Effects should do the trick … aw, that’s beyond my skill level …

I don’t know if you need an extension to make a multi line status as I’ve never done it myself – sorry.

Let me add my 2৳ to this debate. I say go nuts! Things are meant to be broken. This actually relates to what I’m coding right now.

My example is what I’m doing with my game. It’s IF (kind of), but I’m breaking all kinds of paradigms to give a new narrative feel for the story. To do this I had to figure out how text in presented in different types of games and then borrow the best ones for mine.

To illustrate, here’s a snapshot of what I have (click to embiggen)

The exposition take place in a few areas, bit the “main” game takes place in the terminal box below. Dialog, however will play out on the big blue bit above, and input is managed by an on-screen keyboard along with a smattering of mouse input. The big blue part is also used for graphic exposition which is in work as well.

One can argue what I’m trying to do isn’t IF anymore. I’m taking it, dragging and screaming mind you, into the realm of visual novel. Will it work? Heck I don’t know. It may become a new species of gameplay, or flop around as a deformed hideous mutant. The point is I’m making the game I want to play, and I have been told that that tends to make other people want to play it too.

So go bananas, you will be surprised what comes out of it.

Looks very interesting, even though I have no idea what it’s about! (Nevertheless, the on-screen keyboard makes me guess that it is some kind of meta-game … but maybe I’m reading too much into it? )

BTW, What are you coding it in?

It’s written in Inform 7 with my own custom interpreter. I’m also using a somewhat modified Glulxe VM with custom glk extensions. What you see there is a bare bones terminal. It’s behaves more like a text exposition window from a final fantasy/visual novel game. It will hold room and object descriptions, but other bits of narrative will take place in other areas.

The bit I’m most proud of is a character you literally carry in your pocket. The green right box side holds a smart-phone like electronic dictionary with a broken AI that has a rotten disposition. The gold left side will hold a book that you and and another person write in. (You can’t speak each others language.) You will see the characters interact with each other visual novel style in the blue bit above.

For example. Where it says “Apartment” in my sample text, that’s going to be moved to the upper left hand corner of the screen in a little box, and the background will reflect the location. The on-screen keyboard is actually a pull-put keyboard from electronic dictionary, but it will allow me to port the game to computers that don’t have keyboards (i.e. tablets, consoles) so that they can play the game too. I’m just thinking ahead.

With Basic Screen Effects you write a table with as many rows as you want the status line to have. Each row has three columns for whatever text you want in the left hand, center, and right hand positions of the status line on each of the rows. Then the extension just reads your table and constructs a status line from it.

I can’t believe it would be beyond your level of skill.

When you say beyond your skill level, have you used extensions before? When I first heard about them they sounded daunting, but really they can make things a lot simpler for you. Most (including Basic Screen Effects) come with neat documentation that lets you quickly find the bits you need.

halkun:
Nice, I look forward to playing that! Just brainstorming, but how about a game where the player has to type, for instance, MOVE MOUSE CURSOR UP 12 PIXELS or CLICK LEFT MOUSE BUTTOM, in order to operate the cursor, with which the player can operate an on-screen keyboard with which he can type commands to the game …? Oh, and the game should be in real-time.

Felix & MU:
Yes, the Basic Screen Effect can give the status line multiple lines:

Table of Room Description
 left	central	right 
"[the player's surroundings]: [description of the location of the player]"	""	""
""	""	""
""	""	""
""	""	""
""	""	""
""	""	""
""	""	""
""	""	""
""	""	""

 Rule for constructing the status line:
	fill status bar with Table of Room Description;
	rule succeeds.

… but it requires [line break] for the text to continue at the line below … so I would need to make some code to automatically replace every 10nth empty space with “[line break]” …

I never knew you could actually outsmart the constraints on characters for the status line with a simple line break!

As for a suggestion on how to do what you want (there might no doubt be a better way), I would write a say phrase that turns the info about the location into indexed text, manipulates it and says it – and then use that custom say phrase with Basic Screen Effects.

Include Basic Screen Effects by Emily Short.

To say --/the whereabouts:
	let info be indexed text;
	let info be "[the player's surroundings]: [description of the location of the player]";
	let N be the number of unpunctuated words in info;
	let N be N / 10;
	repeat with M running from 1 to N:
		replace unpunctuated word number (10 * M) in info with "[unpunctuated word number (10 * M) in info][line break]";
	say info.

Table of Room Description
left	central	right 
"[whereabouts]"	""	""
with eight blank rows

 Rule for constructing the status line:
	fill status bar with Table of Room Description;
	rule succeeds.


Hole in the Ground is a room. "Not a nasty, dirty, wet hole, filled with the ends of worms and an oozy smell, nor yet a dry, bare, sandy hole with nothing in it to sit down on or to eat: it is a hobbit-hole, and that means comfort." 

Here’s a way to do it without a table and without deciding on a fixed number of rows for the status line (it still depends on Basic Screen Effects):

Include Basic Screen Effects by Emily Short.

Before constructing the status line:
	clear only the status line.
	
Rule for constructing the status line:
	let info be indexed text;
	let info be "[the player's surroundings]: [description of the location of the player]";
	let N be the number of unpunctuated words in info;
	let leftovers be the remainder after dividing N by 10;
	let N be N / 10;
	repeat with M running from 1 to N:
		replace unpunctuated word number (10 * M) in info with "[unpunctuated word number (10 * M) in info][line break]";
	unless leftovers is 0:
		deepen the status line to N + 1 rows;
	otherwise:
		deepen the status line to N rows;
	move the cursor to 1;
	say info.

Hole in the Ground is a room. "Not a nasty, dirty, wet hole, filled with the ends of worms and an oozy smell, nor yet a dry, bare, sandy hole with nothing in it to sit down on or to eat: it is a hobbit-hole, and that means comfort." 
Garden is west of hole. "A very nice and wellkempt garden, delightful and much befitting a respectable and comfortably well-to-do hobbit gentleman."

But that was the idea - that’s why the command is printed after the description (and its output after that again).
I thought that was what you wanted, but having read the continuation of this discussion I see that was not the case.

Impressive work, Felix! I think I prefer the first solution - I kind of like that the status line keeps a fixed height - or maybe the fixed height could be turned on/off by the player! Still a few quirks, but its much closer to actually working now!

Things I need:

  • I just noticed that [description of the location of the player] don’t mention visible objects, people, etc.
  • I need to disable the room description at start of the game.
  • Disable inverted text in web export (looks pretty in Glulx, though)
  • I think the player will still have the last command in his short-term memory, so I don’t need to to repeat “> go east” or whatever the player typed. But maybe some sort of confirmation would be required: “You walk down into the cellar.”.
  • Write an actual game, so that I can figure if it work or not.

The poll results:

So the majority politely dismisses the concept, while a somewhat smaller group might give it a try. A very small minority (me) is unsure.

I like that the clear screen is so much less cluttered: You only see your surroundings and the effects of what you just did.

I think that the basic ‘the-player-writes-something-and-the-game-replies’ is one of the major strengths of IF. So I not sure if I like that the location description has been removed from the input/output flow.

The remove of scrollback is big move, so I understand the 54%. I think every IF-player uses scrollback constantly, not just to check the last LOOK command, but to ‘connect’ to the world. Skimming the scrollback tells you that you have just entered the cabin and that you have just tried to open the box but it was locked. It gives you a feeling of being present which lacks from the description “CABIN: It is dark. There’s a door to the south. There’s a locked box.”

That was pretty fiddly.

My solution isn’t foolproof: It may behave improperly e.g. in darkness or if the player enters containers or supporters from which he shouldn’t be able to look out at the location. I also doesn’t tell if you’re in or on things. I’m sure all of this could be done with more code, though.

Ideally, I suppose, one should have captured the output from the looking action; but that totally messed up line breaks in ways I couldn’t understand at all, so I gave it up.

Here goes:

Include Basic Screen Effects by Emily Short.

Before constructing the status line:
	clear only the status line.

To say locale details: describe locale for the holder of the player.
	
Rule for constructing the status line:
	let info be indexed text;
	let info be "[locale details]";
	let K be the number of lines in info;
	repeat with L running from 1 to K:
		let passage be line number L in info;
		repeat with M running from 1 to K:
			replace unpunctuated word number (10 * M) in passage with "[unpunctuated word number (10 * M) in passage][line break]";
		replace line number L in info with passage;
	let K be the number of lines in info;
	let P be the number of paragraphs in info;
	unless K is 0, let K be K + (P - 1);
	let whereabouts be indexed text;
	let whereabouts be "[the player's surroundings]: [description of the location of the player]";
	let N be the number of unpunctuated words in whereabouts;
	let N be N / 10;
	repeat with M running from 1 to N:
		replace unpunctuated word number (10 * M) in whereabouts with "[unpunctuated word number (10 * M) in whereabouts][line break]";
	let N be the number of lines in whereabouts;
	unless K is 0:
		deepen the status line to N + 1 + K rows;
	otherwise:
		deepen the status line to N rows;
	move the cursor to 1;
	say "[whereabouts][line break][info]".


Hole in the Ground is a room. "Not a nasty, dirty, wet hole, filled with the ends of worms and an oozy smell, nor yet a dry, bare, sandy hole with nothing in it to sit down on or to eat: it is a hobbit-hole, and that means comfort." 
In the hole is a table. A smoking pipe is on the table. The table is enterable.

Garden is west of hole. "A very nice and wellkempt garden, delightful and much befitting a respectable and comfortably well-to-do bachelor gentlehobbit."
Gandalf is a man in the Garden. "An elderly man bids you good morning."
Some flowers are in the garden. For writing a paragraph about the flowers: say "Your unadventurous garden is full of lovely flowers of all the expected varities."

Test me with "enter table / get pipe / exit / west / east / drop pipe / put pipe on table"

The rule responsible for this is called “the initial room description rule”. You can’t find that out using the RULES debug command (since you can’t type that command till after that particular rule has already run), but you do find it listed in the I7-rules chart here.
So you need just unlist it:

The initial room description rule is not listed in the startup rulebook.

Wow, this is impressive - I had never figured any of this out! :slight_smile:

I have played around with the colors and made the layout bit more gritty by placing a transparent .png file on top. So the online version now looks like this:

(But I noticed a strange error where the input field ended up at the top of the status line … Is the .png to blame?)

Now, I only need to … actually create a game!

Or publish it as an extension and let others write games with it.

Spoff, I really like the web-version look (worth following the link and viewing the RAW file to see what it actually looks like). It looks like the screen readout of an organic computer from a future past, well suited for a survival-horrory and/or sci-fi thing. It’s awesome!

Debugging the above code a little:
[rant][code]
Include Basic Screen Effects by Emily Short.

Before constructing the status line:
clear only the status line.

To say locale details: describe locale for the holder of the player.

To decide what object is as far as you can see: (- (visibility_ceiling) -).

Rule for constructing the status line:
let info be indexed text;
let info be “[locale details]”;
let K be the number of lines in info;
repeat with L running from 1 to K:
let passage be line number L in info;
repeat with M running from 1 to K:
replace unpunctuated word number (10 * M) in passage with “[unpunctuated word number (10 * M) in passage][line break]”;
replace line number L in info with passage;
let K be the number of lines in info;
let P be the number of paragraphs in info;
unless K is 0, let K be K + (P - 1);
let whereabouts be indexed text;
let whereabouts be “[the player’s surroundings][if the holder of the player is not as far as you can see and not in darkness and the holder of the player is a supporter] (on [the holder of the player])[otherwise if the holder of the player is a container and the holder of the player is not as far as you can see and not in darkness] (in [the holder of the player])[end if][if the description of the holder of the player is empty or in darkness].[otherwise]: [description of the holder of the player][end if]”;
let N be the number of unpunctuated words in whereabouts;
let N be N / 10;
repeat with M running from 1 to N:
replace unpunctuated word number (10 * M) in whereabouts with “[unpunctuated word number (10 * M) in whereabouts][line break]”;
let N be the number of lines in whereabouts;
unless K is 0 or in darkness:
deepen the status line to N + 1 + K rows;
otherwise:
deepen the status line to N rows;
move the cursor to 1;
say “[whereabouts][unless in darkness][line break][info][end if]”.
[/code][/rant]

Thanks for the code update!

Here is my template for that cyberpunk-like screen, designed for Z-code version 8:

TEMPLATE-cyberpunk.zip (1 MB)