Wednesday 20 February 2013

Anatomy of a Screen 1

One of the foremost features of Paradice is its component-based user interface.  Whereas most applications that run on Telnet technology are created with a line-mode spew of text from top to bottom, Paradice uses a character-mode interface with explicit control over everything the user sees.

The primary advantage of this is the use of graphics, obviously.  To re-use a screenshot from the first post:



Here, you can see that the Name field is highlighted, and data entry will take place within it.  Hitting the tab key (or clicking on it) will move you to the Password field.  Tab again and you'll be back at the Name field.  This is not possible with line-mode.

There are other possibilities as well.  I could have the leaves on my palm tree change colour, or rearrange themselves to appear to rustle in the wind, if I liked.  The same with the water, and this happens with minimal characters written to the output.

Admittedly, there are a couple of disadvantages to the approach as well.  

The primary disadvantage is that there are only a limited set of Telnet clients available for use.  The screenshot above is taken using the version of XTerm supplied with Ubuntu Linux, and my players all use PuTTY.  The only MUD client that comes anywhere near working with it is TinTin++ (hat-tip to Scandum).  Other clients, many of which come with excellent features, only support enough of the ANSI escape codes to provide colour; cursor positioning is not part of their feature set.  Additionally, some have their own data entry box -- admittedly a fine idea for line-mode applications, as it means that output from the server will not interrupt your own input, but it is incompatible with the idea of data entry fields such as those shown above.

There is a secondary disadvantage, although it has yet to play a significant role, due to the usage of the server being minimal.  That disadvantage is lag.  Because the output is rendered server-side, this may mean a delay before you see an update.  Unlike line-mode applications where the client uses local echo to immediately display what you are typing, updates in character mode require a round trip to the server and back.

This lag may have two sources: the Internet, and the server application itself.

For the Internet, there is little that can be done in general.  The difference between lag for character mode and line mode is that you will see a bunch of lag after each character for the former, and only after each line for the latter.  This will matter more for some players than others.  For example, if you are connecting from the other side of the world, then you will naturally have higher latency.  For those players, a line-mode style may give better performance.  For those people, I have written Issue 100, a second user interface backbone, to provide some kind of line-mode output.  It is currently expected as the primary feature of version 2 of Paradice.  You can see the Development Roadmap for the current development plans.

The server application itself might have lag.  Since it is currently a single-threaded application, this means that anything that keeps the server busy will have a knock-on effect for other connections.  There has been some design work and a little bit of implementation to move it towards a multi-threaded application, and this is tracked in Issue 67.  This is scheduled as the primary feature of version 1.6.

With that background out of the way, the next article will focus on deconstructing a couple of the screens within the application and showing how the component-based UI is used to create them.

No comments:

Post a Comment