RPToken Files & Character Generation Programs

Discussion of your thoughts & requests, help for users and game specific configuration files for Character Tool

Moderators: dorpond, Azhrei

User avatar
jay
RPTools Team
Posts: 1767
Joined: Tue Feb 07, 2006 1:07 am
Location: Austin, Tx

RPToken Files & Character Generation Programs

Post by jay »

This thread is for the discussion of creating RPToken files that can be used in MT & CT from character generation programs like DMGenie & PCGen. It is fairly simple to do if your character generation program can output XML in a format that you choose. The procedure is:
  1. Create an RPToken (.rptok) using either MT or CT.
  2. Generate a custom character.xml file from your character tool. Later posts will show the format of the character.xml file and how to get it from specific tools.
  3. Copy the character.xml file you created into the RPToken file. An RPToken file is just a zip file with the token data in a file called content.xml, a file containing metadata called properties.xml, the character tool data in a file called character.xml, and a directory called asset/ with all of the image data in it. Just copy the character.xml you created and replace the one already there or add it if it is missing.
I'll add more details as I get the time.

User avatar
UntoldGlory
Great Wyrm
Posts: 1649
Joined: Sun Mar 16, 2008 8:12 pm

Post by UntoldGlory »

I don't use a character generator, but that was a worthy read just to hear the breakdown of the rptok like that! :lol:

User avatar
thelevitator
Dragon
Posts: 963
Joined: Wed May 17, 2006 2:10 pm
Location: "The Biggest Little City In The World!"
Contact:

Post by thelevitator »

I jusst picked up Metacreator, because it has a FUDGE character creator. I haven't even had time to really play with it, but it's fully customizable. I would be even more interested in using this program if it has a way to export characters to CT and MT. Are you familiar at all with Metacreator?

Here's their main website: http://www.alteregosoftware.com/metacreator.html
"Neither hexes nor squares can confine me!"

James Anthony
"It's all in your head....."
http://www.spelz.net

User avatar
RPMiller
Demigod
Posts: 2555
Joined: Sun Jul 01, 2007 1:23 am

Post by RPMiller »

Oh sweet! I am so ready to go with this. In fact I already have an XML export format. I just need to know the XML specifics to change to make it work.

On a related note, which xml file contains the properties and token macros? We are using a lot of them in our Hero game and I wouldn't want to wipe them out accidentally by replacing the wrong file.
You're just jealous 'cause the voices only talk to me.

ImageImage

User avatar
jay
RPTools Team
Posts: 1767
Joined: Tue Feb 07, 2006 1:07 am
Location: Austin, Tx

Post by jay »

thelevitator wrote:I jusst picked up Metacreator, because it has a FUDGE character creator. I haven't even had time to really play with it, but it's fully customizable. I would be even more interested in using this program if it has a way to export characters to CT and MT. Are you familiar at all with Metacreator?

Here's their main website: http://www.alteregosoftware.com/metacreator.html
I'm not familiar with it but it does mention 'Text-based data sheets' which sounds like what you would use to create the character.xml file.

User avatar
jay
RPTools Team
Posts: 1767
Joined: Tue Feb 07, 2006 1:07 am
Location: Austin, Tx

Post by jay »

RPMiller wrote:Oh sweet! I am so ready to go with this. In fact I already have an XML export format. I just need to know the XML specifics to change to make it work.
I'll get that out soon. I'm not used to so many forum posts in one day :)
RPMiller wrote:On a related note, which xml file contains the properties and token macros? We are using a lot of them in our Hero game and I wouldn't want to wipe them out accidentally by replacing the wrong file.
You want to edit the character.xml. The content.xml file contains the MT properties and token macros. If that file gets removed or broken somehow then it is most likely that you won't be able to load that token file in MT or CT.

User avatar
RPMiller
Demigod
Posts: 2555
Joined: Sun Jul 01, 2007 1:23 am

Post by RPMiller »

jay wrote:The content.xml file contains the MT properties and token macros. If that file gets removed or broken somehow then it is most likely that you won't be able to load that token file in MT or CT.
Perfect. I'm planning on creating an export format for properties and macros as well so this is what I needed to know.
You're just jealous 'cause the voices only talk to me.

ImageImage

wacko76
Cave Troll
Posts: 80
Joined: Sat Jun 14, 2008 8:34 am
Contact:

Post by wacko76 »

Hm, wouldn't it be possible to write an import filter, so that MT, CT and IT can simply use the XML-files outputted (is that the correct tense?) by the generator tool?

