[mod] Fractal World Generation [fractal_worlds]

User avatar
Mator
Member
Posts: 18
Joined: Sun Apr 02, 2017 17:41
GitHub: matortheeternal
In-game: Mator

[mod] Fractal World Generation [fractal_worlds]

by Mator » Post

Image
imgur album - WIP GitHub repository

Introduction
Several years ago, I watched a music video on YouTube of a flight through a mandelbox. The architectural features of the mandelbox inspired me to want to generate fractals in Minecraft. I achieved that goal through a WorldEdit script, though what I truly wanted were massive, world-size fractal objects to explore. Minecraft's 256-height limit and obtuse modding API was a major turnoff to this, so I made my own Voxel Engine in Java. Making this engine taught me a lot. I later made a much faster and cleaner engine in C++ using SDL. I've generated some awesome fractal images with this engine. (1, 2, 3)

However, part of what I wanted was to be able to interact with a fractal world. I recently found out about Minetest, which has brought me full circle back to my original idea - generating fractal worlds to mine, explore, and build in.

The Project
The project will come in two stages. The first stage is using the Lua modding API to make world generation code as a proof of concept. The second stage is native integration into the base game as new world generation modes, including biome and seed support.

Progress

Stage 1 (in progress)
Stage 2
  • Mandelbox: Generates a Mandelbox the size of the entire world.
  • Mandelbulb: Generates a Mandelbulb the size of the entire world.
  • Fractal biomes: Create fractal biome palettes and support multiple fractal "biomes".
  • Parameter seeds: Map seed values to fractal parameters. o
  • Fractal garden: Generates a variety of fractals at various sizes throughout the world.

Any help is appreciated!
- Mator
Last edited by Mator on Sat Feb 17, 2018 08:31, edited 25 times in total.

User avatar
paramat
Developer
Posts: 3691
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: [mod] Fractal World Generation [fractal_worlds]

by paramat » Post

Good to have you active in Minetest and i'm happy to help.

User avatar
azekill_DIABLO
Member
Posts: 7497
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: [mod] Fractal World Generation [fractal_worlds]

by azekill_DIABLO » Post

awesome! purely awesome! are the colors random or they represent some kind of patern?

User avatar
Mator
Member
Posts: 18
Joined: Sun Apr 02, 2017 17:41
GitHub: matortheeternal
In-game: Mator

Re: [mod] Fractal World Generation [fractal_worlds]

by Mator » Post

paramat wrote:Good to have you active in Minetest and i'm happy to help.
Thank you paramat! :)
azekill_DIABLO wrote:awesome! purely awesome! are the colors random or they represent some kind of patern?
The colors are mapped from the iteration that the point exceeded the fallout. When generating fractals such as Mandelboxes and Mandelbulbs you have an algorithm which applies a formula to the point you are testing repeatedly until its magnitude exceeds a certain value, at which point you consider it to be headed to infinity and part of the set. The iteration at which this occurs is mapped to a block in a palette.
+ Spoiler
Last edited by Mator on Mon Apr 03, 2017 17:11, edited 1 time in total.

User avatar
azekill_DIABLO
Member
Posts: 7497
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: [mod] Fractal World Generation [fractal_worlds]

by azekill_DIABLO » Post

ok thanks!

User avatar
Andrey01
Member
Posts: 2421
Joined: Wed Oct 19, 2016 15:18
GitHub: Andrey2470T
In-game: Andrey01
Location: Russia, Moscow

Re: [mod] Fractal World Generation [fractal_worlds]

by Andrey01 » Post

Interestingly... This is second CaveRealms mod in a screenshot

User avatar
Mator
Member
Posts: 18
Joined: Sun Apr 02, 2017 17:41
GitHub: matortheeternal
In-game: Mator

Re: [mod] Fractal World Generation [fractal_worlds]

by Mator » Post

Andrey01 wrote:Interestingly... This is second CaveRealms mod in a screenshot
What do you mean, and which screenshot?

toby109tt
Member
Posts: 649
Joined: Sun May 29, 2016 23:42
In-game: toby

Re: [mod] Fractal World Generation [fractal_worlds]

by toby109tt » Post

That looks like chaos but in the good way I like it :)

User avatar
DS-minetest
Member
Posts: 1141
Joined: Thu Jun 19, 2014 19:49
GitHub: Desour
IRC: DS-minetest
In-game: DS
Location: I'm scared that if this is too exact, I will be unable to use my keyboard.

Re: [mod] Fractal World Generation [fractal_worlds]

by DS-minetest » Post

toby109tt wrote:That looks like chaos but in the good way I like it :)
I don't think, that it looks like chaos. It's totally structured. Chaos would be like dust.
Note that I've recently renamed myself on github and co. to "Desour". (I'm bad at naming things.)
Feel free to call me DS.

