Cropout Sample Project - Unreal 5.5.4 - Mega Learning Thread

[INFO DUMP: BP_IslandGen Part 1]

After fiddling with C++ classes for a while I decided to switch focus as I had an idea that bothered me for a while, namely, to have better control over what is where on the island. The original IsaldnGen plugin uses BP_SpawnMarkers to know where to spawn the Interactables, but that in all cases is just a circle with various degrees of radius, and I somewhat wanted more variety of sorts. In the end, I decided to learn more ways of generating things, especially in a more complex direction and shape. And that led me to the Procedural Mesh Generation… :slight_smile:

I can’t recommend enough the following 2 YouTube videos:

1. Poly Paths

Knowing the individual cone’s Radius and Center Point where the BP_SpawnMarkers are placed, I decided to first create the CIrcle Path 3D that would give me a poly path of 64 points which would later be converted into a closed Circular Spline. This took me a long time to find, as I didn’t even know what questions I should ask in Google, as thought has been there but not language to explain it. :smiley:

2. Maps for Calculations.

After spending some longer though on the whole process of storing the data, I went for String / Int Maps, mainly because the String Part could ask as a combined tag, while all the values for the calculations can be grabbed based off that.

3. Set-up

Because we will be going through all the Cone Overlaps individually, the first thing we need to ensure is to clear all the Maps each time we switch to checking the next Cone. This works well as we need that information only once, during the Island Creation.

As a safety feature we ignore any Islands that consist of only 1 Cone (Main Menu), so that we can focus our Gameplay Logic on just that area. Once we know the valid Island is ready, we perform the caulcations.

4. Spawn Points Calculations

Reaching the above set up was a painful and slow learning experience but I finally nailed it as my head refused to make it work, initially. Anyways, thanks to keeping the pairs unique we do the first Filter of combinations we care about. Later we will use it to focus our calculations only on the unique pairs. That will be the backbone of the whole system.

5. Circle Calculations.

Here comes the math (https://stackoverflow.com/questions/3349125/circle-circle-intersection-points). This part was actually enjoyable, to re-learn the math from old school days.

In the end we get:

  • DIstance between the 2CIrcle Centers
  • Differences of the 2 Circle Radiuses
  • Sums of the 2 Circle Radiuses
  • First and Second Circle Radiuses (simpler than navigating through arrays, at least for me)

With the above weapons we can start fighting with the logic, and there is a lot to cover, so sit tight for the next episode of new guy’s struggles.. :smiley:

1 Like