Longest road

Hello,

I’m stuck in finding a way to have the max number of contiguous segments, the goal is to find the longest road (max length will be about 15 roads).
There is only bifurcations (single fork for a road).
Each segment is a BP with a box collision that overlap the others, so I have paired my roads and stored pairs in an array (a struct of 2 actors).

What I’d like to do, is chaining the pairs and get the longest chain, but I can’t find the logic!

  • Store it in a new dynamically array? how to creat multiple temporary array?
  • Using map (dictionnary) variable (I haven’t well understood mapping, is it usefull in my case?) ?

Thanks for your help!

Hi all!

So my project is to make an UE version of settlers of Catan in 3D!
It’s a custom project that will normally be distributed for free (depending of copyrights of the original board Game).
The project is 60% done and will be compatible with VR. It’s multiplayer on network! Everything works pretty well

But for now, I’m stuck in finding a way to calculate the longest road. So I need help please!

My english is not the best, so I hope you have undertood my problem…

0bc3b35afb05764b1a4bda3375b263dce73d42a6.jpeg