Code Monkey home page Code Monkey logo

ige's Introduction

ige's People

Contributors

arcahub avatar nasso avatar nooverflow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

ige's Issues

Decouple the AudioPlugin interface from OpenAL/libnyquist

Right now, OpenAL/libnyquist pointers and data structures are stored in AudioClip, AudioSource and AudioListener. A better implementation would store this elsewhere to make it easier to change the audio backend in the future.

STL containers are super duper slow

std::unordered_map is a good candidate for optimisations as it is used extensively by the engine. A better implementation would be very beneficial in many cases.

There are too many `std::optional<std::reference_wrapper<...>>`

It forces a ->get() indirection that can get confusing, i.e.:

auto a = app.world().get<SomeResource>()->get().some_value;
auto b = entity.get_component<SomeResource>()->get().some_value;

They are required because std::optional doesn't support reference types.

Possible solutions:

  • Using raw pointers, nullptr indicating the absence of a value.
  • A custom ige::Option wrapper type with special support for references.

A better way to manage groups of entities ("scenes")

Currently, there's no proper way to manipulate an entity tree as a whole. Some mechanism to do so would allow us to:

  • Create and destroy an entity tree all at once
  • Look up entities in a subtree (by component, name, id...)
  • Spawn/instantiate a group of entities (aka "prefabs"?)

Add a proper logging system

Due to the complexity of a game engine, logging is pretty much required to keep track of what's going on. Currently, everything is written directly to the standard outputs using std::cout and std::cerr. A proper logging system would instead allow us to write log messages anywhere (e.g. to a file on disk, send them over the network, or display them in an in-game console).

Most game engines have some way handling logging with various levels of verbosity. The most common levels available are:

  1. Critical error messages
  2. Warning messages
  3. General purpose information
  4. Debugging messages
  5. Trace (very verbose)

These levels are commonly identified by an integer like in the ordered list above. The logger then has routines to filter messages to the ones we are interested in only.

Proposed interface

Setting the current log level should probably be just a function call with an enum value:

using ige::log::LogLevel;

ige::log::set_log_level(LogLevel::DEBUG);

An idiomatic C++ interface for logging messages could look like the following:

ige::log::error << "Error";
ige::log::warn << "Warning" ;
ige::log::info << "Information";
ige::log::debug << "Debug message";
ige::log::trace << "Low level trace that won't be shown";

However, some logging libraries prefer C-style IO for performance reasons.

Either way, effort should be made to be as lazy as possible for disabled log levels. Writing to ige::log::trace should be as light as possible when the current logging level is lower than TRACE.

Some popular logging libraries in the C++ world:

Audio Engine causes a crash on exit

When copied, the AudioEngine object does not move its internal openAL handles causing a crash as they are being double freed on destruction.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.