Upsides and Downsides

This page contains a list of upsides and downsides of the project regarding on the choices made during the development. It is not a definitive list, and it is subject to change as the project evolves.

Resource Management

Case Study

  • our own implementation

  • incbin + our own implementation (this is what we chose)

Upsides

  • Integrates pretty much seamlessly with the build system and the source code.

  • Ability to modify the assets in Debug mode without rebuilding the project.

  • Once compiled in Release mode, everything is embedded in the executable, making it easier to distribute the game.

  • The assets are loaded in memory in a single contiguous block, making it easier to manage and unload them.

  • Assets are represented intuitively as BBOC::Resource objects.

Downsides

  • Poor support of the MSVC compiler, as it requires a separate pass to generate a res.c file representing all of the assets. G++ and Clang do not have this issue as they natively support the .incbin assembly directive.

  • End users will have a harder time modifying the assets and modding the game with a Release build, as these elements are embedded in the executable.

Networking

Case Study

  • own implementation of a wrapper around the C socket API

  • asio (without boost) (this is what we chose)

  • enet

Upsides

  • The networking system makes it very simple to serialize primitive data types transparently to the programmer.

  • The networking system is sturdy enough to handle harsh conditions, such as packet loss and out-of-order packets.

  • The networking system is designed for C++ and relies mostly on compile-time logic to reduce runtime overhead.

  • As we’re using bson for serialization, we can easily create a client for other languages, such as Python, Java, and C#.

  • We’re using asio, which is a header-only library, making it easier to integrate with the project.

  • Asio is a modern C++ library that is straightforward to use and understand, and it is a cross-platform library.

Downsides

  • We can only serialize primitive data types, such as int, float, double, bool, std::string, std::array, std::vector, and std::map.

  • There are no interpolation or extrapolation mechanisms in place to predict the movement of entities.

Physics

Upsides

  • The use of velocity to predict movements.

  • Multithreaded physics simulation.

Downsides

  • The physics simulation is not deterministic, as it relies on floating-point arithmetic.

  • The collision calculations are expensive due to O(n^2) complexity.

Scripting

Case Study

  • Lua

  • Luau

  • Python

  • JavaScript

Upsides

  • We’re using Luau as the scripting language, which is a high-level language that is easy to learn and use.

  • Typed Lua allows us to have a more robust codebase.

  • Simple, faster and nearly as simple as Python.

  • Can be used as Lua, but with more features.

Downsides

  • The scripting system is not as powerful as Python or JavaScript.