arrayssortingdata-structuresunreal-engine5tree-structure

Implementing Data tree Structures in Unreal Engine


I'm working on a Paleo-encyclopedia app. I have a good start and can pull the data I need from a Google Sheet and put it all in an array. I'm getting to the part where I want to implement search and filter functions. On the forefront of this is Cladistics, or the dino's "family tree". I want Unreal to read the name of the dino or any of its groups, and know what larger groups they are in and what smaller groups they contain.

As a very simplified example I made a bird cladistics tree (Figure 1). I have an array with a list of birds, and I want Unreal to know that when I apply the "Shorebird" filter, it returns the Crane and Sandpiper. Since everything that's a Heron is also a Shorebird, it would include all Herons in that search as well. This is a very simplified version, since in real life dozens of animals can be a part of dozens of different groups.

So what would be the best way of categorizing/storing/accessing this information? Keep in mind, the crux of this project relies on the Google Sheet for easy collaboration and minimal app updates. I want there to be minimal blueprint tampering, so if someone adds a new group or subgroup In the sheet, it needs to be reflected in the app. I'm not looking for someone to write code for me, just to point me in the right direction.

Figure1

I saw someone in Discord mention Data Tree Structures and Pointers and it sounds like exactly what I need, but I have no clue how to implement them or if they can be generated at runtime. I have a second image (Figure 2) summarizing what kind of logic I think would work. Getting the new entry, seeing what groups it belongs to, and making any new groups/pointers it needs. I mostly use and prefer blueprints, but am willing to learn some C++ if needed.

Figure2

Another consideration I am currently workshopping is using a String, where upon encountering a new group name, it assigns an index to associate with that group. Then if there is a group inside, it assigns that group an index and places it inside parenthesis, and so on. (Figure 3) Its like manually typing out an array. It's limited to 10 groups per 'layer' but it might work for my purposes.

Figure3


Solution

  • SOLUTION: Someone on the Unreal forums pointed me to JSON data, so I learned a little bit and got the VARest plugin. With a couple hours work I now have a dynamically updating cladistics list that hypothetically could extend to the entirity of all living things ever. So. Yeah I think this works for me :3

    Showcase of results

    Blueprint Nodes