User avatar
Mator
Member
Posts: 18
Joined: Sun Apr 02, 2017 17:41
GitHub: matortheeternal
In-game: Mator

Re: [mod] Fractal World Generation [fractal_worlds]

by Mator » Post

Octahedron Fractal generation working. Added images to the imgur album in the OP. Here's a few good ones:

Image

Image

Image

Image

Image

User avatar
azekill_DIABLO
Member
Posts: 7497
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: [mod] Fractal World Generation [fractal_worlds]

by azekill_DIABLO » Post

magnificient.

User avatar
Mator
Member
Posts: 18
Joined: Sun Apr 02, 2017 17:41
GitHub: matortheeternal
In-game: Mator

Re: [mod] Fractal World Generation [fractal_worlds]

by Mator » Post

I have three new fractals today.

Fractal Pyramid:

Image

Image

Quadratic Koch Surface:

Image

Image

Greek Cross Fractal:

Image

Image


Additional images have been added to the imgur album linked in the OP as well.

User avatar
azekill_DIABLO
Member
Posts: 7497
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: [mod] Fractal World Generation [fractal_worlds]

by azekill_DIABLO » Post

it's just amazing!

User avatar
Krock
Developer
Posts: 4564
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: [mod] Fractal World Generation [fractal_worlds]

by Krock » Post

These are impressive! It would be lovely if these fractals could be adjusted in a way to use them as a map. Directly thinking of the mandelbrot set.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
Mator
Member
Posts: 18
Joined: Sun Apr 02, 2017 17:41
GitHub: matortheeternal
In-game: Mator

Re: [mod] Fractal World Generation [fractal_worlds]

by Mator » Post

azekill_DIABLO wrote:it's just amazing!
Thanks man. Fractals are fun. :)
Krock wrote:These are impressive! It would be lovely if these fractals could be adjusted in a way to use them as a map. Directly thinking of the mandelbrot set.
That's stage 2. I don't have mandelbrot set planned, however, because it's a 2d fractal. I don't really see the point of 2d fractals in a 3d graphics engine. The mandelbulb, however, is similar to the mandelbrot set. It's not a canonical 3d representation of the mandelbrot set, but it has some mathematical similarities.

User avatar
paramat
Developer
Posts: 3691
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: [mod] Fractal World Generation [fractal_worlds]

by paramat » Post

We already have 3D/4D mandelbrots used as maps in mgfractal.

User avatar
Mator
Member
Posts: 18
Joined: Sun Apr 02, 2017 17:41
GitHub: matortheeternal
In-game: Mator

Re: [mod] Fractal World Generation [fractal_worlds]

by Mator » Post

paramat wrote:We already have 3D/4D mandelbrots used as maps in mgfractal.
That's actually a 2d mandelbrot set with height projected based on iteration instead of using iteration to determine color (I think). It is cool though. :)

EDIT: Actually no, I have no idea what that is. o_o

EDIT 2: I think it's some form of Julia Set maybe? Not sure.

User avatar
paramat
Developer
Posts: 3691
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: [mod] Fractal World Generation [fractal_worlds]

by paramat » Post

2D with height as iteration is too boring for me.
Some are 3D slices of 4D hypercomplex mandelbrot sets, some are 3D hypercomplex mandelbrot sets, each has the corresponding julia option.
All are from http://www.bugman123.com/Hypercomplex/index.html

All parameters are here https://github.com/minetest/minetest/bl ... mple#L1523

Code: Select all

#    Choice of 18 fractals from 9 formulas.
#    1 = 4D "Roundy" mandelbrot set.
#    2 = 4D "Roundy" julia set.
#    3 = 4D "Squarry" mandelbrot set.
#    4 = 4D "Squarry" julia set.
#    5 = 4D "Mandy Cousin" mandelbrot set.
#    6 = 4D "Mandy Cousin" julia set.
#    7 = 4D "Variation" mandelbrot set.
#    8 = 4D "Variation" julia set.
#    9 = 3D "Mandelbrot/Mandelbar" mandelbrot set.
#    10 = 3D "Mandelbrot/Mandelbar" julia set.
#    11 = 3D "Christmas Tree" mandelbrot set.
#    12 = 3D "Christmas Tree" julia set.
#    13 = 3D "Mandelbulb" mandelbrot set.
#    14 = 3D "Mandelbulb" julia set.
#    15 = 3D "Cosine Mandelbulb" mandelbrot set.
#    16 = 3D "Cosine Mandelbulb" julia set.
#    17 = 4D "Mandelbulb" mandelbrot set.
#    18 = 4D "Mandelbulb" julia set.
#    type: int min: 1 max: 18
# mgfractal_fractal = 1

