Technical Specification: Character Creation System - wwestlake/Labyrinth GitHub Wiki

Technical Specification: Character Creation System

Overview

This document outlines the design and implementation of a comprehensive character creation system for the Labyrinth game. The process involves selecting a race and character class, generating initial characteristics and bonus points, allowing customization by the player, and providing options for image uploads, descriptions, and AI-generated biographies. The system is designed to be flexible, using configurable data and algorithms, and enhancing the player experience through both guided and random elements.

1. Character Creation Workflow

1.1 Race and Class Selection

  • Description: The first step in the character creation process is selecting a race and character class. These choices will influence the character's base stats, available abilities, and potential playstyle.
  • Race Selection: Players choose from a list of available races, each with unique stat modifiers, racial abilities, and traits.
  • Class Selection: Players select a class that defines their character's role in the game (e.g., Warrior, Mage, Rogue). Each class will have specific stat priorities, abilities, and starting gear.

1.2 Random Generation of Characteristics

  • Description: After selecting a race and class, the system will randomly generate the character's initial characteristics, including stats and bonus points.
  • Stat Generation:
    • The system will use configurable data and algorithms to generate the base stats for the character, factoring in the selected race and class.
    • The algorithms for generating stats can be customized via configuration settings, allowing for linear, exponential, or other forms of stat distribution.
  • Bonus Points:
    • Bonus points will be generated using a variable system, with a base number of points plus a random number within a predefined range.
    • The number of bonus points and the range of randomization will be configurable, allowing for adjustments based on game balance and difficulty.

1.3 Presentation of Initial Character to the User

  • Description: Once the characteristics and bonus points are generated, they are presented to the player via the UI.
  • UI Display:
    • The UI will show the player the initial stats, bonus points, race, and class, allowing them to review and make adjustments.
    • Players will see a breakdown of how their selected race and class have influenced their character's stats.

1.4 Customization by the Player

  • Spending Bonus Points:

    • Players can allocate their bonus points to improve specific stats according to their preferences.
    • The UI will provide controls for allocating points, with real-time updates to the character's stats.
  • Image Upload or Selection:

    • Players can upload a custom image to represent their character or choose from a set of predefined images.
    • The image selected or uploaded will be associated with the character and displayed in relevant parts of the game.
  • Writing Descriptive Text:

    • Players can enter a custom biography or description for their character, adding depth and personality to their in-game avatar.
    • The UI will provide a text editor for players to write and format their character’s description.

1.5 AI-Generated Biography Option

  • AI-Generated Biography:

    • Players can opt for the server to generate a random biography for their character, using AI to create a unique and immersive backstory.
    • The AI may request additional information from the player, such as the character’s preferred weapon, alignment, or significant life events, to enhance the biography's relevance and depth.
  • Additional Input Requests:

    • If the AI requires more details to generate a compelling backstory, it may prompt the player to provide input on specific aspects of their character’s life, such as childhood experiences, key relationships, or personal goals.

1.6 Finalization

  • Review and Confirmation:

    • Players will have the opportunity to review all aspects of their character, including stats, bonus point allocation, image, and biography.
    • The UI will present a summary screen where players can make final adjustments before confirming their character.
  • Confirmation and Creation:

    • Once confirmed, the character will be created and saved in the database.
    • The system will store all character data, including the final stat values, selected image, and biography, ensuring persistence across game sessions.

2. Configurable Settings and Algorithms

2.1 Stat Generation Algorithms

  • Description: The system will support multiple algorithms for generating character stats, configurable via the server.
  • Options:
    • Linear Distribution: Stats are distributed evenly within a specified range.
    • Exponential Distribution: Certain stats are favored, growing faster based on class or race.
    • Custom Algorithms: The server can be configured to use specific algorithms or rulesets that suit the game’s design philosophy.

2.2 Bonus Point Allocation

  • Variable Points: The number of bonus points awarded on level-up will be variable, with both a base value and a random component.
  • Random Constraints: The range for random bonus points will be configurable, allowing for adjustments based on balance considerations.

2.3 AI Biography Generation

  • AI Input: The AI will be configured to generate biographies based on both pre-defined templates and player-provided input.
  • Configurable Parameters: The AI can be tuned using configurable settings, determining how much weight is given to different aspects of the character’s background.

3. Player Experience and Interaction

3.1 User Interface

  • Interactive UI: The character creation process will be highly interactive, with the UI guiding the player through each step.
  • Feedback and Validation: Real-time feedback will be provided as players make choices, with validation to ensure that all necessary steps are completed.

3.2 Flexibility and Options

  • Customization vs. Randomization: Players will have the flexibility to either deeply customize their character or rely on random generation for a more spontaneous experience.
  • Accessible and Engaging: The system will cater to both experienced players seeking detailed customization and newcomers looking for a quick and engaging character creation process.

4. Data Persistence and Management

4.1 MongoDB Integration

  • Data Storage: All character data, including the CharacterConfig, will be stored in MongoDB, allowing for easy updates and management.
  • Configurable and Dynamic: The system will retrieve configuration settings dynamically from the database, ensuring that any changes made by administrators are reflected immediately in the character creation process.

4.2 Audit and Logs

  • Character Creation Logs: The system will log each step of the character creation process, enabling administrators to audit and review how characters are being created.
  • Configuration Changes: Any changes to the CharacterConfig will be logged to ensure transparency and accountability.

5. Extensibility and Future Enhancements

5.1 Additional Races and Classes

  • The system is designed to easily accommodate new races and classes, with minimal changes required to the core architecture.

5.2 Expanded AI Capabilities

  • Future updates may include more sophisticated AI for biography generation, including the ability to generate dynamic and evolving backstories based on in-game events.

5.3 Advanced Customization Options

  • Potential enhancements include the ability to customize character animations, voice, and other aesthetic aspects, further enriching the player’s connection to their character.

5.4 Multiplayer and Social Features

  • Consideration for adding multiplayer-specific customization options, such as guild affiliations or shared backstory elements, to enhance the social dynamics of the game.

6. Conclusion

The character creation system for Labyrinth is designed to be flexible, interactive, and player-centric, offering a balance of customization and random generation. By leveraging configurable settings and AI-driven content generation, the system aims to create a unique and engaging experience for every player, ensuring that each character feels truly personal and integral to the game’s narrative.