Visualize large list of action nodes Topic is solved

Problems building or running the engine, queries about how to use features etc.
slapin
Bronze Sponsor
Bronze Sponsor
Posts: 388
Joined: Fri May 23, 2025 5:04 pm
x 28

Visualize large list of action nodes

Post by slapin »

Hi, all!

I need to implement player action menu where player can select what to do based on environment.
All the words and positions are supplied by environment in a form of

Code: Select all

struct ActionNode {
	Ogre::String action;
	Ogre::String action_text;
	Ogre::Vector3 position;
	...
};

and some of these nodes can be moving, created or removed. All I need to do is make list of these nodes which are close (like 1m or 2m) to the player character and display them on screen as labels (or ImGUI windows) for player to be able to select one to use (or come closer to one). All I need is to egt the list to show as fast as possible. The number of nodes is from 1000 to 10000 but it would be best if solution would scale. And no, brute force approach with checking distance doesn't work too well. Any ideas how to do it effectively enough without digging too much of CS and making custom large data structures and spending months debugging? Kind of something I could do over weekend? All suggestions are appreciated.

slapin
Bronze Sponsor
Bronze Sponsor
Posts: 388
Joined: Fri May 23, 2025 5:04 pm
x 28

Re: Visualize large list of action nodes

Post by slapin »

What I currently done is creating a set of physics bodies sensors and add action to the list on entering and removing on exiting, the performance is much better than brute force approach but flexibility is bad as I can't display some nodes at distance as hint and also the performance could be better too (1000s of collision bodies/shapes).

slapin
Bronze Sponsor
Bronze Sponsor
Posts: 388
Joined: Fri May 23, 2025 5:04 pm
x 28

Re: Visualize large list of action nodes

Post by slapin »

Also I was suggested to use SceneNodes for all action nodes and use octree queries, but I wonder if that would be effective?

slapin
Bronze Sponsor
Bronze Sponsor
Posts: 388
Joined: Fri May 23, 2025 5:04 pm
x 28

Re: Visualize large list of action nodes

Post by slapin »

Looks like nanoflann library is the perfect answer.