User avatar
Mator
Member
Posts: 18
Joined: Sun Apr 02, 2017 17:41
GitHub: matortheeternal
In-game: Mator

Re: [mod] Fractal World Generation [fractal_worlds]

by Mator » Post

Got four new fractals today, all fractals I hadn't known about before now. Generation algorithms for these fractals are all very similar to the Menger Sponge.

Snowflake Cube

Image

Image

Penta Sponge

Image

Image

H Sponge

Image

Image

Koch Cube

Image

Image

User avatar
the_raven_262
Member
Posts: 315
Joined: Mon Sep 22, 2014 09:30
GitHub: theraven262
IRC: the_raven_262 Raven262 Corvus262 corvus
In-game: the_raven_262 Raven262 Nevermore

Re: [mod] Fractal World Generation [fractal_worlds]

by the_raven_262 » Post

I see you are doing an awesome job here :)
I thought to ask if fractals like the ones here (3d ones) could be made as minetest maps: http://hirnsohle.de/test/fractalLab/(The fractal library section)
[amber] [conjuration] [warzone] | Why is #minetest-mod-dev so empty?

User avatar
Mator
Member
Posts: 18
Joined: Sun Apr 02, 2017 17:41
GitHub: matortheeternal
In-game: Mator

Re: [mod] Fractal World Generation [fractal_worlds]

by Mator » Post

the_raven_262 wrote:I see you are doing an awesome job here :)
I thought to ask if fractals like the ones here (3d ones) could be made as minetest maps: http://hirnsohle.de/test/fractalLab/(The fractal library section)
Hi the_raven,

The only fractal there which I don't already have here is the SphereSponge. I don't know how good it will look volumetrically, but if I can find a description of the algorithm I'll give it a go.

The main thing that site has differently is a bunch of transforms. Some of these are entirely new to me. The biggest difficulty is in figuring out the transform's implementation.

- Mator


EDIT: Found the original posting about the SphereSponge fractal. Will see if I can implement the pseudocode provided there.

User avatar
the_raven_262
Member
Posts: 315
Joined: Mon Sep 22, 2014 09:30
GitHub: theraven262
IRC: the_raven_262 Raven262 Corvus262 corvus
In-game: the_raven_262 Raven262 Nevermore

Re: [mod] Fractal World Generation [fractal_worlds]

by the_raven_262 » Post

Thanks for the answer, I don't know about making a spherical fractal in a cubic world, might seem odd, a lot.
Do you plan on using minetest's ore generation or are you going to use the fractal for it?
Also, I have no idea how does that site add colour to the fractals, but as it colours certain sections of the fractal I can guess colouring has something to do with the fractal itself, would be nice to implement biomes this way.
[amber] [conjuration] [warzone] | Why is #minetest-mod-dev so empty?

User avatar
Mator
Member
Posts: 18
Joined: Sun Apr 02, 2017 17:41
GitHub: matortheeternal
In-game: Mator

Re: [mod] Fractal World Generation [fractal_worlds]

by Mator » Post

the_raven_262 wrote:Thanks for the answer, I don't know about making a spherical fractal in a cubic world, might seem odd, a lot.
Do you plan on using minetest's ore generation or are you going to use the fractal for it?
Also, I have no idea how does that site add colour to the fractals, but as it colours certain sections of the fractal I can guess colouring has something to do with the fractal itself, would be nice to implement biomes this way.
I think the SphereSponge can work in a cubic world so long as I set the minimum sphere radius sufficiently high.

I'm planning on taking both a "natural" approach to biome/ore generation (via MineTest algorithms or similar) and potentially a fractal approach as well. We'll see how it goes once I get there. :)

User avatar
Mator
Member
Posts: 18
Joined: Sun Apr 02, 2017 17:41
GitHub: matortheeternal
In-game: Mator

Re: [mod] Fractal World Generation [fractal_worlds]

by Mator » Post

Added cube tree fractal after taking a bit of a break.

Image

Image

Image

User avatar
the_raven_262
Member
Posts: 315
Joined: Mon Sep 22, 2014 09:30
GitHub: theraven262
IRC: the_raven_262 Raven262 Corvus262 corvus
In-game: the_raven_262 Raven262 Nevermore

Re: [mod] Fractal World Generation [fractal_worlds]

by the_raven_262 » Post

Awesome! I really hoped you didn't abandon this project :)
[amber] [conjuration] [warzone] | Why is #minetest-mod-dev so empty?

Post Reply

Who is online

Users browsing this forum: Nathan.S and 5 guests