Since these tools need to be adapted to the RPG system anyway, that adaption can be made in view of the XML-format used.

User avatar
jay
RPTools Team
Posts: 1767
Joined: Tue Feb 07, 2006 1:07 am
Location: Austin, Tx

Post by jay »

It would be possible to do this, to a point anyway. But the problem is the large number of tools available, the large number of games that have tools, and that fact that each one would have to be maintained as a part of Character Tool. Add in the fact that I don't play all of the games and I can't afford to buy all of the character generation tools to be able to test them and it becomes impractical.

Big_Mac
Dragon
Posts: 631
Joined: Thu Aug 17, 2006 10:37 am
Location: Brockton, MA
Contact:

Post by Big_Mac »

wacko76 wrote:Hm, wouldn't it be possible to write an import filter, so that MT, CT and IT can simply use the XML-files outputted (is that the correct tense?) by the generator tool?

Since these tools need to be adapted to the RPG system anyway, that adaption can be made in view of the XML-format used.
Typically when dealing with data output you would fit the data to the software not the other way around. Or you do a tool that can read the data then you MAP it to the right points. Oh boy ETL anyone. If I had the time I would love to try writing something like that. I love manipulating data. Its what I do all day long currently.

Regrettably with 4 kids I have limited time and my Java skills are WAY out of date.
--
Big Mac

wacko76
Cave Troll
Posts: 80
Joined: Sat Jun 14, 2008 8:34 am
Contact:

Post by wacko76 »

jay wrote:It would be possible to do this, to a point anyway. But the problem is the large number of tools available, the large number of games that have tools, and that fact that each one would have to be maintained as a part of Character Tool. Add in the fact that I don't play all of the games and I can't afford to buy all of the character generation tools to be able to test them and it becomes impractical.
the tool for my game is Freeware :lol:

But I see your point. The problem is: the generator tool guys have the same problem, there are so many VTT tools available, ...

VTT1--\........................./-- GenTool1
...........|--\................/--|...................
VTT2--/.....\............./.....\-- GenTool2
.................|-- :?: --|........................
VTT3--\...../.............\...../-- GenTool3
...........|--/................\--|..................
VTT4--/.........................\-- GenTool4

