35
Solving Real-World Data Management Problems

Drupal & Dungeons & Dragons

  • Upload
    phase2

  • View
    3.284

  • Download
    8

Embed Size (px)

DESCRIPTION

This session was an exploration of complex real-world data management issues, and ways to solve them, using D&D as a point of reference for discussion. The presentation was given by Tobby Hagler, Senior Developer at Phase2 Technology at DrupalCamp Atlanta.

Citation preview

Page 1: Drupal & Dungeons & Dragons

Solving Real-World Data Management

Problems

Page 2: Drupal & Dungeons & Dragons

Tobby HaglerSenior Developer

Page 3: Drupal & Dungeons & Dragons

What doesDungeons &

Dragons have to do with Drupal?

Page 4: Drupal & Dungeons & Dragons

Drupal & D&DReal-world data complexity issues

Difficult workflows to manage and codify

Contrib modules – scratch your own itch

Page 5: Drupal & Dungeons & Dragons

D&D Character Module

Complicated forms and character management

Levels, classes, races, feats, skills, weapons, and equipiment – All have unique

properties

No D7 D&D Character sheet module…

Page 6: Drupal & Dungeons & Dragons

D&D Characterand Learning Drupal 7Learning something new with a familiar subject

Solving a “real” need

Features module and Fields API

Page 7: Drupal & Dungeons & Dragons

Learn a new language

“Hello World”

Manipulate user inputDisplay and manipulate input

D&D character generator

Page 8: Drupal & Dungeons & Dragons
Page 9: Drupal & Dungeons & Dragons

D&D DataManagement

PC Information•Race: Special abilities, bonuses and penalties, feats•Class: Extra skills and feats, spells, or limitations•Skills: Cross-class, ranks•Feats: Prerequisites, bonus feats•Attributes: Saves, Initiative, base attack, misc. bonuses

Other Details•Spells: Components, spellcraft feats•Equipment: special attributes, magical abilities, masterwork•Animal Companions: HD, spell-like abilities, morale•NPCs: Abilities, backstory•Campaign Notes: History, geography

Page 10: Drupal & Dungeons & Dragons

Data ManagementProblems to

SolveLots of fieldsManaging fields

Compound Fields

Data OutputPrintable Output

Page 11: Drupal & Dungeons & Dragons

Nodes andStandard Fields

Standard Fields•Name: string•Race: string•Class: string•Attributes: integer, bonuses?•Skills: integer, strings•Feats: string, checkboxes•Weapons: ??

Bonuses and Attributes•Name: fine•Race: fine, but affects things like attribute values•Class: different levels for multiclass•Skills: class vs cross-class (half)•Feats: manage prerequisites•Weapons: damage, speed, crit range – compound fields

Page 12: Drupal & Dungeons & Dragons

Standard FieldsAren't EnoughRegardless of the data type

Fields are always name:value pairs

Fields can contain multiple valuesBut not multiple keys

Page 13: Drupal & Dungeons & Dragons

Multiple Values

Page 14: Drupal & Dungeons & Dragons

Multiple

ValuesVerticalbut not

Horizontaldata depth

Page 15: Drupal & Dungeons & Dragons

D&D FieldsCompanion module to D&D Character

Drupal 7 Fields API

Page 16: Drupal & Dungeons & Dragons

Abilities

Multiple valuesnot enough

Names of eachability score

Multi-dimensional or compound values

Page 17: Drupal & Dungeons & Dragons

Compound

FieldsEach field can have different

widgets

Custom fields for different data types

Page 18: Drupal & Dungeons & Dragons

Fields API in3 Easy Steps

Tell Drupal about the field and schemahook_field_infohook_field_schemahook_field_validatehook_field_is_empty

User Inputhook_field_widget_infohook_field_widget_form

Outputhook_field_formatter_infohook_field_formatter_view

Page 19: Drupal & Dungeons & Dragons
Page 20: Drupal & Dungeons & Dragons

Field Widgets

Armor widget is bothhorizontal and vertical

Page 21: Drupal & Dungeons & Dragons

Field Formatters

Page 22: Drupal & Dungeons & Dragons

Field FormatersMay Not Be Enough

Node templates can workFine for on-screen display

Printing forms for recordsHTML and CSS don’t make great

printouts

Page 23: Drupal & Dungeons & Dragons

D&D Character Sheet

What web output works for print?

PDF is the universalonline print document

Page 24: Drupal & Dungeons & Dragons

PC Record Sheets

Storing data is one thingPrintable character record

sheets is key

Page 25: Drupal & Dungeons & Dragons

Drupal andPDF Output

Node templates generate HTML

Can be styled with CSS and HTML

Print module is closestDoesn’t come nearly close enough

Page 26: Drupal & Dungeons & Dragons
Page 27: Drupal & Dungeons & Dragons
Page 28: Drupal & Dungeons & Dragons

Node Data In PDF

Page 29: Drupal & Dungeons & Dragons

Drupal as a Campaign Manager

Page 30: Drupal & Dungeons & Dragons

CMS: Campaign Management System

Blog Pages for previous runs

Standard Pages for NPCs or historical background

Custom content types for artifacts, animal companions, and kingdoms

Page 31: Drupal & Dungeons & Dragons
Page 32: Drupal & Dungeons & Dragons

SummaryFields API for building compound fields

PDF for specific records

Drupal as a CMS manages extra data

Page 33: Drupal & Dungeons & Dragons

Resourcesagileapproach.com/blog-entry/compound-fields-

drupal-7

drupal.org/project/dnd_character

api.drupal.org/api/examples/field_example--field_example.module/function/

field_example_field_info/7

Page 34: Drupal & Dungeons & Dragons

Questions?

Page 35: Drupal & Dungeons & Dragons

Contactthagler@phase2technology 

@phase2tech

d.o: tobby

Slides: AgileApproach.com