Fyse Engine
A C++ Game Engine
Introduction
The name is currently "Fyse Engine" is an in-house game engine, created for teaching children how to make video games from scratch. We aimed to make it easier for developers to just skip the linker and additionally include directories. Since this engine is directed to a children consumer audience who seeks the challenge of learning C++ but lack the hardware for Unreal Engine's requirements. Everything we do in this engine to design choices and structures is to ensure that even children can easily program in C++.
What does it offer?
Most of the features and syntax of Fyse Engine are meant for ease and simplicity, since the audience of Fyse Engine is for children, as an introduction into C++. All features were designed with so many workarounds and fail safes to ensure ease for the children developing their games on!! There is a build in math library that covers Vector and Matrix math, alongside euler rotations!! An automatic texture loader (that can be disabled) to load in all the textures inside a given directory. Many features will be covered within this "Features" segment...
Features
A few features have already been included in the engine, such as Textures, GameObjects, Components, Scenes, Physics, and more! Though, there are still many features that are still in development. It is a primary learning experience for me to create a game engine from scratch, but I do plan on making it a professional game engine. I will be adding more features to the engine, such as serialization/deserialization of the engine's worlds and GameObjects. Editor GUI's, and also a UI/UX toolkit for the engine so that developers can create their own UI's for their games.
- // Initializing Engine Configurations
- EngineConfig* NewConfig = new EngineConfig();
- NewConfig->WindowTitle = "Random Game";
- NewConfig->MSAACount = MSAA_X0;
- NewConfig->FullscreenMode = Windowed;
- NewConfig->WindowWidth = 1280;
- NewConfig->WindowHeight = 720;
- NewConfig->RefreshRate = 165;
- NewConfig->BackgroundColor = { 0, 1, 0, 0 };
- // Turning on some features (Optional)
- // Shows an outline of the Colliders to debug and visualize
- NewConfig.ShowColliders = true;
- // Turn off the world grid
- NewConfig.ShowWorldGrid = false;
- // Utilize the Alpha Channel in loaded textures in render passes
- NewConfig.EnableTransparency = true;
- // Enable/Disable if the engine should load in textures from a directory.
- NewConfig.AutoLoadTextures = true;
- // Creating Fyse Engine Instance
- // Fyse Engine does not require an EngineConfig argument
- Engine* VulkanInstance = new Engine(&NewConfig);
Some Examples
Creation and GameObject and Components in Fyse Engine are straightforward. I wanted a clean, simple syntax for the engine, so I made sure that the engine was easy to use. Since it's an introduction for children to get into C++, known as a challenging language to learn, especially for children.
- // Creating GameObjects and Components
- int main() {
- Engine* VulkanInstance = new Engine();
- GameWorld* World = VulkanInstance->GetWorld();
- // GetTexture(): Retrieves textures loaded on VRAM
- Texture* T_Viking = VulkanInstance->GetTexture("T_Viking");
- // Instantiate(): Crates a GameObject in the world and returns a pointer to it
- GameObject* Viking = World->Instantiate("Viking");
- // AddComponent(): Adds a component of the type to the GameObject and returns a pointer to it
- StaticMesh* SM_Viking = Viking->AddComponent<StaticMesh>();
- SM_Viking->SetTexture(T_Viking);
- SM_Viking->LoadAsset("Viking.obj");
- . . .
- }
Built-In Features (Math, Physics, etc)
Math Library
Fyse Engine has a built-in math library that covers Vector and Matrix math, alongside euler rotations!! It is a simple and easy-to-use math library meant for ease and simplicity, since the audience of Fyse Engine is for children. Pre-written documentation is available in the code itself, allowing a quick understanding of the library.
- // Multiple ways to access data from Vectors
- Vector3 A = { 124, 300, 290 };
- std::cout << A[0] << std::endl; // 124
- std::cout << A.X << std::endl; // 124
- // And also for Matrices
- // Matrices are written in Row-Major
- Matrix3x3 A = {
- { 1, 2, 3 },
- { 4, 5, 6 },
- { 7, 8, 9 }
- }
- // Accessing B's first row, second element
- std::cout << B[0][1] << std::endl;
- std::cout << B[0].Y << std::endl;
Built-In Physics Library
Alongside the built-in math library, I have also created a Physics Engine inside the game engine. This was a challenge of its own. Reading and reviewing white papers on rigid bodies and collisions. Translating this knowledge into code and making it easy for children to use.
How do I incorporate physics into my generic tick efficiently? Should I include angular velocities on bodies? Should these be Components for easy implementation or just a part of the GameObject's themselves?
Being able to use Rigidbodies and Collisions just requires you to add these components to a GameObject and tada!! Though it's not a lot, Physics Objects can collide with each other, and there are some settings in the configurations for preferred performance. SolveCollisionWithRotations is a variable in the configuration that enables/disables this feature. This allows the physics engine to rotate bodies that interact with each other and if they should cause rotations, if this setting is off, then it does not take the extra calculations to apply these forces.
Even with every RigidBody component being able to freeze their rotations, if this setting is disabled, it won't apply any rotational forces.
- // Enabling/Disabling this feature
- EngineConfig* NewConfig = new EngineConfig();
- NewConfig->WindowTitle = "Random Game";
- // . . .
- // This setting impacts the Physics Engine
- NewConfig->SolveCollisionsWithRotations = true;
So Far In Development...
There is little to show visually since I'm still working on the engine. And in total, the engine only comes up to a bit over 10,000 lines of code. With nothing much to show, I can show a few technical things.
Right now in development, I am currently making the UI for the editor interface. With an inspector, hierarchy, console and much more. Something to also keep in mind is that I am designing this for children, so right now the UI is just functionally working. But soon I'm aiming to make it a simple icon-based interface. Just quick actions for kids to easily navigate and associate actions with icons.
Challenges
Developing in C++ comes with complexity. Ensuring the syntax and API are child-friendly required countless iterations. Since Simplicity brings Complexity, I had to make sure that the engine was easy to use, especially for children.
Upcoming Features
There are some features that are still in development, such as serialization/deserialization of the engine's worlds and GameObjects. The list of features is as follows:
- Sounds
- Engine GUI Toolkit
- UI/UX Toolkit
- Compute Shaders
- Lighting and Shadows
- And Much More