(EDIT: Why does the board remove all my empty spaces? Thats supposed to be a diagram :( . Hm, a little better now, but had to use stupid points. Any way to tell the board to not remove repeated spaces?)

Maybe the tool guys can be persuaded to write a file-converter, that read the tool-XML and creates an RPToken-XML.

Gonna ask as soon as their HP is up again.

User avatar
RPMiller
Demigod
Posts: 2555
Joined: Sun Jul 01, 2007 1:23 am

Post by RPMiller »

Just checking to see if we have the XML guidelines yet for the export. How is that coming along Jay? No rush, just curious.
You're just jealous 'cause the voices only talk to me.

ImageImage

User avatar
jay
RPTools Team
Posts: 1767
Joined: Tue Feb 07, 2006 1:07 am
Location: Austin, Tx

Post by jay »

This post contains a (long!) technical description of the character data in an RPToken file. It is not necessary to understand what is going on here to use Character Tool. It is useful to know if you are going to try and convert the data from your favorite character generator into a format that can be used by MT & CT.

The RPToken file contains 3 data files, a thumbnail file, and any number of image files which are kept in their own directory. All of the files except for the thumbnail file are XML files. This means that they are just text files with a special format to them. The thumbnail file is a PNG image file. The data file content.xml is created by MT and contains references to all of the image files in the asset directory. The properties.xml data file is a metadata file which contains the version number of MT used to create it and the name of the game where the token is used.

The character.xml data file is created by CT and contains all of the data needed to display a character. It consists of a header that contains the game name and a property map of all of the data for a specific game. Then the XML file is finished with the closing tag. The outline looks like this:

Code: Select all

<character>
  <game-name>D & D 4e</game-name>
  <property-map>
    ...
  </property-map>
</character>
The area in the middle contains all of the character data. The data that goes in there is game specific. Each property described in the game settings file can have an element in the xml file that contains the value of that property. The name of the element is the name of the property and its content is the value of the property. But the game settings files have a hierarchical structure to them. This means that some values are MAP or LIST type values that contain their own set of values. They follow the same element structure, but their content can contain other elements. The available data types are:
  • BOOLEAN: A true/false value.
  • NUMBER: A decimal number. It can also be expressed in scientific notation.
  • STRING: Text of any kind.
  • MAP: This data type contains a set of named property values which can be any type, including MAP
  • LIST: This data type contains a list of property values which are indexed starting at 0. The values may be all the same type or different types. Any type of data may be contained in a list including MAP data and other LIST's.
  • SLOT: A reference to a record in a database table. This lets the code look-up the values for things like race or class from a provided set of races or classes.
  • IMAGE: A text reference to an image stored elsewhere. The various locations for the images are:
    • URL: The image is located on the internet or in a local file.
    • GAME: The image is located in the game settings file
    • ASSET: The image is an asset file located within the RPToken file. This is the best type to use if you are saving lots of images with your character.
    • INLINE: The image is contained in the XML being read.
    • CLASSPATH: The image is contained in the Java jar files for Character Tool.
Here is the an example of an element for each data type:

Code: Select all

Format for BOOLEAN, NUMBER & STRING data types:
  <property_name>value</property_name>
    BOOLEAN values are either 'true' or 'false'
    NUMBER values have a decimal or scientific number format.

Format for MAP data types:
  <map_property_name>
    <child1_property_name>value</child1_property_name>
      ...
    <childN_property_name>value</childN_property_name>
  </map_property_name>

Format for LIST data types:
  <list_property_name node="LIST">
    <list-value index="0">value</list-value index>
      ...
    <list-value index="N">value</list-value index>
  </list_property_name>

Format for SLOT data types:
  <property_name slot="type_name::data_name" node="SLOT"/>
  The SLOT value may also contain child properties as a MAP does.

Format for SCRIPT data types:
  <property_name cacheable="true_false"><![CDATA[
     script_type::complete_script
  ]]></property_name>
  Note that the CDATA section is not required, but keeps the script syntax from interfering with the XML file format.

Format for IMAGE data types:
  <property_name>storage_type:storage_location</property_name>
  The string format is just a reference to an image located elsewhere. 
Values are not required if they match the defaults for the particular data type. You can leave the element out of the data if it matches the default. It doesn't hurt if you leave it in, it just makes the data file smaller. The defaults for each data type are:
  • BOOLEAN: false
  • NUMBER: 0
  • STRING: "" (the empty string. quotes are not needed)
  • MAP: An empty property map.
  • LIST: An empty property list.
  • SLOT: An empty slot value.
  • IMAGE: A null value.
Here is an example to help you visualize it better. This is my fighter from our D&D 4e game:

Code: Select all

<character>
  <game-name>D & D 4e</game-name>
  <property-map>
    <con>
      <base>16</base>
      <modifiers node="LIST">
        <list-value index="0" slot="modifier::race.dwarf.0" node="SLOT">
          <identifier>1213997794171</identifier>
        </list-value>
      </modifiers>
    </con>
    <race>
      <race slot="race::Dwarf" node="SLOT"/>
    </race>
    <cha>
      <base>8</base>
    </cha>
    <endurance>
      <trained>true</trained>
      <modifiers node="LIST">
        <list-value index="0" slot="modifier::race.dwarf.3" node="SLOT">
          <identifier>1213997794171</identifier>
        </list-value>
      </modifiers>
    </endurance>
    <height>4&apos; 8&apos;&apos;</height>
    <level>1</level>
    <heal>
      <trained>true</trained>
    </heal>
    <age>47</age>
    <gender>Male</gender>
    <dungeoneering>
      <modifiers node="LIST">
        <list-value index="0" slot="modifier::race.dwarf.2" node="SLOT">
          <identifier>1213997794171</identifier>
        </list-value>
      </modifiers>
    </dungeoneering>
    <int>
      <base>10</base>
    </int>
    <class>
      <class slot="class::Fighter" node="SLOT"/>
    </class>
    <size>Medium</size>
    <str>
      <base>16</base>
      <userMod>1</userMod>
    </str>
    <deity>Kord</deity>
    <alignment>Unaligned</alignment>
    <hp>
      <base>31</base>
    </hp>
    <weight>200</weight>
    <athletics>
      <trained>true</trained>
    </athletics>
    <fortitude>
      <modifiers node="LIST">
        <list-value index="0" slot="modifier::class.fighter.0" node="SLOT">
          <identifier>1213997783750</identifier>
        </list-value>
        <list-value index="1" slot="modifier::class.fighter.0" node="SLOT">
          <identifier>1214009331183</identifier>
        </list-value>
        <list-value index="2" slot="modifier::class.fighter.0" node="SLOT">
          <identifier>1214011898668</identifier>
        </list-value>
      </modifiers>
    </fortitude>
    <dex>
      <base>12</base>
    </dex>
    <wis>
      <base>12</base>
      <modifiers node="LIST">
        <list-value index="0" slot="modifier::race.dwarf.1" node="SLOT">
          <identifier>1213997794171</identifier>
        </list-value>
      </modifiers>
    </wis>
    <name>Bruvan</name>
    <experience>1237</experience>
    <speed>
      <modifiers node="LIST">
        <list-value index="0" slot="modifier::race.dwarf.4" node="SLOT">
          <identifier>1213997794171</identifier>
        </list-value>
      </modifiers>
    </speed>
  </property-map>
</character>
Some notes with this example:
  • The element <name> is a STRING element.
  • The element <experience> is a NUMBER element.
  • The element <cha> is a MAP element.
  • The element <race> is a SLOT element.
  • The element <isBloodied> is a BOOLEAN element. This element is within the <hp> MAP element.
  • All of the <modifiers> elements are examples of LIST type data. The record in each of them is a SLOT value from the modifier table. This is the internal mechanism used by all of the game settings files I've written to attach modifiers to values. For example, the <modifiers> element in <con> contains a <list-value> element which attaches the a dwarven race modifier to the calculated constitution value. This might be a problem that has to be fixed as I don't think it is a good idea for the import process to try and add these records by hand. As I figure out how to fix it I'll edit this post with the information.

wacko76
Cave Troll
Posts: 80
Joined: Sat Jun 14, 2008 8:34 am
Contact:

Post by wacko76 »

Um, if I interpret this correctly, you use the CharacterTool also for doing calculations.

I had a look at the XML-files from my generator tool and it seems it outputs only fixed data and modifiers. HP, e.g., only has the total modifiers Race/Culture/Profession and a value for HPs bought with experience.

So, unless we teach the generator to talk directly with MT and IT, we need to teach CT how to calculate the derived values, right?

That would be where the LIST and SLOT items are used, right? Although, since all the modifiers are already in the XML, maybe simple formulas would be sufficient.

CT can then display the character and calculate, but no changes can be made. For advancing the character, it would be cool if some values like XP and other system specific data could be entered and then fed back to generator tool for purchase of abilities and such.

*confusedly scratches head*

User avatar
jay
RPTools Team
Posts: 1767
Joined: Tue Feb 07, 2006 1:07 am
Location: Austin, Tx

Post by jay »

wacko76 wrote:Um, if I interpret this correctly, you use the CharacterTool also for doing calculations.
This is correct.
wacko76 wrote:I had a look at the XML-files from my generator tool and it seems it outputs only fixed data and modifiers. HP, e.g., only has the total modifiers Race/Culture/Profession and a value for HPs bought with experience.
It can get kind of tricky to work out which one is responsible for handling each value. Since you volunteered to adopt this game file, you'll get to choose :) You can have CT do as many or as few of the calculations as you want. You should focus on having CT do those things that change during game play. Current hit points is obviously one of those things you would let CT do, but you can leave the generation of maximum hit points up to your generator. Max HP would just be a number in CT. This way you can split the work between them.
wacko76 wrote:So, unless we teach the generator to talk directly with MT and IT, we need to teach CT how to calculate the derived values, right?
Integration with other tools isn't likely to happen very soon as it is a lot of work and as far as I know you are the only person on the forum who owns their own character generator. I would like to add the ability to import a character from a generator as one or more scripts that can be defined in the game settings file, but that is as far as I've got in thinking about integration with character generators.
wacko76 wrote:That would be where the LIST and SLOT items are used, right? Although, since all the modifiers are already in the XML, maybe simple formulas would be sufficient.
That is one of the things I use them for. I like to create a modifier table and as the user chooses things to apply to their character these modifiers are added to the proper stats. It is really only necessary to add things to CT that change during game play, if they are static feel free to let them just be numbers.
wacko76 wrote:CT can then display the character and calculate, but no changes can be made. For advancing the character, it would be cool if some values like XP and other system specific data could be entered and then fed back to generator tool for purchase of abilities and such.
That is entirely up to you. You should decide what is most useful for the players in both character generation and game play and then split the functionality between your generator and CT. You can add as much complexity to CT to help with character generation as you wish, but then you would have to maintain it in both places. If lots of people aren't using a character generation program to create their characters then it is best to allow CT to do more. I like to let CT have manual overrides on everything at a minimum. This is something I learned when working on IT. It isn't required of course, but it is a nice way to get things modified quickly during play and it allows a player that doesn't have access to the generator create a character.

Post Reply

Return to “CharacterTool”