for studyingpurpuses I have written a graph class in pure c++ which I want now to represent inside of unreal engine. It consists of 3 Classes:
Only c++ was actuall easy but now I have tried to implement it using UE and it seems like quite difficult.
I have created a new type called Graph inherited from AActor. These are the Parameters:
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Graph") TArray<class AKnoten*> knotenliste; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Graph") int32 nodesPerMetre; UPROPERTY(EditAnywhere, BlueprintReadWrite) class UBoxComponent* nodeContainer;
Now every node should be in “knotenliste” (nodelist) so later I can iterate over it for the actual pathfinding.
Every node should have the nodeContainer as child.
But the real problem is: How would I actually implement a node and a edge ?
Should I let them derived from AActor too (How would I attach them to the graph)?
So each node would have a neighbour list, previous node, rating, staticmesh…
Or should I just create static meshes represting nodes ?
PS.: I dont excpect any code just some food for thoughts
I know there is already a build-in graph for pathfinding, but as I said I’ts only for studying purposes.