Engine System Proposal

Posted by Caroline飘小蝎 on October 25, 2024

The player input system will be a core part of the game engine, allowing other developers to efficiently manage player actions and controls for their games. Here’s how it will work:

Overview and Features

The input system will manage input events and state tracking for keyboard and mouse. It will support:

  1. Input Mapping: Define specific inputs (e.g., WASD, arrow keys) that control character movement or other game actions.
  2. Customizable Actions: Assign game-specific actions to inputs, such as Jump, Shoot, or Interact.
  3. Real-time and Press/Release Events: Distinguish between actions triggered by holding a button vs. tapping.
  4. Input Sensitivity and Dead Zones: Customize sensitivity for smoother control (e.g., analog stick sensitivity or mouse movement).

Usage for Final Project Games

To set up the input system, you would:

  • Create a Data File: Define the actions you need and map each action to a specific input. This might look like a JSON or XML file where each key (or button) corresponds to an in-game action.
  • Use the Public Interfaces: The system would offer classes like InputManager and InputAction that manage key bindings and check the current input state. You’d initialize InputManager, load your input data, and then use methods like IsActionPressed("Jump") to query actions during gameplay.

Implementation Plans

I plan to:

  • Set up Input Bindings: Design structures to define and store input mappings, and initialize mappings from data files.
  • Implement State Tracking: Keep track of which keys are pressed, released, or held, and provide API calls to query these states.
  • Create a Configurable Interface: Make it easy to change key bindings without altering code, using data-driven files.

Anticipated Challenges and Stretch Goals

  • Event Precision Management: Ensuring key press, release, and hold events are processed accurately without delay.
  • Handling Key Conflicts: Managing instances when multiple keys are pressed simultaneously, ensuring no unexpected actions or conflicts arise.
  • Flexible Key Binding: Providing an easy-to-use data format for users to customize key bindings and supporting dynamic reloading and updating of input configurations.