I'm considering starting work on a project. This project will be a portable, easy to use program for handling RPG characters, setting, and administrative details. It should work something like the now defunct grapevine, but should handle other RPG systems than White Wolf's LARP. Ideally it should handle any system, based on a descriptive settings file (possibly XML, JSON, etc) describing how that system's characters are notated.

I am attempting to design this project data-structure first, as I feel that is the part of the program that will be the biggest pain to change down the road. I submit for discussion, criticism, and suggestions the outline for the data structures, starting with a high level overview, and descending to what ideas I have for the implementation.

At any time, there will be one global "System" object, representing the roleplaying system in effect. This isn't very friendly to crossovers, I know, but I feel that this model will handle any games that use the same basic system for dealing with characters, provided the character-type descriptions are sophisticated enough. In addition to information on the system being used, Categories, Traits and attributes available to all types of characters live here, as well as the types of characters allowed.

Character types are what they sound like. For instance, in a White Wolf system, Vampire, Werewolf, and Mortal would all be character types. In D&D, this might be PC, Monster. Basically, this should deal with differences to the structure of the character's sheet (Different categories of powers, different costs for traits, etc.) Information here should override information in the base system settings (For instance, if everyone pays 10 XP for a merit, but ghosts pay 5, then this is how you would resolve that.)

Categories are types of traits available (example: Levels, Disciplines, Skills, Powers.) Ideally, information shared by all traits in a category (cost, for instance) would be kept here. Categories are only attachable to either the System or to a Character type. They do override: if a character doesn't have a particular category that everyone else in the system has, it should be possible to override with a sentinel or null value to signify this.

Traits are... well, just about everything. These are going to be the bread and butter of the data structure. They will be capable of having both traits and attributes; they will represent anything that is potentially present or not-present. They may contain other traits (subtraits such as merits attached to a power in some system, or alternate powers in others. One way to handle White Wolf disciplines might be to have each discipline learned be a trait, and each level in the discipline also be a trait. They may also have attributes attached to them.

Attributes will be key-value pairs that represent single-value, unique data attached to an object. Each data object will have a separate group of attributes.

Implementation-wise, attributes will probably be represented by a plain old hash, one per object. Traits and categories will be more complex objects, although they probably will have relatively few methods. Systems will probably be a collection of local/package variables that the other layers depend on, with container hashes or arrays for the other objects, and a large number of attributes that program logic will be built around.

As you can see, I'm still at a very early stage in planning this. Any design advice or examples to learn from would be most welcome, as well as any suggestions for implementation.

Some of the things I'd most like to hear about are:

In addition, I definitely intend to open source this once there's any source to open; if anyone is willing to collaborate with a novice programmer on something like this, understanding that it's kind of a learning project (as well as a serious attempt to scratch a real-world itch), let me know.

for(split(" ","tsuJ rehtonA lreP rekcaH")){print reverse . " "}print "\b.\n";

In reply to RFC: RPG ;-) by pobocks

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.