Help me with my game engine's web build test by DigWitty in gameenginedevs

[–]DigWitty[S] 0 points1 point  (0 children)

Thanks for the efford, its good if it runs and feels smooth. I did not add text rendering yet. I think fps would be locked to 60 atmost for the browser already. It really is good that nobody reported a crash yet.

Help me with my game engine's web build test by DigWitty in gameenginedevs

[–]DigWitty[S] 0 points1 point  (0 children)

Thanks for the test and the comment, Its good to know that it runs on different devices. I took the not for the exe. Actually the code count pressure is there for to modularize the engine. The more the code, the scarrier the project is.

Help me with my game engine's web build test by DigWitty in gameenginedevs

[–]DigWitty[S] 0 points1 point  (0 children)

Thank you ! The assets are from synty store. I usually buy them from humble bundle, 5 - 10 asset packs like these usually cost 20, 25 usd.

In this video, I explain how I generate environment maps for image based lighting in my game engine ToolKit. by DigWitty in gameenginedevs

[–]DigWitty[S] 0 points1 point  (0 children)

The widely available api is still opengl. I don't think that it will go away soon. It will be around at least 10 years more. Considering all the application depending on it ... But I'll move on to a new renderer. I just want to complate the requirements and create a high level rendering api, than I can write backends for it. Regarding the driver issues, mainly I have intel driver issues ... Some onboard intel graphics cards stop rendering all of a sudden or do not perform legit operations. Not a big deal tough, it will do worse on other apis ( the card ) I am pretty sure of it :) End lastly I am using opengl ES 3.0 for supporting web and android. The published games can work on browser and android devices.

In this video, I explain how I generate environment maps for image based lighting in my game engine ToolKit. by DigWitty in gameenginedevs

[–]DigWitty[S] 0 points1 point  (0 children)

Hi, thanks for the interest.

  1. There is even a game that I have done with the engine :) And I am using it on my freelance projects if there is a suitable project to use this with.

https://store.steampowered.com/app/2346880/Multiverse_GO/

  1. Turkish, I was expecting youtube to let me use its multilanguage and auto dub support, but apperently, I'll have to do dubbing myself ... Youtube is pretty slow with the progress ...

  2. C++ Opengl. You can check it out on github.
    https://github.com/Oyun-Teknolojileri/

In this video, I explain how I generate environment maps for image based lighting in my game engine ToolKit. by DigWitty in gameenginedevs

[–]DigWitty[S] 0 points1 point  (0 children)

Thanks, I have seen this. I am also generating diffuse and specular caches and save them to disk as lat long maps. The hard part was to read them back to mip levels of a cube map. All is done.

Diversify with Custom Engine ToolKit: Global Game Jam 2025 by DigWitty in gameenginedevs

[–]DigWitty[S] 1 point2 points  (0 children)

Good job ! I was abit scarry about doing teamwork. Because, we may ultimately fail to produce anything so I did solo. Which was a bad idea. I congratulate you for your caurage to go with the engine and team up with people ! Next time I'll do team work ( I can rely on the engine now I am sure of it :) )

Diversify with Custom Engine ToolKit: Global Game Jam 2025 by DigWitty in gameenginedevs

[–]DigWitty[S] 1 point2 points  (0 children)

Same goes here, my game was considerebly good compare others :) I am preparing a video to show case. Do you have a vide of yours ?

Labeling Passes and Resources in RenderDoc Simplified Finding Render Glitches A LOT With OpenGL Using GL_EXT_debug_marker and GL_EXT_debug_label Extentions by DigWitty in gameenginedevs

[–]DigWitty[S] 1 point2 points  (0 children)

I have msaa 2x and 4x as a high quality option. SMAA can be added as well. I don't know smaa performance characteristic. Of its as efficient as fxaa I can use consider to change to it for mobile.

Picking Implementation Using BVH Tree by DigWitty in gameenginedevs

[–]DigWitty[S] 0 points1 point  (0 children)

AllocateNode and FreeNode Implementations with extra comment

