With the Hackathon less than a day away, I’ve been gathering my thoughts for my project. I’ve set the following goals for the weekend:

1) Nail down the character, items, NPCs, areas and basic mechanics such as accessing inventory, exploring a room, combat, conversation, levelling up and so forth. Mechanics will be governed by functions and may be simplified further if required.
2) Build a simple, linear game using each major element and mechanic at least once.
3) Build a web interface over the game.
4) Playtest.
5) Expand game, if enough time remains.

I think this is realistic, but I’ll have to see how well it works out. I have no way of knowing who I’ll be working with, or if my project is even going to attract the interest of potential team members.

For posterity’s sake, here’s the rough outline of how I want the game to work (fair warning, this is a bit of an infodump):

* based on simplified D&D Essentials (an already simplified version of 4E) with an interface similar to classic text adventures (ex: Zork, Hitchhiker’s Guide)
* single-player (no parties)
    * this iteration will not include customization for species, class or gender
* dungeon crawl
* game actions will include
    * move (from map area to map area)
    * explore (learn about and react to environment)
    * combat
        * fight enemies
        * attempt to flee
    * talk to non-hostile NPCs
    * pick up items
    * use items
    * view inventory and character sheet
* a save game feature should be available, loading a player’s character and choices into an array to access later.
* combat will be statistics-based rather than an automatic succeed or fail based on choice of approach.
    * Stats will be weighed based on a simulated dice roll plus the player’s attack modifier versus the opponent’s defense rating (armour class, generally).
    * Whichever has the higher number, player or opponent, determines outcome.
        * Player low: attack fails
        * Player high: attack succeeds. Player’s weapon modifier and/or ‘dice’ determines damage. (ex: a sword might have a modifier of +1, plus the outcome of rolling a d8)
        * Damage is decremented from the opponent’s HP
    * Turns pass back and forth between player and opponent until one reaches 0HP. If opponent, its isAlive variable is updated to false.
* enemies will be preset, but encounters will not be random
* NPCs and creatures will not be universally and automatically hostile. Some will attempt conversation, some will wait for the player to take an action and react accordingly, some will attack on sight.
* Creatures may have certain behaviour according to species. Ex:
    * Human or human-like NPCs are likely to attempt conversation or wait for player actions to react.
    * Creatures may attack or flee.
* Each area of the dungeon may have unique characteristics that players can interact with, discoverable when players take certain actions (“look up”, “examine chest”, etc.). Everything should be both discoverable and possible for the careless player to miss.
* Players are a blank slate to start, with basic stats and equipment
* Players should be able to level up their stats based on
    * combat (XP)
    * predetermined conversational or exploratory actions (XP)
    * discovering or earning unique items (increment one stat of their choice)
* ALTERNATELY, player stats do not increase. Instead, they improve their combat readiness and skills by finding and swapping out items.
* Players, NPCs/creatures, equippable items, environmental items and dungeon areas are each written as objects.
* Interactions, exploration, conversations and so forth are handled with functions.
* Outcomes (such as conversations, picking up items or combat) are stored within the relevant object.
* The dungeon will be simple at first (each area only leads to one other area)

I’ve also roughed out some JS objects for a few key elements.

var playerChar = {
    //increments when characters cross preset XP thresholds; used to increment stats, HP, AC and attack_modifier
    level: 1,
    //hit points; can be incremented by levelling or discovering items
    HP: 20,
    //experience points; incremented by successfully completing combat AND non-combat encounters (puzzles, persuasion opportunities, etc.); this key should be tied to a function to govern levelling up.
    XP: 0,
    //armour class; governs how easy the character is to hit in combat
    AC: 8,
    //base speed of the character; governs attempts to escape combat encounters
    speed: 6,    
    //calculated by level and strength; governs the success of a player’s attack in combat when added to an attack roll
    attack_modifier: 1,
    //core stats; these impact action outcomes and can be incremented by passing preset HP thresholds or finding items that ++ a single stat. It may be better to group these into their own array.
    dexterity: 8,
    strength: 8,
    constitution: 8,
    intelligence: 8,
    wisdom: 8,
    charisma: 8
    //weapons, armour; these will be objects in their own right. Should be stored in an array instead of as separate keys.
    head: “helmet”,
    armour: “hide”,
    feet: “boots”,
    waist: “belt”
    hand1: “ring”,
    hand2: null,
    weapon: “broadsword”,
    inventory: inventoryList //array
    outcomes: outcomesList //array for encounter outcomes

var area1 = {
//I will likely substitute up, down, north, south, east and west in development.
    description: “A low-roofed cave with loose stones on the FLOOR. It slopes away from you, continuing AHEAD downward. The shadows are deepest on the RIGHT, with a mineral gleam in their depths when your lamp flickers just so. Cave crickets and harvesters cling to the walls, while the ground has fresh marks suggesting something else has passed this way recently. n You hear a scratching emanating from the depths.”,
    floor: “Loose stones ranging from fist-sized to sand. A JAGGED OBJECT is caught between the stones.”,
    roof: “You knock your head on a particularly low spot and bite your tongue. The stuff of heroic ballads, right here.”,
    right: “You peer into the shadows, looking for the source of the gleam. Something small and scurrying flees your light in a shower of pebbles. You find nothing; it must have been a trick of the light.”,
    left: “The cool, rough rock hosts a variety of insects.”,
    ahead: “A chill breeze blows from the depths, carrying a faint odour of burning pitch. You hear a scratching.”,
    behind: “A greenish light filters in from the cave entrance. You savour it; this is the last daylight or greenery you will see until your task is completed.”,
    jagged_object: “You pick up the jagged thing and immediately wish you hadn’t. It is a mummified hand with the flesh partially gnawed off and broken bone protruding from truncated fingers. A RING clatters to the stones.”,
    mummy_ring: “It’s an iron ring with what looks like a crest stamped into it. The design is badly scratched and beginning to rust, but you think it’s the town council’s crest of nearby Valleydeep. Missing citizens indeed.”

var helmet = {
    //helmet AC modifies player’s AC while equipped
    AC: 2,
    //a special characteristic, such as modifying a player’s stats (for good or ill) or enabling a new kind of attack
    properties: null

var cavebear = {
//build parallels player’s
    HP: 80,
    AC: 17,
    speed: 8,
    strength: 20,
    constitution: 20,
    dexterity: 13,
    intelligence: 2,
    wisdom: 13,
    charisma: 12,
    weapon: “claws”, //likely an item array
    //XP the player gains for killing this creature
    isDead: false, //this attribute may be affiliated with HP instead, as it will need a function related to HP to govern switching this from false to true.
    XP_on_death: 20