Playing around

2 views
Skip to first unread message

DanMonroe

unread,
Oct 2, 2009, 2:34:00 PM10/2/09
to Parchment
Hey Danni,

Check out http://geocache-if.appspot.com/test/integration.html

I've been playing around with some presentation options. In a couple
days, I've been able to inject some interesting effects. This is just
a work in progress, but thought I'd share my sandbox for you to take a
look.

So far, I've got:

- Separate command window
- Support for selectable themes.
- Separate status bar window
- Separate tab for inventory
- Support for custom prompts
- Support for custom Room titles (i.e., the Office)
- Support for inline images defined from objects in the game. Examine
the Mona Lisa and Dan Monroe in the gallery room.

Some things yet to do:
- Work on the status bar. I haven't done much except for moving it to
the bottom.
- We can do a lot more with CSS that can be controlled from within the
game. I can set properties on objects in the game to dynamically
change the CSS.
- We can do the same injection with javascript, so we can bind tasks
to different UI. For example, I've done this with the inventory. I
put the display in a separate tab as you can see.
- Add in the save and restore user interface.

What do you think so far?

Dan

Dannii

unread,
Oct 3, 2009, 9:27:31 AM10/3/09
to Parchment
On Oct 3, 4:34 am, DanMonroe <danmonroe....@gmail.com> wrote:
> Hey Danni,
>
> Check outhttp://geocache-if.appspot.com/test/integration.html
>
> I've been playing around with some presentation options. In a couple
> days, I've been able to inject some interesting effects. This is just
> a work in progress, but thought I'd share my sandbox for you to take a
> look.

Oh WOW!!! I'm very impressed! I love it! I want to make changes like
this, but before doing so I'm working on changing the underlying
structure of the code. Now let me comment on your individual items:

> So far, I've got:
>
> - Separate command window

