-
Notifications
You must be signed in to change notification settings - Fork 0
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.
- Overview
- Character Responsibilities
- Character Attributes
- Character Information
- Statistics
- Equipment
- Inventory
- Active Effects
- Stat Calculations
- Character Creation
- Class Relationships
- Future Improvements
- Summary
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.
The Character class has several important responsibilities.
Stores information describing the player.
- Name
- Age
- Race
- Profession
- Description
Maintains all gameplay statistics.
- Health
- Strength
- Defense
- Agility
- Intelligence
- Gold
- Level
Tracks currently equipped:
- Weapon
- Armor
Equipped items immediately modify the player's combat statistics.
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
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.
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.
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.
Character statistics determine how effective the player is during gameplay.
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 determines the player's physical attack power.
Higher values result in increased weapon damage.
Defense reduces incoming damage.
Armor contributes additional defensive bonuses.
Agility represents movement speed and reaction time.
Future versions may use this statistic for:
- Dodge chance
- Critical hit avoidance
- Turn order
Intelligence is reserved for future gameplay systems involving:
- Magic
- Skills
- Special abilities
Gold represents the player's currency.
Future updates may introduce:
- Shops
- NPC trading
- Crafting
- Item upgrades
The level attribute tracks character progression.
Although leveling mechanics are still evolving, this value provides a foundation for future experience and progression systems.
The Character can equip two primary item types.
A weapon increases offensive capabilities.
Weapons may provide:
- Attack
- Defense bonus
- Durability
- Enchantment effects
Only one weapon can be equipped at a time.
Armor increases defensive capabilities.
Armor provides:
- Defense
- Durability
- Enchantment bonuses
Only one armor piece can be equipped at a time.
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.
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.
Equipment directly influences the player's total combat statistics.
Current calculations are straightforward.
Total Attack = Base Strength + Weapon Attack
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.
A new Character is created when the player starts a new game.
The creation process includes:
- Enter player information.
- Choose a race.
- Choose a profession.
- Set the character's age.
- Generate starting statistics.
- Generate starting equipment.
- Initialize inventory.
- Begin the adventure.
The profession influences the type of starting weapon the player receives.
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
Throughout the game, the Character object remains active and coordinates interactions with every gameplay system.
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
This architecture allows gameplay systems to remain modular while sharing a common player object.
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.
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.