Sparse Spatial Grid Plugin by Stormtide Ltd.

I was away from it for a long while, thanks so much your updates fixed the issues I reported and v2 is great.

Have a feature request. “Fit to World” is rarely useful to me because objects in the distance are fitted in. It would be nice to have a way to quickly envelope a level thats useful, maybe a “Fit to Selection”.

Ah I think I planned that and never actually got around to it… but that’s a good point. I’ll see about adding that!


There is definitely an issue with orientated boxes at the moment, so I’m looking into that one. In V3, I’m aiming to separate queries from the grid class itself, so they can be more easily created and reused.

I have fixed the issue with AABB / Box Queries

Just waiting on Marketplace to approve the file update - should hopefully be live early next week. Sorry folks!

Hi, I am interested in this plugin, but have a question: How do you render the lines of the grid itself and the heat map rects, is this done via debug shape rendering?

The in-world debugging just uses the debug drawing functionality in the engine. The heatmap is a texture, which is updated on the GPU but gathers information about the cells from the CPU.

4.22 version is on it’s way, as is the fix for 4.21

Unfortunately Epic have a known (but currently not being fixed) issue with their submission system so I am unable to update the older versions of the plugin at this time. 4.22 and 4.21 should be ready within the week however.

4.22 versions and the fix for AABB/Box searches is now live. Thanks for the patience all.

I’ve been consistently learning and trying to create a octree system for unreal in efforts of making a space flight game. Land to ground. Similar to that of No man sky or elite dangerous. Today, I got really lucky when I found your plugin and it seemed to be precisely what I needed. I believe I read most post in here and the full documentation but I’m making some major issues.

For one, every single runtime value is capped to a very low UU value, making it impossible to get such a large open world scale. Someone mentioned it above and you said you’d fix it. sadly I purchased it before I got to read that post. Not only that but setting the delta does indeed allow the number of cells capped at 192 and the cell size at 1600 to go behind that…only within one direction (x) while (y) remains at the cap.

So I actually got this far by speeding many hours trying to figure this out, since the last purchase since this post ^^. I found other roadblocks or things I simply do not understand and there doesn’t appear to be and updated documentation or tutorial provided.

One warning: https://i.imgur.com/xYS6ACs.png

I do not know what that is but it started when i installed the plugin.

The next has to do with “Fit To World” when the distance is so drastic. Initially when clicking the button, my FPS drops to about 1FPS. My computer is a very high end computer with a ton of ram, so I have to use the delta to remove cells which is no big deal, i think? if it werent for the size issues.

Here are some screen shots to show you the scale, I’m currently dealing with.



https://imgur.com/a/qqOsd8W
https://i.imgur.com/LyuYjhZ.png


The last issue I’m having is that I cannot even follow along with the Grid Heatmap and even check it out because I cannot select a manager.

Any help would be greatly appreciated.

It’s hard for me to judge from the images alone but it looks like you have a very large world which is also very sparsely populated. This isn’t really the problem the plugin was designed to solve, and in your case a sparse octree might be preferable. That’s the first I’ve seen of that font issue, I’ll look into it.

The values are clamped because once you get too far from the world origin, you are going to have problems with precision anyway and will have to use origin rebasing and/or world composition - or some other custom solution that keeps the player camera at the world origin and moves everything else around it. Space games can’t really work in the way a traditional game does, once it gets to a certain size you have to break it into chunks anyway.

If you like however you can easily unlock the clamps by going into ST_SparseGridData.h and set ClampMax and UIMax to something larger (full source code for the plugin is included, just move it into your project and change those lines).

The absolute maximum for the cell-count values will be 4096, but I really wouldn’t recommend that because that would result in over 16 million cells, and the heatmap tool would be extremely slow. The heatmap tool only works when you are playing in PIE, as there is no manager when in the level editor - it’s just there to help you visualize the density of objects when the game is running.

2 Likes

Thanks for your answer, I was basically just trying to test the theory before I populated the game world. Im knee deep into c++ tutorials at the moment. I do not want to break anything before I know what I’m doing. I will experiment further afterwards. Before this, i managed to semi program a system using Bounding boxes / structs and blue prints that operates like a octree, I managed to sub divide like 4 times, But i didnt finish the checks on the leafs or the splits or anything.

Cant wait for UE4.26 update. :wink: Can only recommend Sparse Grid Plugin for all, been much lighter and faster system than the default perception. Using this for many other features as well like aim-bot for xbox controller.

Hi, tryed to compile plugin for UE4.26. but getting this error. Is there some easy fix to solve it?


H:\UE_4.26\Engine\Source\Runtime\Core\Public\Delegates/DelegateSignatureImpl.inl(226): error C2338: Attempting to bind a delegate with a const object pointer and non-const member function.
1> H:/My26compile/Plugins/ST_SparseGrid/Source/ST_SparseGridEditor/Private/Mode/ST_SparseGridToolkit.cpp(295): note: see reference to function template instantiation 'TDelegate<void (void),FDefaultDelegateUserPolicy> TDelegate<void (void),FDefaultDelegateUserPolicy>::CreateSP<const FST_SparseGridToolkit,UClass*>(UserClass *,void (__cdecl FST_SparseGridToolkit::* )(UClass *),UClass *)' being compiled
1> with
1> 
1> UserClass=const FST_SparseGridToolkit
1> ]
1> H:/My26compile/Plugins/ST_SparseGrid/Source/ST_SparseGridEditor/Private/Mode/ST_SparseGridToolkit.cpp(291): note: see reference to function template instantiation 'TDelegate<void (void),FDefaultDelegateUserPolicy> TDelegate<void (void),FDefaultDelegateUserPolicy>::CreateSP<const FST_SparseGridToolkit,UClass*>(UserClass *,void (__cdecl FST_SparseGridToolkit::* )(UClass *),UClass *)' being compiled
1> with
1> 
1> UserClass=const FST_SparseGridToolkit
1> ]

4.26 version has been submitted, so it will be fixed soon but Epic are currently on Christmas break. The issue stems from some const vs non-const mismatches in the editor part of the plugin.

Cool, thanks for the update. :slight_smile:

Hello TheJamsh!

I seem to have a small bug with the Sparse Grid in 4.26.
I did not have this issue in previous versions of the plugin.

What happens?

  • Opened my current project and installed the plugin.

  • Switch on Modes (Select, Landscape, Foliage, etc) to Sparse Grid.

  • In the newly opened tab if I hover over any of the buttons, the menu begins to constantly twitch and move, making it very hard to enter any inputs or press any of the buttons.

  • I can reproduce this error with the Editor Default Layout in a newly created 4.26 Project.

The Plugin otherwise works as intended.

Hmm yeah I’m seeing the same issue, looks like the UI is being rebuilt each frame. I’ll look into a fix!

Thank you! :slight_smile:

Version 2.1.1 has been submitted with a fix for that issue, looks like a typo while updating to 4.26 that caused it.

I also noticed a rogue file in the source that wasn’t supposed to be there, so that has also been removed. The 4.23->4.26 versions have also been updated to remove it.

UI twitching/moving is seemingly still occuring, though it seems to happen at every frame - a LOT worse at high frame rates, this is at 30fps.

Make sure you’re up-to-date, the most recent update fixed this (4.26 only)