Cool... though it's probably a matter of taste as to what people will
prefer (I'm not sure myself yet.) This is something we could make a
poll for the community to answer to help us decide. Or we could even
have both, the separate and single window modes, with a setting people
can change.

> - Support for selectable themes.

Yeah this is a pretty easy change. Maybe blorbs could even have
multiple themes in them.

> - Separate status bar window

It currently is a separate window... just at the top. It's not all
fitting on my screen at the moment, so I think I prefer it this way!

> - Separate tab for inventory

How do you do that? Perhaps a sidebar would be more useful?

> - Support for custom prompts

Got examples?

> - Support for custom Room titles (i.e., the Office)
> - Support for inline images defined from objects in the game. Examine
> the Mona Lisa and Dan Monroe in the gallery room.

Is that you? :P

> Some things yet to do:
> - Work on the status bar. I haven't done much except for moving it to
> the bottom.
> - We can do a lot more with CSS that can be controlled from within the
> game. I can set properties on objects in the game to dynamically
> change the CSS.

Yes definitely, something I'd like to see is a game which slowly
changes the styles as the game progresses. You wouldn't notice it each
turn, but it would gradually get more sinister or whatever.

> - We can do the same injection with javascript, so we can bind tasks
> to different UI. For example, I've done this with the inventory. I
> put the display in a separate tab as you can see.

This would be great too, but we have to think how to keep it secure.
Atul should be able to help with this, he'd have more experience with
user contributer JS.

> - Add in the save and restore user interface.
>
> What do you think so far?
>
> Dan

What do I think? It's very exciting! This is definitely the way I want
Parchment to proceed in the future. I have even been planning to use
JQuery UI with it!

But:
1. I want the main parchment window to remain simple and plain like it
is now (though perhaps with better typography, and I think I'll change
the status bar too.) Although extra interfaces are good, I don't want
clutter. I imagine having a sidebar with "Parchment" at the top and a
little blurb about it, a link to the library (which would be a lot
more like what you have now, with tabs etc) and a list of saved games.
I actually started something like that a while ago:

http://composure-if.googlecode.com/svn/branches/parchment/parchment.html

2. I don't want to add any extra features to the Z-Machine. Let's
extend Glulx instead.

3. I would want to be able to compile games to play with our new UI as
well as with Glk. We'll need to release an extension like they have
for FyreVM.

4. Correspondingly, lets try to make our additions in a way that Glk
can be used with them. There has been a lot of success with porting
the Z-Machine to Glk. What I imagine is something like this:

We have something like our current Z-Machine UI system.
We have a JS Glk implementation.
We make a new Glulx IO system which the Glk system can be put on top
of, but is more friendly. The Z-Machine UI will either go on top of
Glk, or directly on top of ours.

If we used xml (which I probably wouldn't want to) it might be like
this:

<output>
<room-title>The jungle</room-title>
<p>We've arrived at the Jungle!</p>
<p>What out, there's a giant tiger!</p>
<p><image src="resource:1">Fallback content</image></p>
</output>

We could set the meaning of everything we output (which can then be
styled with css! yay!) as well as having fallback content, which will
make blind users etc happy. But how exactly we do this, I have no real
idea. Glk is nice, but really unsuited for the web. I would want to be
able to send data to anywhere on the page... a game would specify an
initial structure:

<game>
<status><room/><points/></status>
<content/>
<input/>
</game>

But other structures could be made too, you may want a sidebar with an
interactive compass or something. We would then stream data to one of
these elements (or replace all the content). Glk has some good things,
like streams, but it's far too restrictive of what you can stream too.
We should be able to stream <div id="new"> to something and then
stream to that new div! Also our should be UTF-8 by default.

Maybe I should go through Glk some day and list everything I think is
problematic.

Anyways, keep up with your crazy experimentations!

DanMonroe

unread,
Oct 5, 2009, 4:42:11 PM10/5/09
to Parchment


> > - Separate tab for inventory
>
> How do you do that? Perhaps a sidebar would be more useful?

In the IF game, I have:
[Inventory]
Updating Inventory Box is an action out of world.

Understand "jqInventory" as Updating Inventory Box;

Report Updating Inventory Box:
say "JQ:INV:";
if the number of things enclosed by the player is 0:
say "You are carrying nothing.";
otherwise:
say "You are carrying: [line break]";
list the contents of the player, with newlines, indented;
Instead of taking inventory (this is the new inventory listing rule):
if the number of things enclosed by the player is 0:
say "You are carrying nothing.";
otherwise:
say "You are carrying: [line break]";
list the contents of the player, with newlines, indented;

All my injected javascript, I prefix the output in the game by using
JQ: followed by a command key. In this case, INV:

Then in web-zui.js, in the onPrint function, I detect if the output
starts with JQ: If so, I grab the command key and do whatever needs
to be done.

For inventory, instead of appending the output to the #content div, I
append it to the #inventory div in one of the tabs. Or, like you
mentioned, it can be put into whatever div is appropriate like a
sidebar. I put it in a large tab because I was thinking about adding
a feature where you would click an item in the inventory to examine
it. Then the description would appear in a div adjacent to the
inventory item.

To kick off the inventory command, I bind the tab click to a new
handler:

// Dan Added
_initPlugins: function() {
$("a.doInventory").bind('click', self._inventoryHandler);
},

_inventoryHandler: function(event) {
var callback = self._currentCallback;
self._currentCallback = null;
callback("jqinventory");
return false;
},

Here is where I have a question for you. When I was adding the
_inventoryHandler, I was trying to figure out how to send a command to
the game for parsing. Is callback("whatever command"); the best way
to do this?


>
> > - Support for custom prompts
>
> Got examples?
>

If you had gone south from the Office, it should have taken you to the
Custom Prompt room where the prompt was changed to the time of day.
Did it work for you?

in web-zui.js

if (output.substring(0,7) == "PROMPT:" ) {
var newPrompt = output.substring(7);
$("#command-prompt").replaceWith( '<span id="command-prompt">' +
newPrompt + '</span>' );
this.last_prompt = newPrompt;
}

in game:

After going to the Custom Prompt:
change the command prompt to "JQ:PROMPT:Time: [time of day] >";
continue the action;

After going from the Custom Prompt:
change the command prompt to "JQ:PROMPT:>";
continue the action;


> > - Support for inline images defined from objects in the game.  Examine
> > the Mona Lisa and Dan Monroe in the gallery room.
>
> Is that you? :P
>

Yeah, that's me... and $180,000 of my friends (chips).

> Anyways, keep up with your crazy experimentations!

Yeah, that's pretty much what they are now, just experiments. That
is, until I can come up with another puzzle for Geocaching. :)

Thanks,
Dan

weevil

unread,
Oct 9, 2009, 4:58:27 PM10/9/09
to Parchment
This is so awesome, and it's exactly why I've been excited about
parchment from when I first heard about it. Incorporating some jquery
tools stuff would be really slick, and you could even do things like
have a seperate div that shows illustrations persistently while your
text interactions happen below.

Please keep us posted on your work with this!
Reply all
Reply to author
Forward
0 new messages