Building a Framework: PRDML & PRDStore


Technology

Dark Archive

2 people marked this as a favorite.

Representing characters in digital format has been something I've attempted since the beginning of my programming life. Now with age, I've decided to look back and do it right.

Good software needs a good foundation. I am looking not at building any specific application (yet), but rather a framework for properly articulating PFSRD/PRD creatures.

In my pacing/brainstorming/wasting-time-should-be-doing-something-else-ing I have come to the conclusion that, in fact, two frameworks need to be created: PRDML for representing rules, and PRDStore for representing creatures created with those rules.

PRDML will need to be quite extensive. A "PRDCORE" listing will need to hold all the base rules (encumbrance tables, effects of character levels, etc.). Extra rule sets can hold specific classes. Such that each book (core, or otherwise) can be articulated in a manner that is universally understood.

PRDStore will be a much less comprehensive project. This should only hold arbitrary data that is not derived. So it would hold levels and feat choices, but not hold BAB (because bab is a derived stat from the rules).

This is not for a specific application goal, but rather a means of expanding PRD coverage to make open software design more feasible.

I'm looking at starting this on my own, but am curious if anyone else would like to join me in discussing this. If there is enough discussion we could go as far as starting a freenode irc channel or something and getting a better roadmap outlined.

In the end, the project should yield two specifications similar to http://www.w3.org/TR/html4/

Paizo Employee Senior Software Developer

Check your email.

Grand Lodge

I'd definitely watch, if not contribute, to such a project with interest. I undertook a similar project using drools a few years ago, and man, its a big project! Big enough to send me slinking back to my corner.

Liberty's Edge

I gave this somewhat of a shot with Python, though I didn't get very far. I'm definitely interested in helping out. I'm at my best with Python scripts, but I'm also decent with C++ and Java, though for the life of me I can't grasp graphical interfaces with either of those.

Dark Archive

My notion is to keep it language independent. XML sheets to represent the rules in plain-text. This would help non techie people be able to generate their own rules sources.

Obviously though, developers would rather interact with a database in a devel environment. I think a packaging system could be made such that a collection of XML documents is compiled into a database format (sqlite?). In the end these compiled 'sources' would be what is distributed and imported into applications.


thebwt wrote:

My notion is to keep it language independent. XML sheets to represent the rules in plain-text. This would help non techie people be able to generate their own rules sources.

Obviously though, developers would rather interact with a database in a devel environment. I think a packaging system could be made such that a collection of XML documents is compiled into a database format (sqlite?). In the end these compiled 'sources' would be what is distributed and imported into applications.

If you wanted you could build the thing in Java as that is platform independent, and then you'd also have greater functionality.

I was working on building a fan made Pathfinder game using C# to create the game libraries for modular game building.


I think the point that thebwt is trying to do is make an interchangeable file format the can accurately represent a character in a language independent way so that you could write tools in any language you want and be able to write/read to this common file format.

If you wanted to write a Java application and a C# application, both could "talk" to each other because they always store data in the same format.

Before trying to make a completely specialized file format, maybe making a more generic interchange format for several different systems - this would make the format even more extensible (e.g. create a character in your custom tool, then import into HeroLab, then use the same character imported into MapTools, and then again into OpenRPG, etc...).

XML is a great for this because you can represent a character and add new concepts (e.g. Words of Power), to existing concepts, link externally to resources easily, and implement versioning as new features/concepts are introduces and others deprecated.

Look forward to your Open-sourced specification.

P.S. Check out existing XML specifications to come up with best practices.
P.S.S. Best of luck.

Lone Wolf Development

I'm pretty sure we've already done what you're seeking to do. :-)

Hero Lab's file formats are all XML and publicly available as part of the Authoring Kit. Anyone is welcome to use and experiment with the Authoring Kit, even *without* buying the product. We've currently got full support for a healthy number of very diverse game systems, so someone could use the structure we've already mapped out to fully specify virtually any game system they can think of.

Our structure consists of essentially three pieces. The first is a representation of the rules mechanics. The second is a representation of the actual content. The third is a representation for presenting that content for use via the UI. Yes, the Hero Lab UI is fully scripted in a completely generalized manner.

The one shortcoming right now is that I believe the Authoring Kit documentation is a bit out-dated and a fair number of the mechanisms we've added over time haven't yet been rolled into the docs. But the framework is all there for anyone who wants to go through it, and we're always answering questions about how to model game mechanic X or Y on our forums. We even provide the complete source for two game systems (Savage Worlds and D&D 4E) that you can tear apart if you wish.

If nothing else, I recommend you at least look at Hero Lab as a reference for anything you might create yourself. It's an extremely complicated task when you get into abstracting the myriad of game systems out there, and Pathfinder is one of the more complex ones to start with. We've already solved it, so there's probably a lot of ideas you can glean for your own efforts. Plus you can do it for free. :-)

Hope this proves helpful....

Grand Lodge

What Rob said. I've actually already done a lot of the heavy lifting of the second thing he mentions (representation of content) in my TokenLab software utility. In this case, I take the custom output dtd and output a bunch of Java classes from the DTD using JAXB. The code to parse the actual xml content ends up being trivial:

Quote:


public Object parse(File xmlFile, Class documentClass ) throws JAXBException {
JAXBContext ctx = JAXBContext.newInstance(new java.lang.Class[] { documentClass });
Unmarshaller um = ctx.createUnmarshaller();
Object o = um.unmarshal( xmlFile );
return o;
}

So, yeah, +1 on representing both the content and rulesets as generic XML with a rich DTD specification.

EDIT: -1 on storing the schema sqllite or some db. Plain text in a hierarchical directory structure is the easiest to, say, write unit tests against. Add the db only when ya need it.

Community / Forums / Gamer Life / Entertainment / Technology / Building a Framework: PRDML & PRDStore All Messageboards

Want to post a reply? Sign in.
Recent threads in Technology