• NOW LIVE! Into the Woods--new character species, eerie monsters, and haunting villains to populate the woodlands of your D&D games.

D20 Engine - DESIGN (forget code)

This is interesting since I've considered doing this here, using joomla/vbulletin to create a basica user framework and deliver the application through the web. There are a couple of distinct advantages from the user's point of view on this.

First, as a web application the user's system requirements are a non-issue as long as they run a browser that can sent post data. Everyone here meets that requirement - else vbulletin wouldn't work for them and they wouldn't be here ;)

Second upgrades can be handled on a server level.

Third MySQL provides a powerful database architecture within which to store the data. Joomla and vbulletin provide a powerful access control layer to determine who can change what is designated as core or optional systemwide.

Fourth a PHP delivered engine is not self contained to each user's PC. While it has the limitation of requiring internet connectivity at playtime I don't forsee this being too great an obstacle in the days of WiFi.

Fifth advantage is the ease with which user creations can be shared, accessed and commented on.

My current professional project is a generic forms engine in PHP. It allows the user to create and link html forms without writing new code *most* of the time. This engine could be co-opted for this project without two much fuss from my boss I think (I'm the only employee, only 3 persons in the company). At their heart RPG's are forms (character sheets) linked to other forms (race sheets, equipment lists, etc) so with some finessing the basic engine might be able to help.

However, my first commitment to ENWorld is EN2. I could use help in this endeavor if anyone is interested - the sooner I have it up and running the sooner I can begin work on a PHP based campaign management system.

One final comment in passing - Namespaces, while great, aren't supported in PHP. However PHP 5 does support true object oriented programming (though unlike Java it doesn't REQUIRE it). If you know how to program in Java or C you already know what you need to program PHP except that PHP is FAR MORE FORGIVING with datatypes. In PHP a variable is a variable. All variables start with $. You don't have to declare variables before you reference them (though it's bad practice to not do so), you can recast them on the fly. $object = false; will make $object into a boolean variable. If you then enter $object = 'This string'; it becomes a string. For someone coming out of the world of C or Java some PHP code can read a bit eccentricly because PHP programmers like myself take advantage of the Zend Engine's dynamic casting of variables. (for example a variable with a value assigned evaluates to the boolean true unless the value is '', 0, null or - of course - false). When it is necessary to have a datatype match (for instance to distinguish 0 from null) PHP has the strict comparison operator: ===

Oh well, enough babbling.
 

log in or register to remove this ad

Michael Morris said:
This is interesting since I've considered doing this here, using joomla/vbulletin to create a basica user framework and deliver the application through the web. There are a couple of distinct advantages from the user's point of view on this.

First, as a web application the user's system requirements are a non-issue as long as they run a browser that can sent post data. Everyone here meets that requirement - else vbulletin wouldn't work for them and they wouldn't be here ;)

Second upgrades can be handled on a server level.

Third MySQL provides a powerful database architecture within which to store the data. Joomla and vbulletin provide a powerful access control layer to determine who can change what is designated as core or optional systemwide.

Fourth a PHP delivered engine is not self contained to each user's PC. While it has the limitation of requiring internet connectivity at playtime I don't forsee this being too great an obstacle in the days of WiFi.

Fifth advantage is the ease with which user creations can be shared, accessed and commented on.

My current professional project is a generic forms engine in PHP. It allows the user to create and link html forms without writing new code *most* of the time. This engine could be co-opted for this project without two much fuss from my boss I think (I'm the only employee, only 3 persons in the company). At their heart RPG's are forms (character sheets) linked to other forms (race sheets, equipment lists, etc) so with some finessing the basic engine might be able to help.

However, my first commitment to ENWorld is EN2. I could use help in this endeavor if anyone is interested - the sooner I have it up and running the sooner I can begin work on a PHP based campaign management system.

One final comment in passing - Namespaces, while great, aren't supported in PHP. However PHP 5 does support true object oriented programming (though unlike Java it doesn't REQUIRE it). If you know how to program in Java or C you already know what you need to program PHP except that PHP is FAR MORE FORGIVING with datatypes. In PHP a variable is a variable. All variables start with $. You don't have to declare variables before you reference them (though it's bad practice to not do so), you can recast them on the fly. $object = false; will make $object into a boolean variable. If you then enter $object = 'This string'; it becomes a string. For someone coming out of the world of C or Java some PHP code can read a bit eccentricly because PHP programmers like myself take advantage of the Zend Engine's dynamic casting of variables. (for example a variable with a value assigned evaluates to the boolean true unless the value is '', 0, null or - of course - false). When it is necessary to have a datatype match (for instance to distinguish 0 from null) PHP has the strict comparison operator: ===

Oh well, enough babbling.

This approach is interesting indeed! But I thought the aim was to create a standalone framework which can be expanded easily by new databases. My approach is actually to create a DLL with a couple of tools, that use the functions of this dll to create characters, monsters, to simulate combats or whatever. My database is Microsoft Access. I chose this one because nearly every computer thisdays has Microsoft Office, but it wouldn't be a big problem to change to MySQL instead.

The advantage is, that everyone, who can use a database, can expand the system for new classes, races, etc. There isn't need to change any line of code to ensure compatibility with new material added to the system.

I think the big problem here is that it isn't simply clear, what kind of application we want. As I read your post, Michael, I had the idea of an combined system: A server, which can create you characters or whatever online, based upon your php framework. And if someone wants a standalone package, he/she can simply download my dll, along with all databases actually needed. This would prerequisite, that we use the same database to avoid any conflicts ...

As I think further of this idea, I got shaken by the extensibility and the coverage of this task :confused:

But it would also be interesting, wouldn't it? :)
 

Karan,

I love your idea. I had been thinking that I was going to have to create a class for every single object in the game - every class, race, item, spell, etc. (and that if the whole thing was open source, then it would be extensible *enough* even though hardcoded) While I would like to have such a framework, building is just too much. However, using a Manager class to extract data from a dataset is a lot easier...but trickier. (I need to read the Gang of Four book) I could persist the data as xml, and make it quite transparent. There is a lot of potential for pitfalls using this method; though, they should be resolvable. And thanks for the tip on taking things in bite size pieces! ;)

-A
 

What programming language are you actually using (or would you like to use)? My choice was C# for this project, and I can tell you, that accessing a database with .NET is a piece of cake! The same for Java, if you want to connect to a MySQL database. There are literally dozens of classes, (whether in .NET or in the Java SDK) which perform many actions on rows, columns, whole tables, ... You just have to build the right querys, respectivly to extract the data from the right cell. The only big challenge in the beginning is to set up a framework for your database which really represents all data you need. (Even in this case you should go step by step: e.g. classes as first, then races, skills, ...)

It isn't anymore as hard as it was in the 'good old days' when you even had to write your own method to color a single f***in' pixel!

P.S.:
XML, in my opinion, is a real pain in the a** for such "database" tasks, I wouldn't use it, if I was you. I prefer to use xml for data exchange only, because this is the most simple way in most cases.
 
Last edited:

Into the Woods

Remove ads

Top