[DGD] Question for programmers and builders

Noah Gibbs noah_gibbs at yahoo.com
Tue Mar 22 08:28:01 CET 2005


  I'm planning to make some changes to Phantasmal's Phrase structures.  For
those of you who don't follow Phantasmal, those are structures that allow for
internationalizing, and (will soon) also allow for things like ANSI colors and
boldface to be rendered differently depending on the user's terminal type.  For
instance, if a player is using FireClient then the ANSI colors may actually be
rendered with HTML-like color codes rather than escape sequences, and on a
black-and-white terminal they won't be rendered at all.

  Currently a Phrase is a LightWeight Object and is passed around with DGD
object pointers.  I'm considering changing this to one of a couple of things. 
I'm looking for input as to which is the most friendly to builders and
programmers.  Phrases are used a *lot* in Phantasmal, and that will keep being
true.

  When a builder is writing out a phrase, it could look something like this: 
"~enUS{The goblin leaves ~green{west}.}~esES{El goblin sale ~verde{oeste}.}" 
Then it will be converted, internally, into whatever structure Phantasmal uses
internally for Phrases.  Eventually, it will be rendered appropriately to the
user's terminal, in the correct language, with the correct idea of what tags
mean "turn green" and "turn back to normal" for the user's chosen terminal
type.

  The question, then, is what the Phrase structure will look like internally. 
Currently it consists of two strings, one for the English version and one for
the Spanish version.  There are also empty strings for any other locales.  All
the strings are stored in an array in the LWO.

  Second option:  it could be stored in a string just like the above.  Anything
not surrounded by language tags would be assumed to be language-independent. 
Editing in just one language would be a little weird, but people could deal. 
That means we could pass the Phrase around as just a string, but people would
also try to append things onto it, which could break up braces and tags and
stuff, causing all kinds of problems.  Not good.

  Third option: keep it internally in an LWO Phrase structure, but keep it as
pre-parsed UNQ.  This would be a little faster, but mostly you can treat this
as being just like option one.  In fact, you should just forget I wrote this as
well :-)

  So...  Here's the question...

  Phantasmal gets a lot of flak for being gratuitously weird, by which I mean
"not like 2.4.5".  And that's true, it really isn't.  Would people have an
easier time with passing Phrases around if they looked like the markup strings
above instead of looking like opaque LWO structures that you have to call
functions on?





		
__________________________________ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/ 



More information about the DGD mailing list