d20 rules as XML

JBowtie

First Post
I'm pretty much a new DM and I have been absorbing the huge amount of d20 information out there. I've pretty much decided that there is a LOT more good, useful, and interesting material than I can hope to keep track of on my own.
One thing that is absolutely essential for me is a variety of software tools that keep track of various information. Unfortunately, none of these rolls really talk to one another. Luckily for me, as a developer I'm in a position to do something about it. I've been designing what I think is a pretty flexible and useful XML representation of the various d20 rules and trying to use it in my own, home-grown character generator.
So far, I can throw information from the core books, FR, Rokugan, Ravenloft, and Dragonstar at it and have it stand up pretty well. What I think is important and interesting about this is that it's really easy to define classes, skills, and feats using XML without resorting to recoding my tool everytime a new mechanic or prerequisite is introduced. More importantly, I hope, the publishers could produce XML equivalents of their rules while the tools people could concentrate on interpreting those rules.
I have a little work to do to formalize the schema and show some examples of expressing some of the difficult prerequisites and effects associated with the rules. It will probably be a week or so before I have this information written and uploaded to my site. In the meantime, I would really like to know if developers and publishers would welcome such standardization, how they feel about working with XML, and what sorts of things are likely to pose challenges.
 

log in or register to remove this ad

Davin

First Post
If you'll run over to the Yahoo group area, you should find a group of folks (called D20-XML or something like that) working on an XML specification for D20 information. While they're focus is on storing data rather than rules, I'll bet you'd have a lot in common and would benefit from working with them as a group.
 

celeborn67

First Post
what are using for development environment?

what are you using as your development environment?
I am very interest in searchable rules database.
And WoTC will not develop any think for this..
 

gariig

First Post
linky linky

Check it out, might be what you are looking for. It is only the SRD, but that's the basics anyways

Meant to say check out the MSHelp one.

Gariig
 
Last edited:

JBowtie

First Post
Re: what are using for development environment?

celeborn67 said:
what are you using as your development environment?
I am very interest in searchable rules database.
And WoTC will not develop any think for this..
Well, I'm using XML for the rules, XSLT for processing the rules, and HTML with Javascript for my user interface.

The main drawback to a database as such is that a relational database doesn't work especially well with loosely structured data. And, given the creative ways feats and classes can affect the basic mechanics (or introduce new mechanics), the rules for d20 are only loosely structured.

For example, when a new feat is defined, it may include a notation that it can be used as a fighter bonus feat. I'm not going to go back and edit the fighter class every time that happens, especially if the feat introduces a new mechanic.
Instead, I need to be a little looser and allow the fighter list to be built from a combination of the predefined list and new feats that claim to belong to the list.

This looser structure is lot harder to model in a database - that's why the Master Tools folks don't expose a way to expose your own prestige classes. But with XML I've added prestige classes from Dragon Magazine and Rokugan without having to change my processing or user interface.

Now, I'm still in the process of defining and implementing the XML, so some prerequisites are still hard to define (mostly the ones relating to spells and casters since I don't handle spells at all yet). But the majority of feats and skills are handled correctly.

The point is that there's enough structure to model the rules, but not enough to model them as a database.

Oy, I've said too much without giving a concrete example. I'll post some sample markup later today.
 

celeborn67

First Post
i was just wondering. I am in the process of learning VS C#.
i wrote several simple databases in Lotus Notes R5. which work well, but most gamers would not have access to lotus notes.

this databases handled feats, and spells, psionic powers.
I didn't see a need to handle skills. they were basicly treated each as a document. so when you looked at it you got all the information.
 

Lizard

Explorer
Re: Re: what are using for development environment?

JBowtie said:


For example, when a new feat is defined, it may include a notation that it can be used as a fighter bonus feat. I'm not going to go back and edit the fighter class every time that happens, especially if the feat introduces a new mechanic.
Instead, I need to be a little looser and allow the fighter list to be built from a combination of the predefined list and new feats that claim to belong to the list.

Feats are stored in a table. There is a field in that table called "IsFighterBonus", which is a boolean. When a fighter has a chance to pick a bonus feat, you "select * from Feats where IsFighterBonus=TRUE".

Of course, it is now the case that many classes have custom lists of bonus feats, so you REALLY do it like this:

Table Feats
FeatID int
....

Table Class
ClassID int
....

Table ClassBonusFeats
ClassID int
FeatID int

Then, when you select bonus feats...

"select a.FeatName from Feats a, ClassBonusFeats b where c.ClassID=CurrClass and a.FeatId=b.FeatID" (Assumes CurrClass is defined as a valid ClassID somewhere else in the code)
 

JBowtie

First Post
Lizard said:

"select a.FeatName from Feats a, ClassBonusFeats b where c.ClassID=CurrClass and a.FeatId=b.FeatID" (Assumes CurrClass is defined as a valid ClassID somewhere else in the code)

Which works fine until you consider the following:
Some campaign settings change the selection of bonus feats based on your clan, region, or background (Rokugan, for example).
A feat could be defined that allows you access to the fighter list (expanding your class' normal bonus feat list). Rokugan inkyo monks have weird restrictions on feat availability and selection.
Taking ranks in Knowledge (Local) could allow your to extend the bonus feat list in some campaigns (FRCS, for example).
Spell lists are even worse since classes have different mechanisms for allowing or prohibiting new spells.

Each of these instances CAN be handled in a relational setting - it's just that the combination of them and the constant introduction of new mechanics conspire to reduce the effectiveness of a relational solution.
It's trivial to define a new rule that invalidates a given select statement, because the d20 framework makes it trivial.
I'm trying to reduce the maintenance burden on the programmer somewhat by choosing a representation that allows more arbitrary extension. I personally feel that from a longer-term perspective, XML is less fragile and easier to maintain than the database approach do to the nature of the rules .

Frankly, I would prefer a relational solution, because I am better with SQL than XSLT, because SQL queries will outperform XML parsing for the forseeable future, and because the more rigid structure prevents many, many errors. BUT I feel that the limitations outweigh the benefits when it comes to modelling the kinds of rules draped over such a loose framework.
 

JBowtie

First Post
celeborn67 said:
this databases handled feats, and spells, psionic powers.
I didn't see a need to handle skills. they were basicly treated each as a document. so when you looked at it you got all the information.

I model skills because my campaign tools calculate skill bonuses. I need to figure synergy bonuses, feat bonuses, class, cross-class or prohibited on a per class basis, racial bonuses, special ability bonuses. equipment bonuses (like a cloak of elvenkind), and make sure the various bonuses stack (or not) according to the rules.

Part of the reason I handle a lot of complexity is that I cherry-pick from a lot of sources in my campaign, and my NPCs end up using rules from three or four different campaigns or sourcebooks.
I have rokugani races using psionic rules in Ravenloft, and that gives me a pretty big number of rules interactions to deal with. It's much simpler when you restrict yourself to the PHB or a single campain setting, but I can't help it.
 

celeborn67

First Post
I modeled my database from a reference point of view.
I used it very much when started learning 3E. Now use it to
reference spells or psionic powers character has, by having a printout of particular spell or power, just to keep with character.

I though of writing a diferent database to handle more of character creation or NPC creation i woud have database similar to yours more than likeley
 

Remove ads

Top