athanggupte / apexgameengine Goto Github PK
View Code? Open in Web Editor NEWApex Game Engine
License: MIT License
Apex Game Engine
License: MIT License
Implement the game runtime which can "Play" the game:
Also need an editor "play" button which can start the game runtime inside the editor itself.
Implement custom macros with RTTR to automatically -
Post feedback here
Problem: Since resources can be added to the ResourceManager via scripts, stopping and playing the scene results in a failing assertion as the scripts attempt to add the same resource to the registry again.
Proposed mechanism:
OnScenePlay
: Create a snapshot of the current state of the ResourceManager and save it for later use and then continue with scene->OnPlay()
.OnSceneStop
: Load the snapshot created during OnScenePlay
to get delete all resources added via user scripts from the registry and their references from the pools. The reference counting in the shared_ptrs should delete the data from memory and thus automate garbage collection.Possible enhancement to consider:
(Memory vs load time)
For scripts which add a lot of resources during creeation, the delay due to load time may be noticeable for several consecutive runs. Thus, instead of deleting the resources from the RM inside OnSceneStop
, another snapshot can be created and cached for the next run. Then the references from this cached snapshot can be copied to the pools during LoadAllResources
rather than creating or loading the resources from disk again.
Pros:
Cons:
The current implementation of the OpenGL Buffer creation mechanism involves a diamond inherence from the OpenGL{XYZ}Buffer
classes to the Buffer
base class through the {XYZ}Buffer
abstract class and the OpenGLBuffer
abstract class.
This is not only a bad design strategy but can also slow down the code in the long run when a lot of buffers are built and managed.
Redesigning the entire Buffer class hierarchy and the creation pipeline is highly advisable.
Methods to consider:
OpenGLBufferFactory
which can create the different OpenGL{XYZ}Buffer
classes which can avoid the diamond hierarchy and also reduce code repetition.FBX has a few problems -
glTF 2.0 was designed to overcome all these problems and is also quite performant and easier to load at runtimes.
We'll allow designers to load assets in FBX format in the editor but then store them as gltf binaries in a build sub-directory which will be used by the engine and also shipped with the finished game. Using a checksum/hash we can reload the glTF from the FBX whenever there is a change in the FBX file.
Currently, the ImGui library is directly linked to the engine code and is thus a hard dependency of the engine. That means even in the runtime we will be forced to include the binaries of ImGui.
We should move the ImGui backend and the ImGui begin and end functions to a separate module called DebugUI or to the Editor directly.
The engine must be able to build without the ImGui binaries.
Expose high-level C++ functions to Lua for scripting
Meshes can have multiple materials associated with different sub-meshes.
Required:
Preprocess resources used in scene.
Preprocess components in scene.
MeshRenderer:
Change state based access and modification to DSA functions for:
File explorer for game assets like textures, models, scripts, audio files, etc.
Since all source includes of the shader are concatenated before passing to the shader compiler an error in any of the include files is still marked to be from the file 0 with cumulative line numbers.
To ease up debugging, we can use the #line _line_ _file_no_
preprocessor directive to set the correct line and file numbers.
Proposal:
Inside the SolveIncludes
function in OpenGLShader.cpp, append before the include string:
#line 0 {file_counter}
where file_counter
is a C side variable that counts the number of files included.
And after the include string, append:
#line {prev_line_number} {prev_file_counter}
A DFS algorithm or stack can be used to maintain the previous line and file numbers.
Graphic API calls can be grouped/scoped, and objects (textures, shaders, buffers, ...) can be labelled/named so that debuggers like Renderdoc can display them for better info during debugging
OpenGL: glPushDebugGroup, glPopDebugGroup, glObjectLabel
Whenever a new raw image/mesh/model is imported into the project (for the first time), display an importer dialog box for setting the metadata and import options for the asset. This data will then be saved in an asset descriptor file or in the project file and can be displayed in the explorer as an imported asset instead of a raw file.
Assimp supports many formats but it does have some issues with certain formats including FBX. FBX has become like the industry standard along with gltf 2.0, thus it makes sense to support these formats only.
These formats also support PBR materials built in and we can reduce certain client side checks for existence of UVs, normals etc.
TODO:
Required features for Android development
Currently there exist 2 classes SceneCamera (Apex/Core/ECS/Components/SceneCamera.h) and Camera (Apex/Core/Camera.h) which provide the same base functionality and are thus redundant.
Proposal: Remove Camera class and make CameraController take a non-owning pointer to a SceneCamera (which can be renamed to Camera). The CameraController will be responsible for applying the transformations to the Editor/Debug Camera and thus can be a wrapper/modifier for the actual SceneCamera object.
Features required:
Show the properties and components of the selected object
Currently, text rendering can only be done in the ImGui context and not in the actual 3D scene. By stealing a few functions from the ImGui library we can directly incorporate font rendering into the Renderer2D
.
Proposed architecture:
Apex::FontAtlas
over ImFontAtlas
Apex::FontGlyph
over ImGlyph
OpenGLTexture2D
and set data from ImFontAtlas->GetTexDataAsRGBA32
. Set this in ImFontAtlas->SetTexID()
Renderer2D::DrawGlyph()
which should take in an Apex::FontGlyph
and sets the quad attributes accordingly { position, color, UVs, texture index }
Renderer2D::DrawText()
which takes in a string and adds all the glyphs in it using similar method as in Renderer2D::DrawGlyph()
Reference links:
Current LogPanel implementation is plain string based, but rather we can create a new MessagePanel which can have all metadata about the logs stored in an array of MsgData struct
This will allow us to select the details to display using Tables and also filter based on the parameter data such as Log level or logger without having to use string filter provided by ImGui. Using this data will also allow us to add our own Regex for detailed description of errors thus providing on-demand brief or verbose error details.
Currently in TransformComponent the final rotation matrix is calculated by multiplying rotation matrices with respect to each axis as seen here.
This is inefficient and also has improper rotation effect as rotation in Z axis us applied after Y axis which is after X axis.
An alternative is to convert the Euler angles to quaternion and to get the Mat4 from that.
P.S. this might not solve the axis precedence issue.
#define GLM_ENABLE_EXPERIMENTAL
#include <glm/gtx/quaternion.hpp>
glm::mat4 rotationMatrix = glm::toMat4(glm::quat(rotation));
Pick and drag-n-drop game objects into the scene using the mouse
Default:
Rendering:
Behaviour:
Physics:
Audio:
GUI node-graph based editor for scripting shaders
Resources such as shaders and textures currently take filepath as parameter for their Create functions and load the files themselves. Instead they should use a File which is passed to the constructor so that the resource does not own file loading responsibility.
On-screen gizmos for interacting with the scene objects
The current implementation of the FBX Importer in backup-changes-290722 branch creates a separate vertex for each triangle thus making the index buffer obsolete as there is no reusing of vertices. This also means that the size of the meshes in memory is larger than required. Fix the algorithm to first extract arrays of all the components - Position, Normal, UV, etc. and then use the metadata in the FBX scene to map them together in a way that uses the memory optimally and also maintains proper hard and soft edges.
A complete encapsulation for all game files and configurations
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.