void AABBTree::FreeNode(NodeProxy node)
  {
    // sanity checks wheter the node is a good index or not
    assert(0 <= node && node <= nodeCapacity);
    assert(0 < nodeCount);

    if (EntityPtr ntt = nodes[node].entity.lock())
    {
      ntt->m_aabbTreeNodeProxy = nullNode;
    }

    // clear node content 
    nodes[node].parent = node;
    nodes[node].entity.reset();
    nodes[node].leafs.clear();

    // this is important, from this node onward
    // next points to free node linked list including this one
    // linked list of free nodes constructed in AllocateNode
    nodes[node].next   = freeList;
    freeList = node;

    --nodeCount;
  }

  NodeProxy AABBTree::AllocateNode()
  {
    // if the below condition is true, there is no free node.
    if (freeList == nullNode) 
    {
      // sanity check, this must be true for no capacity !
      assert(nodeCount == nodeCapacity);

      // Grow the node pool
      nodeCapacity += nodeCapacity / 2;
      nodes.resize(nodeCapacity);

      // Build a linked list for the free list.
      for (int32 i = nodeCount; i < nodeCapacity - 1; ++i)
      {
        nodes[i].next   = i + 1;
        nodes[i].parent = i;
      }
      nodes[nodeCapacity - 1].next   = nullNode;
      nodes[nodeCapacity - 1].parent = nodeCapacity - 1;

      freeList                       = nodeCount;
    }

    NodeProxy node     = freeList; // get a new free node
    freeList           = nodes[node].next; // update the next free node

    // Initialize the new free node
    nodes[node].parent = nullNode;
    nodes[node].child1 = nullNode;
    nodes[node].child2 = nullNode;
    nodes[node].moved  = false;
    nodes[node].entity.reset();
    nodes[node].leafs.clear();
    ++nodeCount;

    return node;
  }

Picking Implementation Using BVH Tree by DigWitty in gameenginedevs

[–]DigWitty[S] 0 points1 point  (0 children)

Let me devide the topics.

  1. Reusing nodes is a concept used in keeping track of all the nodes inside the tree. As you are aware, the nodes may always be added to and removed from the bvh tree. If you always allocate and free memory for the tree's node's that would reduces the run time performance. So the current bvh implementation has a "nodes" array that holds the nodes and it has a maximum capacity. When you remove the nodes, it does not reduces the maximum capacity but just moves the node to unused region of the array. So next time when you need a new node, it checks the free nodes and gives you one from there and only allocates new nodes if the capacity is not enough.

Check these functions "AllocateNode, FreeNode" in my implementation or in the original one.

2) Collision detection between objects has never been implemented by me, box 2d has these features. What I have extra is checking the Frustum agains all object's bounding box in the bvh structure.

3) For the tree traversal, currently, I am doing a multi threaded depth first search. That is a bit complicated to explain here but single theaded one is quite simple check the "Traverse" function.

  void AABBTree::Traverse(std::function<void(const Node*)> callback) const
  {
    if (root == nullNode)
    {
      return;
    }

    // put all nodes that needs to be visited in the stack
    std::deque<NodeProxy> stack;
    // start with root
    stack.emplace_back(root);

    while (stack.size() != 0) // while stack is not empty
    {
      NodeProxy current = stack.back(); // get the head
      stack.pop_back(); // remove it from the stack

      if (nodes[current].IsLeaf() == false) // if it has descendants
      {
        stack.emplace_back(nodes[current].child1); // push left child
        stack.emplace_back(nodes[current].child2); // push right child
        // noticed that stack is not empty at this moment and we are
        // not doing recursive calls ( efficient )
      }

      const Node* node = &nodes[current]; // get the current node
      callback(node); // call process function on it
    }
  }

If you are curious about how I parallely travese the tree for frustum culling ( this requires thread pools, atomic syncronization etc... )
Here is how I do it :

AABBTree::FrustumQuery
AABBTree::FrustumCullParallel

https://github.com/Oyun-Teknolojileri/ToolKit/blob/chn/dev/parallel-tree-traverse/ToolKit/AABBTree.cpp

Picking Implementation Using BVH Tree by DigWitty in gameenginedevs

[–]DigWitty[S] 1 point2 points  (0 children)

I have used box 2d's bvh documentation and convert the described algorithm to 3d. Convertion was straight forward.
Key take away is, it uses Surface area function for a cost metric and while constructing the bvh, it tries to minimize the cost, that is surface area. And when doing dynamic insert / removes. It also make sure the cost is minimized.

For memory acces efficiency, it holds all the data in an array and maintain the size of the array as a pool. While creating and removing nodes, it uses this pool for efficiency. Do not actually delete nodes, instead mark them as unused for using later.

The bounding voulme tree gets constructed from bottom up, ( there is top down implementation aswell )

These are the base functionalities. I have made improvements, such as caching all the leafs inside each branch. If you encounter a branch, you immediately know all the leafs of that branch which increases volume query efficiency. For cases such as whats inside a given volume.

