FOnline Engine
Engine currently in semi-usable state due to heavy refactoring
Table of Content
Features
- Isometric graphics (Fallout 1/2/Tactics or Arcanum -like games)
- Supporting of hexagonal and square map tiling
- Prerendered sprites for environment but with possibility of using 3D models for characters
- Engine core written in modern C++ (up to C++20)
- Flexible scripting system with varies supporting languages:
- Native C++ coding
- AngelScript
- Mono C#
- Cross-platform with target platforms:
- Windows
- Linux
- macOS
- iOS
- Android
- Web
- Supporting of following asset file formats:
- Fallout 1/2
- Fallout Tactics
- Arcanum
- FBX (3D characters)
- and common graphics formats like PNG or TGA
Important note: Not all from described above features are already implemented, for additional information look at ‘Work in progress’ section below.
Usage
Engine doesn’t targeting to use directly but by as part (submodule) to your own project (git repo).
Repository contains source code of engine, third-party sources and build tools for composing all this and your stuff into final platform-specific bundles.
You build your game fully from source, there is no prebuilt binaries, full control over the process.
Todo: write about cmake workflow
Public API
Documents related to public API:
Scripting api automaticly generated for each project individually and api described in Scripting API is only basic.
See example of extended scripting api at FOnline TLA Scripting API.
Setup
General steps:
- Create your own project repo and link this repo as submodule
- Setup your own .cmake file with your game configuration
- Use main CMakeLists.txt jointly with your .cmake to build game
Reference project:
- FOnline: The Life After https://github.com/cvet/fonline-tla
Package dependencies
Following Linux packages need to build game for target platforms:
- Common:
clangclang-formatbuild-essentialgitcmakepython3wgetunzip - Building for Linux:
libc++-devlibc++abi-devbinutils-devlibx11-devfreeglut3-devlibssl-devlibevent-devlibxi-devcurl - Building for Web:
nodejsdefault-jre - Building for Android:
openjdk-17-jdk
Build scripts will download and install following packages:
- Emscripten - for building Web apps
- Android NDK - compilation for Android devices
List of tools for Windows operating system (some optional):
- CMake - utility that helps build program from source on any platform for any platform without much pain
- Python - needed for additional game code generation
- Visual Studio 2022 - IDE for Windows
- Build Tools for Visual Studio 2022 - just build tools without full IDE
List of tools for Mac operating system:
Other stuff used in the build pipeline:
SAST tools:
- PVS-Studio - static analyzer for C, C++, C#, and Java code
Statically linked packages
These packages included to this repository, will compile and link statically to our binaries.
They are located in ThirdParty directory (except dotnet, it’s downladed by demand).
- AcmDecoder by Abel - ACM sound format reader
- AngelScript - scripting language
- Asio - networking library
- backward-cpp - stacktrace obtaining
- Catch2 - test framework
- GLM - mathematics library for vectors, matrices and quaternions
- glslang - glsl shaders front-end
- Json - json parser
- SDL - low level access to audio, input and graphics
- small_vector - vector with a small buffer optimization
- SPIRV-Cross - spir-v shaders to other shader languages converter
- tracy - profiler
- Theora - video library
- Vorbis - audio library
- Dear ImGui - gui library
- MongoC Driver - mongo db driver + bson lib
- libogg - audio library
- libpng - png image loader
- LibreSSL - library for network transport security
- rpmalloc - general purpose memory allocator
- ufbx - fbx file format loader
- unordered_dense - fast and densely stored hashmap and hashse
- unqlite - nosql database engine
- websocketpp - websocket asio extension
- zlib - compression library
Footprint
Despite on many third-party libraries that consumed by the whole engine one of the main goal is small final footprint of client output.
Aim to shift most of things of loading specific image/model/sound/ect file formats at pre publishing steps and later use intermediate binary representation for loading resources in runtime as fast as possible and without additional library dependencies.
This process in terms of fonline engine called Baking.
Also as you can see all third-party dependencies linked statically to final executable and this frees up end user from installing additional runtime to play in your game.
Todo: write about memory footprint
Todo: write about network footprint
Tutorial
Please follow these instructions to understand how to use this engine by design:
Work in progress
Roadmap
- FOnline TLA as demo game [done]
- Code refactoring [95%]
- Clean up errors handling (error code based + exception based)
- Preprocessor defines to constants and enums
- Eliminate raw pointers, use raii and smart pointers for control objects lifetime
- Fix all warnings from PVS Studio and other static analyzer tools
- AngelScript scripting layer [done]
- Documentation for public API [10%]
- API freezing and continuing development with it’s backward compatibility [85%]
- Native C++ scripting layer [20%]
- Improve more unit tests and gain code coverage to at least 80% [15%]
- C#/Mono scripting layer [30%]
- DirectX rendering [done]
- Particle system [done]
- Metal rendering for macOS/iOS [1%]
Repository structure
- BuildTools - scripts for automatical build in command line or any ci/cd system
- Resources - resources for build applications but not related to code
- Source - fonline engine specific code
- ThirdParty - external dependencies of engine, included to repository
Frequently Asked Questions
Todo: write FAQ
About
- Site: fonline.ru
- GitHub: github.com/cvet/fonline
- E-Mail: cvet@tut.by