dungeons dragons
play

DUNGEONS & DRAGONS As a Drupal project Hacking and slashing our - PowerPoint PPT Presentation

DUNGEONS & DRAGONS As a Drupal project Hacking and slashing our way through real-world content management problems Exploring New Technology With Familiar Problems C/C++ JavaScript and jQuery Perl Drupal 6, 7, 8, Field


  1. DUNGEONS & DRAGONS As a Drupal project Hacking and slashing our way through real-world content management problems

  2. Exploring New Technology With Familiar Problems • C/C++ • JavaScript and jQuery • Perl • Drupal 6, 7, 8, Field API, etc. • PHP LEARNING

  3. BEFORE WE BEGIN

  4. Determine What To Build • Determine the scope • Character sheet as a wireframe • Scores and Data Values •Content and computational models •Content entry •Access control for data modification • Player Characters belong to players (users) • Content entry order

  5. D&D CHARACTER Character stats display - Pull up your character on desktop or tablet for quick IN A NUTSHELL reference Character record sheet - Print out your character record sheet for use at the table Output (put the computers away!)

  6. D&D CHARACTER Character sheet entry - Direct entering of fields IN A NUTSHELL Character generator/wizard - Follow a series of conditional steps Input Some data needs to be entered before other

  7. 1. Character background and motivation 2. Select race ORDER OF 3. Class and levels 4. Enter (roll or purchase) ability scores DATA ENTRY 5. Pick a background 6. Update racial characteristics 7. Update class details Option 1: Node Edit Form 8. Purchase equipment 9. Choose skills 10. Select alignment and finalize details

  8. Step 1 ORDER OF • Roll the dice: Best 3 of 4d6 or point buy • Assign rolls to abilities DATA ENTRY • Choose a race • Pick gender, background, and other role- playing traits that would influence who Option 2: Webform this character is • What is the total level? • Alignment, limited by class

  9. Step 2 ORDER OF • Pick class or classes by level • Class restrictions or limitations based on DATA ENTRY ability scores and race Step 3 Option 2: Webform • Update high-level attributes • Additional ability scores • Add new skills and feats

  10. Step 4 Add class-specific abilities ORDER OF • Spells, familiars, meta-magic, and patrons • Weapon proficiencies and fighting styles DATA ENTRY • Turning undead and healing • Wild shape, favored enemies, and animal companions Option 2: Webform Step 5 Assign skills and knowledge areas Languages

  11. Step 6 Roll hit points based on hit die, Constitution ORDER OF bonus, and level(s) DATA ENTRY Step 7 Option 2: Webform Determine money and purchase equipment Some equipment will be unavailable Appearance, description and all the other details Name your new character!

  12. CONTENT AND COMPUTATIONAL MODELS

  13. Character Stats The basics of a character’s statistics • Race are, at the heart, just a collection of • Class and Level raw data and field values. • Ability Scores Users select what they want from a • Alignment finite list, but the combination of these values creates a fundamentally • Equipment, Weapons, and Armor unique character that should be • Description and Backstory memorable and fun to play.

  14. Character Stats • Racial Modifiers and Traits Content is more than just fields, and a Character is more than just data • Class Skills and Hit Die points. • Ability Modifiers, Skills, and Saving Determine your relational model and Throws you will see how values affect each • Limits Class other . Race affects abilities. Class determines skills and other attributes. • AC, THAC0, Damage, and other effects Even background and character description ultimately affect choices • Affects how the DM creates story surrounding equipment, which hooks, adventure ideas, and how impacts AC, etc… NPCs react to your character

  15. AT FIRST GLANCE •A D&D Character is a standard node Analyzing The •A custom content type, “D&D Character” D&D Character •Ability Scores are an array of small integers •Range limited to 3-18 Content Model •Hit Points, Hit Die, and Armor Class are just integers •Class, Race, and Alignment are text values from a select list

  16. A DEEPER DIVE INTO THE UNDERDARK •Abilities provide bonuses and are computed. Analyzing The •Class and Level changes Hit Die, Potions and curses alter D&D Character Hit Points, and spells and armor enhance Armor Class. Content Model •Each Race or Class can affect other PC attributes in a variety of ways, such as Ability score bonus/penalty and additional skills or spells. •A node seems fine, but we need a way to handle overrides; Node plugin?

  17. Atomic Design and Data Models 1. Atoms 4. Templates 2. Molecules 5. Pages 3. Organism DATA DESIGN

  18. FIELDS, ENTITIES, AND RELATIONSHIPS

  19. Polymorphing Fields Compound Fields • Many fields on a PC node would have compound values Like a recipe has ingredients, and each ingredient has sub-values: name, • Race is a string from a list quantity, description, metric or • Ability is 6 values, each with imperial measurements. modifiers and bonuses Addresses have a number, street, • Feats and Skills have names, secondary street, city, state or descriptions, game details… province, ZIP or postal code, and • For your project, Drupal core fields country; which determines if other won’t cut it, and there’s no contrib sub-values may be present or project… changed .

  20. Ability Scores Ability bonuses are easy to calculate, Ability Scores no need to have a lookup table: • Strength Bonus = floor( (BaseScore / 2) - 5) ) • Dexterity • Constitution • 3 (-4) • Intelligence • 4-5 (-3) • Wisdom • 6-7 (-2) • Charisma • 8-9 (-1) • 10-11 (no bonus) Base score modified by race, higher • 12-13 (+1) level, and temporary effects. • 14-15 (+2) Include an ability bonus for • 16-17 (+3) exceptionally high or low scores. • 18 (+4)

  21. More Compound Fields Class Skills • Level (of each class) • Name • Leveling up is based on effective • Ranks level • Class skill • Ability modifier • Description

  22. More Compound Fields Feat Feat Effects include: • Name • Ability score bonus • Description • Initiative • Effects • Advantages to a variety of rolls • Proficiencies with equipment (think: permissions) • Other in-game modifiers that don’t affect the content here

  23. DIFFERENT SOLUTIONS TO THE SAME PROBLEM Paragraphs Compound A contrib module that lets us combine mixed field types into a single field. We can place a paragraph as a single Fields field on a content type. Webform Create a complex form in a UI. The form can be single-page or a multi-step form. We can create custom submit methods to handle the user form submission. Exports to YAML. Field API Create custom fields and field widgets.

  24. INPUT OPTIONS

  25. Compound Ability Scores • Choose a race • Feats and other skills • Base score • Level bonus • Race bonus/penalty • Total score and modifier PARAGRAPHS

  26. Conditional Multi-Step Forms • Create a page for each step • Conditionally show/hide fields based on previous • Nest elements within each selections page WEBFORM

  27. Creating Custom Field Types • Create a field type • Create a custom field widget • Create a field formatter FIELD API

  28. EXAMPLES OF COMPUTATIONAL MODEL

  29. Skills, Spells, And Equipment Money and Background Class features • Roll wealth based on class • Different types of spells • Choosing backgrounds may change • Skill ranks and class and cross-class starting wealth and initial skills skills Calculating Armor Class Racial bonuses • Armor and magic items • Change ability scores • Ability modifiers • Additional skills, language, or traits • Spell effects

  30. Conditions May Apply Conditional content entry for each How much to program, how much to class or race rely on editorial input? • Node edit form validation/ submission tricks • Webform wizards and Conditional Required fields for some classes but Logic not others

  31. PULLING IT ALL TOGETHER

  32. VIEWING A NODE PAGE Node template for Character Node Output • node—dnd-character.html.twig CSS added as a library • D&D_character.dnd_character_fields • dnd_character.dnd_character_node

  33. PRINTING A D&D CHARACTER RECORD SHEET Modules (many in early development) Printable • Entity Print • Uses WKHTMLtoPDF Character • FillPDF Sheets • Can use an existing fillable PDF • Printable and PDF generator API Other options • WK HTML to PDF library and custom code

  34. D&D Character content type FINAL Collection of Paragraph fields PROJECT Some custom UI work Printable character sheets (PDF)

  35. QUESTIONS? IDEAS?

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend