Fractals in UE4

HOW I STARTED WITH BINARY TREES AND FRACTALS SHAPES:

On Sept2016 I posted ‘explore fractals with a dragon’: that was my 1st tentative to take fractals into UE4.

Here my 1st demo test generating shapes via bprint starting from the basic ‘V’ fractal tree algorithm.
Fractaltree.rar

Here my first video on this youtube channel
https://youtube.com/watch?v=aIo6C7hcy7I

This is super cool! I’ve had some ideas recently about VR and hallucination machines… I think your plug in could help!

Thanks, I like the ‘hallucination machines’ definition! :slight_smile:
Here some new tests on a ring mesh I did with UE geometry tool + standard UE materials.
The Fractal Bprint can mix more meshes together.
Next step->add particles such as fire, clouds…see what comes out.

5876488341d0e3e84538551454112d89bd99c393.jpeg

b9d24a879674b00b611deb710f1c81e069ea78d5.jpeg

More tests: all created with a code modification to the brpint algorithm…I’m using a few RDT 8K materials this time to engage a real effect…huge memory size but still great speed when moving around!
Preparing a new video tomorrow…

1d9d85b38d7a0e31feb3dc4d348f868669e71f6c.jpeg

3fbcd57b0852fb397a9b33d173e6f1db20ea5bee.jpeg

49a45e4018a5b89b556ac1d54f37f467fb503f1f.jpeg

New video: testing the bprint when instancing meshes+particles+skeletons+DestructMeshes.

After testing the fractal brpint on various meshes, skeletons and effects you see in the above 2 videos, my next goal is to generate a fractal scene similar to the one in the pic below (generated with mandelbulb).
I’ll post a new video soon that will report my first tentative. Every mesh will be created via the fractal parametric bprint as instanced mesh. The difficulty in reproducing these kind of complex fractals via bprint rules is to avoid overlapping meshes, find the correct rotating angles of each branch and adjust the scale mesh dimensions keeping under control the GPU speed.
Hope to create a UE playable scene like this image! If I succeed I’ll package a demo, like the one available in the 1st video Fractaltree.rar

008bc469c09194ab2f977515cc0972520ca4ef20.jpeg

I so so hope you succeed in making that happen. Is the idea that having the geometry generated procedurally will allow for actual fractal infinite zoom?

Yes, procedurally instanced level streamed geometry meshes are the one I’m using and for me the best solution for an “infinite zoom” effect.
The only issue about infinity fractal is how to manage all the finite objects around, such as the actor mannequin that I use to run on the fractal branches…he has a dimension: actually I prefer to create a fractal that has a very big variable scale dimension but is also playable with other objects around such as actors, skeletons and so on.
The infinite effect is my last goal and I think is good only for exploration…nothing more at the moment.
Before that I prefer to be able to use the bprint plugin to give the possibility to realize any possible fractal mesh scene like the one in the picture above and scale it from a very very small dimension (ten times smaller than the actor finger) to a huge dimension where the actor can run on a single branch for a long time.

To realize such a fractal picture scene I need to go through some steps:

  1. control the direction of a branch, where is going to grow, by setting volumes where it can not grow outside
  2. control the branch twist angle (not just a plane set of branches with planar angles)
  3. control the size of each single ‘V mesh’ and increase or decrease it during the growth…it’s all sin cos calcs and UE v.4.15 has all these math…so possible! :slight_smile:
  4. give an AI to each branch so that during the growth it changes direction based on a possible collision with another obstacle mesh

After all these points solved inside the brpint, it will be possible to set all the parameters and make each actor branch grow to a specific direction, with a specific volume perimeter and so on…and the pic above should not be impossible to generate…I hope! :slight_smile:
Actually I’m working on step 1: control the direction of a branch, where is going to grow by setting perimeters volumes. Here below a few pics, a branch growth with and without volumes perimeters.

efe202a239944ddff0223f021ea247dc52a0d76f.jpeg

ebc99af6a24e0dd7718458a33b9b51b4bdf1f84d.jpeg

82bb9e11a5d6ae33cab3f19bf52fcaecd8de6229.jpeg

With the fractal bprint it is possible to instance everything is inside a level stream and till today I created a branch mesh…this time I wanted to do something different:

  • inside one fractal tree, instead of a branch mesh I instanced one skeleton warrior bprint with active ragdoll, blood collisions, movements and a simple AI to catch and kill the player
  • inside another fractal tree I instanced a metal sphere bprint that I found in the marketplace ragdoll package…basically brpint launching a sphere

When placed the 2 fractal tree one opposite the other in the scene, for each branch there was a warrior on a tree and a metal sphere on the other tree.
The rest is in the video below, I also added a short time delay when the player hits a warrior to appreciate the ragdoll effect!

This was just a different kind of a test…but creating a realistic fractal tree scene remains still the main goal to reach!

Looking forward to see your fractal scene. Imagine a spaceship flying through a fractal landscape shooting things, could be fun

Fractal scene is coming out step by step…let’s say brick by brick…in these days I’m working on the branch selection (right and left activation or deactivation) and twist angle of each single mesh.
About your phrase ‘Imagine spaceship flying through a fractal landscape shooting things’ …let’s say that when you put the word ‘Imagine’ for an UE4 scene, I already agree on it! :slight_smile:

Very interesting. =)

For those of us who don’t know what fractals would be used for, could you explain in laymen’s terms? Is it just a generation method for procedural placement of geometry? I’m very confused about the video of the warriors AI and how it uses fractals.

The warrior video is an extreme example just to show that even a bprint skeleton warrior with it’ìs own AI logic, can be placed inside a fractal branch.
At this stage is not easy to see the final pic because fractal branches have only a ‘V tree’ planar shape, but when will be completed, it will be possible to model a fractal branch via parameters and create one or more different branches that cover a specific volume of space.
For example, five branches that start from 5 different locations and that converge all to the same volume space in a sort of blob volume, generating a sort of fractal complex cave: at this point the fractal AI logic will not only let you generate the shape you want but you will also be able to instance any actor you want inside that specific volume of space…actors like static meshes, brpint or animated skeletons like the warrior above. That’s the fractal AI logic. Then every instanced actor can have it’s own indipendet logic like the warrior bprint.

If for example you want to have a battle like the one in the video, but inside a volume created with fractal branches (I really hope to reach a level of fractal shape similar to the mandelbub pic above), you will be able to do it via the fractal bprint AI logic.

Consider that every actor instanced via the fractal plugin is not visible during the parameter construction…is not just instancing a mesh, is instancing a level stream mesh…so you don’t see the fractal generated until of course you launch the ingame brpint and you set the branch to be Loaded and Visible: in order to place any other actor in the generated fractal scene, I’ll set some sort of ‘volume traps’ (like a sphere net or a cube net or a cilinder net) that will be used to trap and limit the fractal branch in a specific volume. Like when you grow a plant giving it the shape you want using some wire shaped form…and this idea came from real plants like the pic below! Setting a volume trap, the branch inside will start growing and will at a certain point have a collision with a border of the volume and the branch angle and direction will be corrected in order to stay inside the volume, in extreme cases also the branch size will progressively be reduced to be able to stay inside the volume.
Hope is more clear…perhaps future pics and videos will explain it better than words :slight_smile:

3d9076e8a350ed64a75cf3bc8ee4cbbec2cad2a1.jpeg

The idea should be this:

e7a1cb5e7cb200945c7563e14b0e7ced66c565bb.jpeg

Volume Traps starting tonight. By tomorrow I hope to post a new video+demo package, with volume traps shapes.

58bb75b98ea652fbe3bf4d080a2061800d57bc27.jpeg

This part of Volume traps is quite hard:
before managing Volume Traps, I realize I had to isolate a single branch tree and implement a full control on it.
Full control on a single branch tree means managing every rotation and direction a single branch can take: Forward/Backard, Up/Down and the X,Y rotations 0°,±45°,±90°, etc…

After this was done I was able not only to understand when my branch is inside or outside a Volume sphere trap (pics below, green red coords print), but I also have a full control on the branch which comes mandatory when I need to stay inside the Volume SPHERE trap or exit and wrap it form the outside.

I still have to implement this inside/outside wrap AI concept: basically when the tree reaches the sphere border and I want to stay inside, I will tell the branch to go in opposite direction with an opposite angle rot. which could be calculated by checking if I’m over/under the sphere center level. Hope it works.

Actually I’m testing the inside/outside part (pics below).

b9a94316e7b3f9ec90828719f05c09280d601d8d.jpeg

03a8c28c253883cf64fd4ea9884550a282eac450.jpeg

Setting an example of fractal branch shape.
A parametric function will generate randomly any branch size and growth. No texture applied actually. Standard mesh here in the pic…but basically any mesh, skeleton, blueprint, particle can be aplplied on a branch instead of the V shape.
9fc1a871044da730085717154fb505afe9197de9.jpeg
6c5f1dde2f7f19de19342e4b98e8da99ece62a91.jpeg

how i can instal this binares plugin?
you can creat mini tutorial?

I still have to complete it.
Will be complete when I can replicate the mandelbulb pic above. That’s the GOAL! :slight_smile:
Once done I’ll have a plugin with all the parameters to generate many fractal scenarios. I’ll then set tutorial on how to use the bprint plugin and if the result is really good, put it on the marketplace.
I’m looking forward to generate fractal shapes and not only, I have a few ideas on start generating some interesting scenarios such as caves and dungeons, vegetation shapes, huge combat scenes with hundreds of soldiers, population scenes, atmosferic events, etc.
In the last few days I was also very interestd by the ue4arch.com site and how realism they put in those scenes, so maybe I could mix fractal bprint with a few of those realistic meshes scenes and see what comes out…I’m really looking for realism.
But before all this, need to replicate the mandelbulb pic above! :slight_smile:
In these days I’m working on the volumetric traps or net and the branch progressive resizing and twisting shape.
Thanks for the interest!