Copperfield Engine 0.1
C++ Game Engine
Loading...
Searching...
No Matches
Copperfield engine

Copperfield engine is a C++ game engine designed with a strong emphasis on both ease of use and performance. Whether you're a seasoned game developer or just starting your journey in the world of game development, our engine provides a powerful and intuitive platform to bring your creative visions to life.

The engine is Built on the foundation of an Entity Component System, our engine provides a modular and scalable architecture. This design allows for flexible and efficient game development, making it easier to manage and extend your projects as they evolve.

Main Features

Real Time Editor

simple run time editor that allow to modify the properties of the objects on the scene
Editor

Multithread Resource Load

Load models, textures and sound esaily and fast using multithreading

//load
resource_manager.loadResource(
"../assets/textures/box.png",
"Box"
);
resource_manager.WaitResourceLoad();
//retrieval
const Texture& texture = resource_manager.getTexture("Box");
@ kTexture
Texture accepts .png and .jpg.

Resources

Resource load in depth

Blinn-Phong lighting and Shadow Mapping

Efficient directional, Point and Spot lights that cast dynamic shadows
Lighting

Input

Simple action based input system

// create mappings
InputButtonMap input_map{
{"Move", {InputButton::W, InputButton::UP}},
{"Jump", {InputButton::Space}},
{"OpenMenu", {InputButton::Enter}}
};
// usage
InputManager input(window, input_map);
if (input.buttonPressed("Move")) {
// Move up
}
Interface to retrieve keyboard and mouse input.
Definition: input.hpp:180
std::unordered_map< std::string, std::vector< InputButton > > InputButtonMap
Structure that binds user-created actions and physical input.
Definition: input.hpp:175

Input in depth

ECS

allows for custom components and systems providing a simple interface to iterate components

void MoveSystem(ComponentManager& cmp_manager) {
// Retrieve component lists
auto& transform_list = cmp_manager.getSparseList<TransformCmp>();
auto& movement_list = cmp_manager.getComponentList<MovementCmp>();
// Iterate through the components
ComponentIterator it(movement_list, transform_list);
while (it.next()) {
auto [movement_cmp, position_cmp] = it.get();
// Operating with the components
}
}
Helper to iterate several component lists simultaneously.
Definition: lists_iterator.hpp:9
Handles anything related to entities and components in the engine.
Definition: component_manager.hpp:29
ComponentListCompact< T > & getComponentList() const
Retrieves the list of all the components of the same type.
Definition: component_manager.hpp:161
ComponentListSparse< T > & getSparseList() const
Retrieves the list of all the components of the same type.
Definition: component_manager.hpp:178
Component used to give a position, rotation, and scale to an entity.
Definition: default_components.hpp:284

ECS Depth

Collision

Bounding box collision detenction

if (coma::cols::collidesWith(BoxCmp& player, BoxCmp& enemy)) {
// Code on collision
}
bool collidesWith(const BoxCmp &me, const BoxCmp &other)
Detect if the BoxCmp are colliding.
Component used to detect collisions.
Definition: default_components.hpp:337

Collisions in depth

Sound

Simple system to add music and sound effect into your game

// Create the entity
component_manager.addEntity(
nullptr,
AudioCmp("Other", resource_manager.getSound("CivilWar"))
);
// Set the audio to play
auto* audio_cmp = component_manager.getComponent<AudioCmp>(audioPlayer);
audio_cmp->src.Play();
// reproduces the audio
SoundSystem(component_manager);
void SoundSystem(ComponentManager &cmp_manager)
System used for sound reproduction without it the sound cannot be played.
Component used for audio reproduction.
Definition: default_components.hpp:40
SoundSource src
Object used to reproduce the audio.
Definition: default_components.hpp:52

Sound in depth



Getting Started


We have created a visual studio project you can use that will include all the required libraries and the code example achieved on the Tutorials Section

usage instructions

  • Download project: Starter Project
  • Unzip it
  • run setup.bat
  • wait until all dependencies have been downloaded this will take several minutes
  • open build/ with visual studio