RPG Calculator

Decorating attributes, adding modifier, and unstacking

Once we have loaded the XML file it comes the time to decorate the tree. This process is done by attaching Attributes to the tree. These attributes should have a base value, modifiers, and function to calculate them. This function in most cases will take the base value and apply all the bonuses (after unstacking).

D20 Design Ideas

Since most of the action on RPG Calculator happens in then Guile/Scheme world we will give some D20 examples in this section to explain how the toolkit can be used. Hopefully this will make contributing to the project easier.

The way we are suggesting here is not necessarily the way things will be implemented. But D20 is being used to test and model the RPG Calculator, and we hope some of the ideas will make it to the final version. Remember, this is an example of how to use the toolkit, not the necessary way to implement a RPG system in the toolkit.

Building RPG Calculator

For the time being building RPGCalc is a manual process that involves building the pre-reqs and the code itself. This page gives a short description of how to build the code on Linux (tested in Ubuntu). We do not have build for windows (yet).

Why use XML/XPath

This is another issue that is not as obvious as it looks at first. For those who love prue functional languages, there is no need to represent data in another format. It could all be done using Guile/Scheme. True, but XML and Xpath give use some interesting features.

Why use C++?

This is a easy one and a hard one. C++ has some benifits and some problems. But in general the short answer is: it's the only language that could glue all the pieces.

Why do it this way?

Some people who have already thought of doing a RPG assistant may question why parts of the solutions were chosen. Some of these questions are really valid and answering them will explain why this is not a crazy project, and hopefully convince people to join the cause.

Attributes

Attributes are used to represent data in the character. They are linked to an entity. They are the most complex object in RPG Calculator. They are designed to have values calculated when it is required, and to store values for as long as they are valid.

Decorated XML Trees and XPath

One key concept in RPG Calculator is the Decorated XML file. XML files can be respresented as a tree. Decorating such a tree is putting information we will need on the nodes of the tree. You can see this like a Christmas tree, you have a pine (the XML tree) to which you add colored balls (in our case Scheme objects). This way we can have XML hold the basic data and then use Scheme object attached to the tree to get derived values.

RPG Calculator Concepts

While most of the work in RPG Calculator is done using Guile/Scheme, we have added several new elements to the standard Scheme types. They are used to allow a certain level of abstraction and to hold data that is not normally available in Scheme (like XML trees).

Why use Guile?

Guile is a very good implementation of Scheme, which is a variant of LISP. This means that we have a powerful functional programming language with a simple syntax, that can be easily embedded into another language and into files. Scheme is actually very XML friendly since it does not use many of the character that are used by XML. As an example SGML (similar syntax for XML) processing can be done using DSSSL, which uses Scheme in some XML definition files.

Syndicate content