Skip to content

Character System

Vladyslav Vytrykush edited this page Jul 14, 2026 · 1 revision

Character System

The Character System is the foundation of Adventure-Game. Every gameplay mechanic revolves around the player's character, making it one of the most important components of the project.

The Character class stores all information related to the player, including personal details, statistics, equipment, inventory, active effects, and progression. Nearly every other system in the game interacts with the Character object in some way.

This page explains the architecture, attributes, responsibilities, and interactions of the Character System.


Table of Contents


Overview

The Character class represents the player's hero throughout the game.

Rather than acting as a simple data container, it serves as the central object that connects nearly every gameplay system.

The Character is responsible for:

  • Storing player information
  • Managing statistics
  • Equipping weapons and armor
  • Managing inventory access
  • Processing active effects
  • Receiving loot
  • Applying potion effects
  • Calculating total combat statistics

Because every gameplay action affects the player in some way, the Character object acts as the heart of Adventure-Game.


Character Responsibilities

The Character class has several important responsibilities.

Player Information

Stores information describing the player.

  • Name
  • Age
  • Race
  • Profession
  • Description

Statistics

Maintains all gameplay statistics.

  • Health
  • Strength
  • Defense
  • Agility
  • Intelligence
  • Gold
  • Level

Equipment

Tracks currently equipped:

  • Weapon
  • Armor

Equipped items immediately modify the player's combat statistics.


Inventory

The Character owns an instance of the inventory system.

Through the inventory, the player can:

  • Collect loot
  • Equip items
  • Remove items
  • Use potions
  • Manage equipment

Active Effects

Temporary effects are stored inside the Character.

Examples include:

  • Strength buffs
  • Defense buffs
  • Health restoration
  • Intelligence boosts
  • Agility boosts
  • Gold rewards

These effects are processed during gameplay and may temporarily modify player statistics.


Character Attributes

The following table describes the core gameplay attributes.

Attribute Default Value Description
Health 100 Current health points.
Special Health 100 Secondary health value reserved for future mechanics.
Level 1 Character progression level.
Strength 10 Determines physical attack power.
Defense 10 Reduces incoming damage.
Agility 10 Represents speed and mobility.
Intelligence 10 Influences magical or special abilities.
Gold 100 In-game currency used for future gameplay systems.

These values provide a balanced starting point for every newly created character.


Character Information

Every character also stores personal information.

Property Description
Name Player-selected character name.
Age Character age.
Race Character race.
Profession Character class or profession.
Description Short background or flavor text.

These properties personalize the player's hero and provide a foundation for future gameplay mechanics.


Statistics

Character statistics determine how effective the player is during gameplay.

Health

Health represents the amount of damage the player can sustain.

If health reaches zero, future versions of the game may trigger a defeat or game over state.


Strength

Strength determines the player's physical attack power.

Higher values result in increased weapon damage.


Defense

Defense reduces incoming damage.

Armor contributes additional defensive bonuses.


Agility

Agility represents movement speed and reaction time.

Future versions may use this statistic for:

  • Dodge chance
  • Critical hit avoidance
  • Turn order

Intelligence

Intelligence is reserved for future gameplay systems involving:

  • Magic
  • Skills
  • Special abilities

Gold

Gold represents the player's currency.

Future updates may introduce:

  • Shops
  • NPC trading
  • Crafting
  • Item upgrades

Level

The level attribute tracks character progression.

Although leveling mechanics are still evolving, this value provides a foundation for future experience and progression systems.


Equipment

The Character can equip two primary item types.

Weapon

A weapon increases offensive capabilities.

Weapons may provide:

  • Attack
  • Defense bonus
  • Durability
  • Enchantment effects

Only one weapon can be equipped at a time.


Armor

Armor increases defensive capabilities.

Armor provides:

  • Defense
  • Durability
  • Enchantment bonuses

Only one armor piece can be equipped at a time.


Inventory

Each Character owns a personal inventory.

The inventory stores all collected items, including:

  • Weapons
  • Armor
  • Potions

The inventory system supports automatic resizing, allowing the player to continue collecting items without a fixed capacity limit.

For more information, see the Inventory System page.


Active Effects

Temporary gameplay effects are stored as Active Effects.

Supported effect categories include:

Effect Description
Health Restores or modifies health.
Strength Temporarily increases attack power.
Defense Temporarily increases defense.
Agility Improves movement-related attributes.
Intelligence Increases intelligence.
Gold Grants additional currency.

Each effect contains:

  • Effect Type
  • Potency
  • Buff/Debuff status

Effects are processed during gameplay and applied to the Character automatically.


Stat Calculations

Equipment directly influences the player's total combat statistics.

Current calculations are straightforward.

Total Attack

Total Attack = Base Strength + Weapon Attack

Total Defense

Total Defense = Base Defense + Armor Defense + Weapon Defense Bonus

As additional gameplay systems are implemented, these calculations may include skills, buffs, debuffs, enchantments, and other modifiers.


Character Creation

A new Character is created when the player starts a new game.

The creation process includes:

  1. Enter player information.
  2. Choose a race.
  3. Choose a profession.
  4. Set the character's age.
  5. Generate starting statistics.
  6. Generate starting equipment.
  7. Initialize inventory.
  8. Begin the adventure.

The profession influences the type of starting weapon the player receives.


Character Lifecycle

The following diagram illustrates the typical lifecycle of a Character.

flowchart TD

Start --> CharacterCreation

CharacterCreation --> InitializeStats

InitializeStats --> GenerateEquipment

GenerateEquipment --> CreateInventory

CreateInventory --> MainMenu

MainMenu --> Inventory

Inventory --> EquipWeapon

Inventory --> EquipArmor

Inventory --> UsePotion

EquipWeapon --> Character

EquipArmor --> Character

UsePotion --> Character
Loading

Throughout the game, the Character object remains active and coordinates interactions with every gameplay system.


Class Relationships

The Character interacts with nearly every major class.

classDiagram

Character --> MyInventory

Character --> Weapon

Character --> Armory

Character --> Potion

Character --> Chest

MyInventory --> Item

Item <|-- Weapon

Item <|-- Armory

Item <|-- Potion
Loading

This architecture allows gameplay systems to remain modular while sharing a common player object.


Future Improvements

The Character System has been designed for future expansion.

Planned additions include:

  • Experience points
  • Level-up rewards
  • Skill trees
  • Magic system
  • Status ailments
  • Character talents
  • Achievements
  • Reputation system
  • Hunger and stamina mechanics
  • Character customization
  • Additional races
  • Additional professions

The modular design allows these features to be introduced without major changes to the existing Character class.


Summary

The Character System serves as the core of Adventure-Game, connecting all major gameplay systems through a single, central object.

By combining player information, statistics, equipment, inventory management, and active effects into one cohesive class, the project demonstrates key object-oriented programming principles such as encapsulation, modularity, and separation of responsibilities.

As Adventure-Game continues to evolve, the Character class will remain the foundation upon which future gameplay systems—including combat, quests, skills, NPC interactions, and progression mechanics—are built.

Clone this wiki locally