Skip to content

Characters & Classes

Characters are the player entities in TalesMUD. Each character has a race, a class, six core attributes, equipment slots, a skill loadout, and a persistent game state.

Players create characters via the onboarding flow:

  1. Choose a name
  2. Choose a race (affects starting attributes)
  3. Choose a class (determines available skills and primary stats)
  4. Start in the designated starting room

Races modify base attribute values. The race system is data-driven and configurable.

TalesMUD ships with six balanced classes, each with a distinct playstyle and skill set:

ClassPrimary StatResourcePlaystyle
WarriorSTRCooldownsMelee DPS / tanking
RogueDEXCooldownsBurst damage / stealth
RangerDEXCooldownsRanged DPS / utility
MageINTManaSpell DPS / AoE
ClericWISManaHealing / support DPS
DruidINT/WISManaHoT healing / debuffs

Each class scales their basic auto-attack from a different stat:

func (c *Character) GetPrimaryAttackAttribute() string {
switch strings.ToLower(c.Class.ID) {
case "warrior": return "STR"
case "rogue": return "DEX"
case "hunter", "ranger": return "DEX"
case "wizard", "mage": return "INT"
case "cleric": return "WIS"
case "druid": return "INT"
default: return "STR"
}
}

Every character has six attributes. Each attribute has a modifier calculated as (value - 10) / 2.

AttributeShortEffect
StrengthSTRWarrior/melee damage, carrying capacity
DexterityDEXRogue/ranger damage, initiative bonus
ConstitutionCONHit point scaling
IntelligenceINTMage/druid spell power, mana pool
WisdomWISCleric spell power, mana regeneration
CharismaCHANPC interactions, merchant pricing

On each level-up, characters receive distributable attribute points that players can spend using the spend command:

> spend str 2
You spend 2 points on Strength. (STR: 12 → 14)
Remaining points: 1

Max HP is derived from class, level, and CON:

  • Scales with level
  • CON modifier adds a bonus per level

Current HP is tracked separately and reduced by combat damage. HP regenerates out of combat (via the rest command or natural regeneration).

Mana is only available to caster classes (Mage, Cleric, Druid):

func (c *Character) CalculateMaxMana() int32 {
classID := strings.ToLower(c.Class.ID)
switch classID {
case "mage", "wizard", "cleric", "druid":
intMod := c.GetINTMod()
mana := int32(20) + (c.Level * 5) + int32(intMod*4)
if mana < 10 { mana = 10 }
return mana
default:
return 0 // Physical classes don't use mana
}
}

Mana regeneration per combat round:

func (c *Character) CalculateManaRegen() int32 {
regen := int32(1) + int32(c.GetWISMod())
if regen < 1 { regen = 1 }
return regen
}

Non-caster classes use cooldown-based skills instead of mana.

Characters have 13 equipment slots:

SlotKeyDescription
headHeadHelmet, hat, hood
chestChestArmor, robe
legsLegsGreaves, pants
bootsBootsFootwear
handsHandsGloves
neckNeckAmulet, pendant
ring1Ring (left)Ring slot 1
ring2Ring (right)Ring slot 2
main_handMain HandWeapon, wand
off_handOff HandShield, offhand weapon
inventoryInventoryCarried but unequipped
containerContainerBag/backpack
pursePurseCurrency holder

Two-handed weapons occupy both main_hand and off_hand.

equip [item] — Equip an item from inventory
unequip [slot] — Remove item from a slot
equipment / gear — Show all equipped items

Characters can equip up to 4 skills simultaneously. Skills are locked during active combat.

skills — Show all available and equipped skills

Skills are unlocked by class and level. The available skill pool for each class is defined in the skill seed data. See Skills & Spells for the full list.

Characters gain XP from:

  • Combat kills — XP from defeated enemies
  • Quest completion — XP from quest rewards
  • Room discovery — Small XP bonus for entering a room for the first time
  • Area discovery — Bonus for discovering a new zone/area

The leveling curve is defined in pkg/mudserver/game/leveling/ and scales exponentially. On level-up, the character receives distributable attribute points.

Characters persist the following state to SQLite:

FieldDescription
currentHitPoints / maxHitPointsCurrent and max HP
currentMana / maxManaCurrent and max mana (casters only)
xp / levelExperience and current level
goldCurrency held
attributesSix core attributes and distributable points
inventoryAll carried items
equippedItemsCurrently equipped items by slot
equippedSkillsUp to 4 equipped skill IDs
flagsKey/value map for scripting state and puzzle tracking
discoveredRooms / discoveredAreasExplored locations
revealedExitsHidden exits revealed by scripts
boundRoomIdRespawn location (set via bind command)