game engine tables
overview
These tables are built to describe the system in abstract terms. They should be able to describe any game, including board games, card games, dice games, or party games.
table: scale
A scale is a range of numbers meant to simplify a statistical relationship. For example, "on a scale from 1 to 10, ...".
DROP TABLE IF EXISTS scale; CREATE TABLE scale ( id int(10) unsigned NOT NULL AUTO_INCREMENT, code varchar(20) NOT NULL, formula varchar(32) NOT NULL, description varchar(255), PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
table: derivative
A derivative is a set of numbers based on a scale using a map or simple formula. They are generally used as a modifier on a random determination.
DROP TABLE IF EXISTS derivative; CREATE TABLE derivative ( id int(10) unsigned NOT NULL AUTO_INCREMENT, code varchar(20) NOT NULL, scaleId int(10) NOT NULL, formula varchar(32) NOT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
table: noun
A noun is a person, place, and/or thing. These are the central elements of the system. All the other tables deal with measuring and quantifying the items in this table. Specifically, the system defines their features, actions they're capable of performing, and how these elements relate to each other.
DROP TABLE IF EXISTS noun; CREATE TABLE noun ( id int(10) unsigned NOT NULL AUTO_INCREMENT, description varchar(255), PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; DROP TABLE IF EXISTS nounLocation; CREATE TABLE nounLocation ( id int(10) unsigned NOT NULL AUTO_INCREMENT, nounId int(10) unsigned NOT NULL, mapId int(10) unsigned, tileId int(10) unsigned, locationX int(10) unsigned, locationY int(10) unsigned, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
table: nature
Called a "nature" for lack of a better term. This is how the noun gains a qualities and abilities. And it can change the number associated with an attribute or skill.
DROP TABLE IF EXISTS nature; CREATE TABLE nature ( natureCode varchar(20) NOT NULL, description varchar(255) NOT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE natureNoun ( id int(10) unsigned NOT NULL AUTO_INCREMENT, nounId int(10) unsigned NOT NULL, natureCode varchar(20) NOT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; DROP TABLE IF EXISTS naturePrereq; CREATE TABLE naturePrereq ( natureCode varchar(20) NOT NULL, prereq varchar(20) NOT NULL, value int(10), andOr int(1), PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; DROP TABLE IF EXISTS natureAttribute; CREATE TABLE natureAttribute ( natureCode varchar(20) NOT NULL, formula varchar(32), PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; DROP TABLE IF EXISTS natureQuality; CREATE TABLE natureQuality ( natureCode varchar(20) NOT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; DROP TABLE IF EXISTS natureSkill; CREATE TABLE natureSkill ( natureCode varchar(20) NOT NULL, formula varchar(32), PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; DROP TABLE IF EXISTS natureAbility; CREATE TABLE natureAbility ( natureCode varchar(20) NOT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
table: attribute
An attribute in a measurable feature of a noun. That is, these are the things it is or has by some degree.
DROP TABLE IF EXISTS attribute; CREATE TABLE attribute ( attributeCode varchar(20), description varchar(255), PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; DROP TABLE IF EXISTS attributeNoun; CREATE TABLE attributeNoun ( nounId int(10) unsigned NOT NULL, attributeCode varchar(20) NOT NULL, value int(10) NOT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
table: quality
A quality is a non-measurable feature of a noun. That is, it either does or does not contain this quality.
DROP TABLE IF EXISTS quality; CREATE TABLE quality ( id int(10) unsigned NOT NULL AUTO_INCREMENT, code varchar(20), description varchar(255), PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; DROP TABLE IF EXISTS qualityNoun; CREATE TABLE qualityNoun ( nounId int(10) unsigned NOT NULL, qualityCode varchar(20) NOT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
table: skill
A skill is an action performed by a noun that may succeed or fail. Skills are generally based on attributes.
DROP TABLE IF EXISTS skill; CREATE TABLE skill ( id int(10) unsigned NOT NULL AUTO_INCREMENT, code varchar(20), description varchar(255), PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; DROP TABLE IF EXISTS skillNoun; CREATE TABLE skillNoun ( nounId int(10) unsigned NOT NULL, attributeCode varchar(20) NOT NULL, value int(10) NOT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
table: ability
An ability is an action that, statistically speaking, can only succeed. As a working definition, if an action has less than 1% chance of failing, it never fails. Failure can still occur, just not through random determination. Abilities are generally based on qualities.
DROP TABLE IF EXISTS ability; CREATE TABLE ability ( id int(10) unsigned NOT NULL AUTO_INCREMENT, code varchar(20), description varchar(255), PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; DROP TABLE IF EXISTS abilityNoun; CREATE TABLE abilityNoun ( nounId int(10) unsigned NOT NULL, qualityCode varchar(20) NOT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
table: character
DROP TABLE IF EXISTS `character`; CREATE TABLE `character` ( `id` int(10) unsigned NOT NULL auto_increment, `level` int(10) unsigned NOT NULL, `xp` int(10) unsigned NOT NULL, `featsKnown` int(10) unsigned NOT NULL, `atWill` int(10) unsigned NOT NULL, `encounter` int(10) unsigned NOT NULL, `daily` int(10) unsigned NOT NULL, `utility` int(10) unsigned NOT NULL, `trainedSkills` int(10) unsigned NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;