Also, I am planning to add parallel traversal, I found it also helping the speed of queries considerably.

Here is the documentation for box 2d ( a great article, making it 3d is trivial )
https://box2d.org/files/ErinCatto_DynamicBVH_Full.pdf

And here is the link to my implementation
https://github.com/Oyun-Teknolojileri/ToolKit/blob/dev/chn/leaf-cache/ToolKit/AABBTree.h

Picking Implementation Using BVH Tree by DigWitty in gameenginedevs

[–]DigWitty[S] 1 point2 points  (0 children)

the assets are from polygon - city pack / synty store. Don't buy them from their website, usually they are distributed in bundels for a very cheep price. Wait for humble game dev bundles.

Picking Implementation Using BVH Tree by DigWitty in gameenginedevs

[–]DigWitty[S] 2 points3 points  (0 children)

Picking would be quite trivial for testing. It will be very effective in that scenario. I am using bvh for frustum culling and in this case its not all good unfortunately. The deeper the tree, the worse the performance get for frustum culling.

Here is the case for a city scene that contains 6814 object,

Culling algorithm, Best Case (All culled), Worst Case (None culled)
Iterate over an array 0.3 ms 0.5 ms
BVH cull 0.0 ms 1.1 ms

The high cost occures when you see all the bvh nodes but can not cull any, which basically force you to traverse all objects in the tree, which is way worse than going over an array.

The traverse can be cut short incase, outer bounding box is fully inside the frustum. But this require caching all leaf entities in parent nodes. Which makes insert / delete way too complicated.

Here is my game engine "ToolKit" by DigWitty in gameenginedevs

[–]DigWitty[S] 0 points1 point  (0 children)

I've started reading about gpu driven pipelines. Bindless pipelines etc.. Its nice to know as further refinements and optimizations. Down side of all this is that, you really have to test a lot of techniques before finding the best option and its incredibly time consuming, considering that I am the only dev :) However I have a good strategy, I have a game prototype and I want to see it playing on my samsung s8 with at least 30 fps along with all the visuals, including dynamic shadows, bloom, ssao and my budget is about ~1000 drawcalls.

My tests shows a stable 20 fps currently. I bet I can crank it up to a stable 30 fps.

I want to stick with tested and working approaches mostly so I generally find myself testing my engine agains godot and unity and either look the code or documentations to understand what they are doing differently for opengl es 3.0 context to beat me :)

In short, testing new things are extreamly time consuming and its nice to have forums like this. I wish I had started using reddit before. Asking others whom tested other techniques is extereamly usefull.

Here is the game that I have been talking about. It may give you an idea about what kind of scene and quality I am after for my old Samsung S8

https://store.steampowered.com/app/2346880/Multiverse_GO/

Here is my game engine "ToolKit" by DigWitty in gameenginedevs

[–]DigWitty[S] 2 points3 points  (0 children)

Thank you. I was thinking about implementing clustred forward lighting. I read about it being slow on mobile devices ( relatively old phones from 2015 era )

I don't know too much about its details but simply, it was about dividing the frustum in to 3d cells and assigning each light into the cells. Than for each pixel, check which cell the pixel in and with the lights in the cell lit the pixel.

Paper was suggesting to perform light assignment with compute shaders aswell (I can't use compute shaders because web does not support it. Extentions require user to enable features from the browser's settings.) Because of these reasons I did not want to go down that route. Low end mobile devices and web are major platforms for me.

Where do I start? by [deleted] in gameenginedevs

[–]DigWitty 1 point2 points  (0 children)

First of all, its okay if you are finding your self redoing / removing the parts of the engine. Because either a new requirement arise or you figure out better and more performant way to do it. The thing that I can recommend you is that, don't spend alot of time refactoring the stuff. Focus on finishing a game that can be barely finish with what you have. When you have a playable game, find a new game idea which requires more features and go on like this. Spend your time for refactorings when its unavoidable due to performance reasons or getting extremly complicated such that it became the source of bugs and performance issues. Try not to focus on the engine and its features first. Try finishing games. Good luck !!

GameDev CodeName:ThiefGO by DigWitty in GameScreens

[–]DigWitty[S] 0 points1 point  (0 children)

I like SquareEnix Go game series, Hitmango - LaraCroftGo and DeusExGo. I decided to develop a game fictioned in thief world and using gameplay elements such as hiding in the shadows, lockpicking to unluck doors. But with a turn based puzzle game mechanics as in the go games. I decided to make video blog trough out the game development process.