Loading ...
Sorry, an error occurred while loading the content.

First pass at an XML choose tag

Expand Messages
  • Jenni A. Merrifield
    After looking through Frugal s playing XML file, I gave some thought to the issue of how to do choices. The following is what I came up with as a first stab
    Message 1 of 15 , May 1, 2004
    View Source
    • 0 Attachment
      After looking through Frugal's "playing" XML file, I gave some thought to
      the issue of how to do choices. The following is what I came up with as a
      first stab at it. I expect it will needs some revision, but I figured it was
      a place to start. :-)

      <!-- non-normative examples of the choose and choice tags -->
      <choose id="SomeFeat" num="1" >
      <!-- Choice of any feat -->
      <choice kind="feat" />

      <!-- Choice of any feat of type="general" -->
      <choice kind="feat" type="general" />

      <!-- Choice of two specific feats -->
      <choice kind="feat" refid="feat.agility" />
      <choice kind="feat" refid="feat.agility" />

      <!-- Choice of any weapon.prof feat -->
      <choice kind="feat" refid="feat.weapon-prof" />

      <!-- Choice of a subset of weapon-prof feat options -->
      <choice kind="feat" refid="feat.weapon-prof">
      <!-- Need a way to indicate which weapon profs are available... -->
      <!-- I think re-using "choice" should do the trick -->

      <!-- Choice of any weapon-prof of type-"martial" -->
      <choice kind="weapon-prof" type="martial" />

      <!-- Choice from a set of specific weapon-profs -->
      <choice kind="weapon-prof" refid="weapon-prof.sword-dagger" />
      <choice kind="weapon-prof" refid="weapon-prof.sword-long" />
      </choice>
      </choose>

      <!-- Some specific examples (Normative) -->

      <!-- A basic weapon prof feat, reused by "specific" weapon prof feats -->
      <feat id="feat.weapon-prof">
      <name>{$WeaponProfChoice.type} Weapon Proficiency
      ({$WeaponProfChoice.name})</name>
      <descriptions>
      <description type="brief">A "helper" feat providing a choice of
      any one weapon proficiency, regardless of type</description>
      </description>
      <attributes>
      <attribute key="visible" value="false" />
      <attribute key="display" value="false" />
      <attribute key="allow-multiple" value="true" />
      </attributes>
      <types>
      <type>feat</type>
      <type>general</type>
      <type>fighter</type>
      </types>
      <effects>
      <choose id="WeaponProfChoice" num="1">
      <!-- Choose any weapon proficiency -->
      <choice kind="weapon-prof">
      </choose>
      <add-entity refid={$WeaponProfChoice} />
      </effects>
      </progression>

      <feat id="feat.weapon-prof.martial" source:page="Feats.rtf">
      <name>{$MartialWeaponProfChoice.Name})</name>
      <descriptions>
      <description type="brief">Brief description of Martial Weapon
      Proficiency Feat text</description>
      <description type="benefits">Description of benefits of the Martial
      Weapon Proficiency Feat</description>
      <description type="normal">Description of normal behavior without
      Martial Weapon Proficiency Feat</description>
      </description>
      <attributes>
      <attribute key="visible" value="true" />
      <attribute key="display" value="true" />
      <attribute key="allow-multiple" value="true" />
      </attributes>
      <choose id="MartialWeaponProfChoice" num="1">
      <!-- Choose any martial weapon proficiency -->
      <choice kind="feat" refid="weapon-prof">
      <choice kind="weapon-prof" type="martial">
      </choice>
      </choose>
      </progression>

      <entity id="knowledge.arcana" source:page="Skills2.rtf">
      <name>Arcana</name>
      <descriptions>
      <description type="definition">Ancient mysteries, magic traditions,
      arcane symbols, cryptic phrases, constructs, dragons, magical
      beasts</description>
      </descriptions>
      <types>
      <type>Knowledge</type>
      </types>
      </entity>

      <progression id="skill.knowledge" source:page="Skills2.rtf">
      <name>Knowledge ({$KnowledgeChoice.name})</name>
      <descriptions>
      <description type="use">Like the Craft and Profession skills,
      Knowledge actually encompasses a number of unrelated skills.
      Knowledge represents a study of some body of lore, possibly an
      academic or even scientific discipline.</description>
      <description type="check">Answering a question within your field
      of study has a DC of 10 (for really easy questions), 15 (for basic
      questions), or 20 to 30 (for really tough questions).
      <p>In many cases, you can use this skill to identify monsters and
      their special powers or vulnerabilities. In general, the DC of
      such a check equals 10 + the monster's HD. A successful check
      allows you to remember a bit of useful information about that
      monster.</p>
      <p>For every 5 points by which your check result exceeds the DC,
      you recall another piece of useful information.</p></description>
      <description type="action">Usually none. In most cases, making a
      Knowledge check doesn't take an action-you simply know the
      answer or you don't.</description>
      <description type="retry">No. The check represents what you know,
      and thinking about a topic a second time doesn't let you know
      something that you never learned in the first place.</description>
      <description type="synergy">If you have 5 or more ranks in Knowledge
      (arcana), you get a +2 bonus on Spellcraft checks.
      <p>If you have 5 or more ranks in Knowledge (architecture and
      engineering), you get a +2 bonus on Search checks made to find
      secret doors or hidden compartments.</p>
      <p>&c.</p></description>
      </descriptions>
      <attributes>
      <attribute key="use-untrained" value="false" />
      </attributes>
      <types>
      <type>skill</type>
      <type>intelligence</type>
      </types>
      <ranks>
      <rank level="none">
      <!-- effects applied regardless of the number of ranks -->
      <effects>
      <variable-bonus targetid="skill.knowledge.stat"
      value="$stat.int.mod" />
      <!-- $skill.knowledge.ranks - number of purchased ranks -->
      <!-- $skill.knowledge.ranks.bonus - number of granted ranks -->
      <!-- $skill.knowledge.stat - bonus from the skill's key stat -->
      <!-- $skill.knowledge.misc - miscellaneous bonuses -->
      <!-- $skill.knowledge.synergy - synergy from other skills -->
      <variable-bonus targetid="skill.knowledge"
      value="$skill.balance.ranks + $skill.balance.ranks.bonus +
      $skill.balance.stat + $skill.balance.misc +
      $skill.balance.synergy" />
      </effects>
      </rank>
      <rank level="all">
      <effects>
      <!-- All levels give a +1 rank -->
      <variable-bonus targetid="skill.knowledge.ranks" stacks="true"
      value="1" />
      </effects>
      </rank>
      <rank level="1">
      <effects>
      <choose id="KnowledgeChoice" num="1">
      <!-- Choose any type of knowledge -->
      <choice kind="knowledge">
      </choose>
      <add-entity refid="{$KnowledgeChoice}" />
      </effects>
      </rank>
      </ranks>
      </progression>

      --
      Jenni A. M. Merrifield
      Software User Experience Professional
      Designing to Requirements and walking on Water is EASY. . .
      . . . So long as both are Frozen.
      ----------
      E-Mail & WinIM: [strawberry @ jamm.com]
      Blog: [http://strawberryjamm.blogspot.com]
      --
    • Jenni A.M. Merrifield
      What? No responses to my attempt to invent a format for a choose tag in XML? I thought for sure me and my XML would be wrung through at least two analytic
      Message 2 of 15 , May 7, 2004
      View Source
      • 0 Attachment
        What? No responses to my attempt to invent a format for
        a "choose" tag in XML? I thought for sure me and my XML would be
        wrung through at least two analytic wringers... (That would be
        Keith's and Frugal's)

        *sigh*

        What does a girl gotta do to get noticed around here...

        ;-)

        Jenni

        PS: I noticed some errors and typos in what I sent before anyway,
        so I've uploaded a file to the group folders that is more accurate.
        The file can be accessed from this URL:

        <http://f4.grp.yahoofs.com/v1/ID-
        cQBn2LX0t5PibX8wWyvFpKm1GwVqScRr4FhXN5FEvrnh4n-fGtP944w-QWmPPRH-MO2q-
        na2PgB1ZM2QsdahtVh0sZSD5/ChooseXmlTag.txt>




        --- In pcgen-xml@yahoogroups.com, "Jenni A. Merrifield"
        <strawberry@j...> wrote:
        > After looking through Frugal's "playing" XML file, I gave some
        > thought to the issue of how we might do choices. The following is
        > what I came up with as a first stab at it. I expect it will need
        > some revision, but I figured it was a place to start. :-)
        >

        [...SNIP...]

        --
        Jenni A. M. Merrifield
        Software User Experience Professional
        Designing to Requirements and walking on Water is EASY. . .
        . . . So long as both are Frozen.
        ----------
        E-Mail & WinIM: [strawberry @ jamm.com]
        Blog: [http://strawberryjamm.blogspot.com]
        --
      • Keith Davies
        ... Post when I m not going through a hellish week at work, probably. I haven t had any spare brain cells to rub together for a while now. Keith -- Keith
        Message 3 of 15 , May 7, 2004
        View Source
        • 0 Attachment
          On Sat, May 08, 2004 at 02:51:56AM +0000, Jenni A.M. Merrifield wrote:
          > What? No responses to my attempt to invent a format for
          > a "choose" tag in XML? I thought for sure me and my XML would be
          > wrung through at least two analytic wringers... (That would be
          > Keith's and Frugal's)
          >
          > *sigh*
          >
          > What does a girl gotta do to get noticed around here...
          >
          > ;-)

          Post when I'm not going through a hellish week at work, probably. I
          haven't had any spare brain cells to rub together for a while now.


          Keith
          --
          Keith Davies I gave my 2yo daughter a strawberry
          keith.davies@... Naomi: "Strawberry!"
          me: "What do you say?"
          Naomi: "*MY* strawberry!"
        • Frugal
          This started as a coherant example by example response, then I went off on a tangent so I have changed the tag line. ...
          Message 4 of 15 , May 10, 2004
          View Source
          • 0 Attachment
            This started as a coherant example by example response, then I went off on
            a tangent so I have changed the tag line.

            <quote who="Jenni A. Merrifield">
            > After looking through Frugal's "playing" XML file, I gave some thought
            > to
            > the issue of how to do choices. The following is what I came up with as a
            > first stab at it. I expect it will needs some revision, but I figured it
            > was
            > a place to start. :-)

            Sorry that I have been so long to repond, a combination of work, baby and
            life got in the way of real coding ;O)

            > <!-- non-normative examples of the choose and choice tags -->
            > <choose id="SomeFeat" num="1" >

            So this ia a choose block with the name "SomeFeat" that is to ask the user
            for a single object from the options below.

            > <!-- Choice of any feat -->
            > <choice kind="feat" />

            Hmmm... We do not have a "feat" kind. Feats are just entities that are
            generally given ids starting "feat.".

            we could either:

            1 - Make feats a concrete entity subclass, which I personally do not like
            as it ties the concept of feats into the data rather than the application.

            2 - use <choice kind="entity" type="feat"/> to select all entities with
            the "feat" type.

            3 - use <choice type="feat" /> to select all objects in the data with the
            "feat" type.


            > <!-- Choice of any feat of type="general" -->
            > <choice kind="feat" type="general" />

            Bugger, I have just moved the "feat" from kind to type... So we are going
            to need someway to have multiple types, which we are going to need anyway
            for some complex stuff.

            I keep coming back to doing this with a query language:

            <choice select="//entity[types/type='feat' and types/type='fighter']" />

            Would it just be easier to write an XPath parser for java datatypes ;O)

            ... actually now that I stop for a moment; is that really such a daft
            idea? If we assume that this low level XML maps directly onto java classes
            then why can we not use XPath? We have the complete BNF of the XPath
            syntax available so writing a parser should not be too difficult. The only
            issue would be treating the objects as data types for the Java API and
            trees for the XPath API. i.e. "entity[types/type='feat'" needs to have
            'types' available as a child of 'entity' and 'type' available as a subnode
            of 'types' even if the internal data structure was

            class Entity {
            List types;
            };

            The more I think about this the more I feel that a query language will be
            more use than trying to cobble something together using a small series of
            tags with attributes.

            If we were to extend this idea we could also reference the character.

            <... select="/character/entities/entity[types/type='feat' and
            types/type='fighter']" />

            To select all the Fighter feats the character currently has associated
            with them.

            If we parsed the query language into an internal structure we could even
            use different external representations:

            <choice lang="xpath" select="//entity[types/type='feat' and
            types/type='fighter']" />

            <choice lang="sql" select="select * from entity where type='feat' and
            type='fighter'" />

            Somebody please tell me that Rowan's three hours of collicy screaming last
            night has fused both of my brain cells before I convince myself that this
            is a good idea...

            --
            regards,
            Frugal
            -OS Chimp
          • Frugal
            ... Having had a quick look at the XPath stuff that comes with Xerces and Xalan it would appear that it only works with DOM. Jaxen on the
            Message 5 of 15 , May 10, 2004
            View Source
            • 0 Attachment
              <quote who="Frugal">

              > The only
              > issue would be treating the objects as data types for the Java API and
              > trees for the XPath API. i.e. "entity[types/type='feat'" needs to have
              > 'types' available as a child of 'entity' and 'type' available as a subnode
              > of 'types' even if the internal data structure was
              >
              > class Entity {
              > List types;
              > };

              Having had a quick look at the XPath stuff that comes with Xerces and
              Xalan it would appear that it only works with DOM.

              Jaxen on the other hand will let you use any document model you want. You
              just need to implement the Navigator interface for your model. This has a
              function for each axis:

              public Iterator getChildAxisIterator(Object contextNode)
              throws UnsupportedAxisException

              where context node could be an object that details where we are in our
              virtual tree (i.e. a list of context nodes from root leading to this one).

              So the path stack for /entities/entity[12]/types/type[1] would look
              something like:

              [0] = DocumentRootNode { }
              [1] = RootNode { }
              [2] = ArrayNode { Array array=entityList };
              [3] = ArrayEntryNode { Entity entity=foo; position=12 }
              [4] = ArrayNode { Array array=bar }
              [5] = ArrayEntryNode { Object object=froboz; position=1 }

              Then we can navigate around our tree with a little help from the data
              structures. i.e. an Entity class would have to know how to respond to a
              request for a "types" child, but we can apply an interface to our classes
              to help navigate them, or use a Beans based approach to interrogating the
              contents of an object (e.g. an Entity).

              ...Waits with baited breath for Keith to explain why this is a bad idea ;O)

              --
              regards,
              Frugal
              -OS Chimp
            • andargor
              ... and ... want. You ... has a ... our ... this one). ... data ... to a ... classes ... interrogating the ... idea ;O) ... I m actually using XPath quite
              Message 6 of 15 , May 10, 2004
              View Source
              • 0 Attachment
                --- In pcgen-xml@yahoogroups.com, "Frugal" <frugal@p...> wrote:
                > <quote who="Frugal">

                > Having had a quick look at the XPath stuff that comes with Xerces
                and
                > Xalan it would appear that it only works with DOM.
                >
                > Jaxen on the other hand will let you use any document model you
                want. You
                > just need to implement the Navigator interface for your model. This
                has a
                > function for each axis:
                >
                > public Iterator getChildAxisIterator(Object contextNode)
                > throws UnsupportedAxisException
                >
                > where context node could be an object that details where we are in
                our
                > virtual tree (i.e. a list of context nodes from root leading to
                this one).
                >
                > So the path stack for /entities/entity[12]/types/type[1] would look
                > something like:
                >
                > [0] = DocumentRootNode { }
                > [1] = RootNode { }
                > [2] = ArrayNode { Array array=entityList };
                > [3] = ArrayEntryNode { Entity entity=foo; position=12 }
                > [4] = ArrayNode { Array array=bar }
                > [5] = ArrayEntryNode { Object object=froboz; position=1 }
                >
                > Then we can navigate around our tree with a little help from the
                data
                > structures. i.e. an Entity class would have to know how to respond
                to a
                > request for a "types" child, but we can apply an interface to our
                classes
                > to help navigate them, or use a Beans based approach to
                interrogating the
                > contents of an object (e.g. an Entity).
                >
                > ...Waits with baited breath for Keith to explain why this is a bad
                idea ;O)
                >
                > --
                > regards,
                > Frugal
                > -OS Chimp

                I'm actually using XPath quite extensively in my experiments. I am
                surprised that you would need DOM.

                For example, I'm using libxml2 (I'm doing this in C++) and it does
                not require DOM nor SAX, and it's damn fast. Portable too.

                Anyway, I feel that XPath is the way to go, since you can change the
                XML format somewhat without having to recode your serach functions.
                It's very flexible.

                I'm toying with SpiderMonkey (Javascript engine, has a Java
                couterpart named Rhino), libxml2 and an "object" engine in C++.

                I'm in my 6th iteration of how to handle all this, so that's why I
                haven't posted anything yet. But the direction I'm goind in is that
                everything is an object, be it a stat, an ability (such as a class
                ability or a feat), or whatever. Class levels, for example, are just
                containers for objects.

                Andargor
              • Frugal
                ... There are various XPth implementations, the Xerces/Xalan combo only uses DOM for XPath queries as it is designed for XSLT only, and
                Message 7 of 15 , May 10, 2004
                View Source
                • 0 Attachment
                  <quote who="andargor">
                  > I'm actually using XPath quite extensively in my experiments. I am
                  > surprised that you would need DOM.
                  >
                  > For example, I'm using libxml2 (I'm doing this in C++) and it does
                  > not require DOM nor SAX, and it's damn fast. Portable too.

                  There are various XPth implementations, the Xerces/Xalan combo only uses
                  DOM for XPath queries as it is designed for XSLT only, and thus needs a
                  tree in memory.

                  > I'm in my 6th iteration of how to handle all this, so that's why I
                  > haven't posted anything yet. But the direction I'm goind in is that
                  > everything is an object, be it a stat, an ability (such as a class
                  > ability or a feat), or whatever. Class levels, for example, are just
                  > containers for objects.

                  How soon do you think you will have something you can show off ? I am
                  curious to see what some one else has come up with.

                  --
                  regards,
                  Frugal
                  -OS Chimp
                • andargor
                  ... Yeah, libxml2 uses it s own tree structure (a linked list, really) for XPath and XSLT. ... I m working on it :P I m always saying next week or so, then I
                  Message 8 of 15 , May 10, 2004
                  View Source
                  • 0 Attachment
                    --- In pcgen-xml@yahoogroups.com, "Frugal" <frugal@p...> wrote:

                    > There are various XPth implementations, the Xerces/Xalan combo only uses
                    > DOM for XPath queries as it is designed for XSLT only, and thus needs a
                    > tree in memory.

                    Yeah, libxml2 uses it's own tree structure (a linked list, really) for
                    XPath and XSLT.

                    > How soon do you think you will have something you can show off ? I am
                    > curious to see what some one else has come up with.
                    >
                    > --
                    > regards,
                    > Frugal
                    > -OS Chimp

                    I'm working on it :P

                    I'm always saying next week or so, then I scrap everything and start
                    over :) I'm getting a handle on the spidermonkey engine and I think
                    the current approach is good, so I'm gonna say next week for basic
                    stuff. The gf is going to her folks weekend after next, so I'll have
                    some "quality" coding time. :)

                    Andargor
                  • andargor
                    ... Just spotted this thread in d20-xml, and it s very similar to what I m trying to do: http://games.groups.yahoo.com/group/d20-xml/message/2180 Andargor
                    Message 9 of 15 , May 11, 2004
                    View Source
                    • 0 Attachment
                      --- In pcgen-xml@yahoogroups.com, "Frugal" <frugal@p...> wrote:
                      > <quote who="andargor">

                      > > I'm in my 6th iteration of how to handle all this, so that's why I
                      > > haven't posted anything yet. But the direction I'm goind in is that
                      > > everything is an object, be it a stat, an ability (such as a class
                      > > ability or a feat), or whatever. Class levels, for example, are just
                      > > containers for objects.
                      >
                      > How soon do you think you will have something you can show off ? I am
                      > curious to see what some one else has come up with.
                      >
                      > --
                      > regards,
                      > Frugal
                      > -OS Chimp

                      Just spotted this thread in d20-xml, and it's very similar to what I'm
                      trying to do:

                      http://games.groups.yahoo.com/group/d20-xml/message/2180

                      Andargor
                    • Frugal
                      ... I wonder why I never receive any emails from the D20 list even though I am subscribed... I have been checking out the competition
                      Message 10 of 15 , May 13, 2004
                      View Source
                      • 0 Attachment
                        <quote who="andargor">
                        > Just spotted this thread in d20-xml, and it's very similar to what I'm
                        > trying to do:
                        >
                        > http://games.groups.yahoo.com/group/d20-xml/message/2180

                        I wonder why I never receive any emails from the D20 list even though I am
                        subscribed...

                        I have been checking out the competition and I noticed that
                        RolePlayingMaster uses javascript for all of it's data. the 'expression'
                        entry for Ambidexterity looks like:

                        function OnCalcWeapon( obj )
                        {
                        if( obj.Attack.Style == 4 ) // Two weapon
                        {
                        if( obj.OffHand )
                        {
                        obj.ToHitBonus += 4;
                        obj.Mods.addMod( "Attack@Ambidexterity", 4, true );
                        }
                        }
                        }

                        and Greater Weapon Focus looks like:

                        function OnCalcWeapon( obj )
                        {
                        var weap = obj;
                        var c = weap.Attack.Creature;
                        var feat = "Greater Weapon Focus: " + weap.ProficiencyName;

                        if( containsStr( c.V_feats, feat, true ) && (weap.doneFocus == NULL) )
                        {
                        weap.doneFocus = true;
                        weap.ToHitBonus += 1;
                        weap.Mods.addMod( "Attack@Greater Weapon Focus", 1, true );
                        }
                        }

                        function OnCreate( obj )
                        {
                        selectFeatItem( "ITEMS_WEAPONS_NAT_ALL", "Select Focus Weapon" );
                        }

                        It is interesting to note that the dialog that pops up for Greter Weapon
                        Focus does not restrict the selection to the weapons you have Weapon Focus
                        for.

                        Out of all of the character generators I have looked at only RedBlade does
                        this, and that is because in the feat editor it has a "use Weapon Focus
                        Feats" check box, everything else just displays the full list of weapons.
                        PCGen appears to be the only editor that tries to restrict the users
                        choices to the correct set...

                        --
                        regards,
                        Frugal
                        -OS Chimp
                      • andargor
                        ... what I m ... though I am ... the expression ... (snip) ... Weapon ... Weapon Focus ... RedBlade does ... Focus ... weapons. ... Yes, and I agree with the
                        Message 11 of 15 , May 13, 2004
                        View Source
                        • 0 Attachment
                          --- In pcgen-xml@yahoogroups.com, "Frugal" <frugal@p...> wrote:
                          >
                          > <quote who="andargor">
                          > > Just spotted this thread in d20-xml, and it's very similar to
                          what I'm
                          > > trying to do:
                          > >
                          > > http://games.groups.yahoo.com/group/d20-xml/message/2180
                          >
                          > I wonder why I never receive any emails from the D20 list even
                          though I am
                          > subscribed...
                          >
                          > I have been checking out the competition and I noticed that
                          > RolePlayingMaster uses javascript for all of it's data.
                          the 'expression'
                          > entry for Ambidexterity looks like:
                          >

                          (snip)

                          > It is interesting to note that the dialog that pops up for Greter
                          Weapon
                          > Focus does not restrict the selection to the weapons you have
                          Weapon Focus
                          > for.
                          >
                          > Out of all of the character generators I have looked at only
                          RedBlade does
                          > this, and that is because in the feat editor it has a "use Weapon
                          Focus
                          > Feats" check box, everything else just displays the full list of
                          weapons.
                          > PCGen appears to be the only editor that tries to restrict the users
                          > choices to the correct set...
                          >
                          > --
                          > regards,
                          > Frugal
                          > -OS Chimp

                          Yes, and I agree with the method PCGen uses. Restricting the choices
                          means following the rules and making character generation that much
                          easier for the user.

                          I had tried something similar to this, with XML just
                          being "descriptions" and attached JS code for "behavior".

                          The basic problem is the push and pull model: you retrieve values
                          from other objects and you set values for other objects. This
                          generated horrendous dependency issues, and you have to have several
                          calculation passes to get everything right.

                          What I'm aiming for right now is a completely "pull" model: values
                          are only retrieved from other objects. If any values are set, they
                          stay internal to the object. So a value can be calculated simply by
                          following dependencies. E.g.: evaluate StrMod -> get Str score ->
                          return (Str score - 10)/2

                          I "attach" bonus objects to, say, Str. So when I get Str, it goes
                          through the bonus objects before returning a value.

                          When, say, a feat is added to a character, the feat is an object
                          containing other objects, and they just get inserted in the
                          calculation. Same with classes, races, whatever. The distinction
                          between feat, class, special ability disappears on the surface, and
                          remains inside the object.

                          I'm trying to make objects as self-contained as possible, except for
                          values of other objects. I'm avoiding globals entirely.

                          Anyway, I'm still working on it. Crossing my fingers for next
                          weekend. Haven't coded a line since Sunday... :(

                          Andargor
                        • andargor
                          Hi all, I coded up a little demo to illustrate the advantages of using independent XML objects for character generators. It s a little too large to be put in
                          Message 12 of 15 , May 25, 2004
                          View Source
                          • 0 Attachment
                            Hi all,

                            I coded up a little demo to illustrate the advantages of using
                            independent XML objects for character generators.

                            It's a little too large to be put in the Files section (1.5MB), so
                            it's on my site:

                            http://www.andargor.com/files/panther-demo.zip

                            - Unzip to any directory
                            - Read the README for the explanation on the approach
                            - Execute panther.exe for a sample character

                            I'd love to hear your comments,

                            Andargor
                          • merton_monk
                            I like your implementation. Your xml is easily readible and I like how you abstracted the rules into system.xml. Just from glancing at how you constructed
                            Message 13 of 15 , May 26, 2004
                            View Source
                            • 0 Attachment
                              I like your implementation. Your xml is easily readible and I like
                              how you abstracted the 'rules' into system.xml.

                              Just from glancing at how you constructed your class.xml, I wonder if
                              you could create a class-template, since it appears that a lot of the
                              classes repeat a lot of the same information with only subtle
                              changes. e.g.


                              <object>
                              <category>level</category>
                              <name>Cleric Skill Points 3</name>
                              <classname>Cleric</classname>
                              <classlevel>3</classlevel>
                              <value>2</value>
                              <targets>
                              <target>
                              <category>level</category>
                              <name>Cleric Skill
                              Points</name>
                              </target>
                              <target>
                              <category>skill</category>
                              <name>Skill Point List</name>
                              </target>
                              <target>
                              <category>skill</category>
                              <name>Total Skill
                              Points</name>
                              </target>
                              </targets>
                              </object>


                              Is repeated for every class for every level 1 to 20, with only the
                              level and the class name changing. Maybe it's not possible in your
                              schema to have a 'use this macro, but replace classname with Cleric,
                              and level with 3' type function. It would dramatically lower your
                              file-size, and may even speed up initialization/load time.

                              That's just a first impression. Nice job - obviously you've put a lot
                              of effort into this!

                              -Bryan
                              Benevolent Dictator of PCGen

                              --- In pcgen-xml@yahoogroups.com, "andargor" <andargor@y...> wrote:
                              > Hi all,
                              >
                              > I coded up a little demo to illustrate the advantages of using
                              > independent XML objects for character generators.
                              >
                              > It's a little too large to be put in the Files section (1.5MB), so
                              > it's on my site:
                              >
                              > http://www.andargor.com/files/panther-demo.zip
                              >
                              > - Unzip to any directory
                              > - Read the README for the explanation on the approach
                              > - Execute panther.exe for a sample character
                              >
                              > I'd love to hear your comments,
                              >
                              > Andargor
                            • andargor
                              ... Thanks for the comment Bryan. Yes, that was the plan, to use object templates , but I didn t have the time to implement them :) Actually, the classes file
                              Message 14 of 15 , May 26, 2004
                              View Source
                              • 0 Attachment
                                --- In pcgen-xml@yahoogroups.com, "merton_monk" <merton_monk@y...> wrote:

                                > Is repeated for every class for every level 1 to 20, with only the
                                > level and the class name changing. Maybe it's not possible in your
                                > schema to have a 'use this macro, but replace classname with Cleric,
                                > and level with 3' type function. It would dramatically lower your
                                > file-size, and may even speed up initialization/load time.
                                >
                                > That's just a first impression. Nice job - obviously you've put a lot
                                > of effort into this!
                                >
                                > -Bryan
                                > Benevolent Dictator of PCGen

                                Thanks for the comment Bryan. Yes, that was the plan, to use "object
                                templates", but I didn't have the time to implement them :)

                                Actually, the classes file is generated by a perl script for now :D

                                There are a lot of other optimizations that are needed, particularly
                                memory usage, speeding up XPath lookups with indices, etc. All in good
                                time...

                                Andargor
                              • merton_monk
                                ... the ... your ... Cleric, ... your ... lot ... I assumed you had used a script of some kind - typing all of that in would have left you with major carpal
                                Message 15 of 15 , May 28, 2004
                                View Source
                                • 0 Attachment
                                  --- In pcgen-xml@yahoogroups.com, "andargor" <andargor@y...> wrote:
                                  > --- In pcgen-xml@yahoogroups.com, "merton_monk" <merton_monk@y...>
                                  wrote:
                                  >
                                  > > Is repeated for every class for every level 1 to 20, with only
                                  the
                                  > > level and the class name changing. Maybe it's not possible in
                                  your
                                  > > schema to have a 'use this macro, but replace classname with
                                  Cleric,
                                  > > and level with 3' type function. It would dramatically lower
                                  your
                                  > > file-size, and may even speed up initialization/load time.
                                  > >
                                  > > That's just a first impression. Nice job - obviously you've put a
                                  lot
                                  > > of effort into this!
                                  > >
                                  > > -Bryan
                                  > > Benevolent Dictator of PCGen
                                  >
                                  > Thanks for the comment Bryan. Yes, that was the plan, to use "object
                                  > templates", but I didn't have the time to implement them :)
                                  >
                                  > Actually, the classes file is generated by a perl script for now :D

                                  I assumed you had used a script of some kind - typing all of that in
                                  would have left you with major carpal tunnel! I know my hands were
                                  sore for a few days when I first typed in the Spells from the PHB
                                  when 3e first came out.... ;)

                                  -Bryan

                                  >
                                  > There are a lot of other optimizations that are needed, particularly
                                  > memory usage, speeding up XPath lookups with indices, etc. All in
                                  good
                                  > time...
                                  >
                                  > Andargor
                                Your message has been successfully submitted and would be delivered to recipients shortly.