Allegro.cc - Online Community

Allegro.cc Forums » Game Design & Concepts » Fractal Brownian Motion

This thread is locked; no one can reply to it. rss feed Print
 1   2   3 
Fractal Brownian Motion
OICW
Member #4,069
November 2003
avatar

Allright after some time spent improving the generator and texturing here come results.
{"name":"screenshot004.png","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/c\/2\/c2ff30ec4ed3d103acc4c3267e38d82a.png","w":802,"h":628,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/c\/2\/c2ff30ec4ed3d103acc4c3267e38d82a"}screenshot004.png
{"name":"huge-planet.png","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/a\/4\/a49041057d4ed648061a7a669f19b9bf.png","w":802,"h":628,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/a\/4\/a49041057d4ed648061a7a669f19b9bf"}huge-planet.png

[My website][CppReference][Pixelate][Allegators worldwide][Who's online]
"Final Fantasy XIV, I feel that anything I could say will be repeating myself, so I'm just gonna express my feelings with a strangled noise from the back of my throat. Graaarghhhh..." - Yahtzee
"Uhm... this is a.cc. Did you honestly think this thread WOULDN'T be derailed and ruined?" - BAF
"You can discuss it, you can dislike it, you can disagree with it, but that's all what you can do with it"

Michał Cichoń
Member #11,736
March 2010

Nice one.

"God starts from scratch too"
Windows Allegro Build Repo: http://targonski.nazwa.pl/thedmd/allegro/

Slartibartfast
Member #8,789
June 2007
avatar

Yodhe23
Member #8,726
June 2007

Nice images, though totally unrealistic worlds, you just don't get mountain ranges that big, "atomspheric drag" amongst other things would be enormous.... There tends to be reasons most worlds seem to have a roughly spherical shape.
The question is whether you are going the artistic, or realistic route...

Nice work though, keep it up, and there might be a cookie and glass of milk at bedtime for you. :D

www.justanotherturn.com

LennyLen
Member #5,313
December 2004
avatar

My name is on those screenshots.
Yet I see no beautiful fjords...

They were removed as an awards category I believe.

Arthur Kalliokoski
Second in Command
February 2005
avatar

Yodhe23 said:

"atomspheric drag" amongst other things would be enormous....

What? So it'd cut down on the winds...

The only way Trump is going to be involved in a landslide is if the land surrounding the White House collapses into the Earth's core. -- bamccaig

Thomas Fjellstrom
Member #476
June 2000
avatar

It might actually stir up the winds, the mountains would whip through the atmosphere, pushing it around.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Arthur Kalliokoski
Second in Command
February 2005
avatar

Uh, doesn't the atmosphere rotate with the planet? Convection currents are altered by Coriolis forces, but that's just a detail.

The only way Trump is going to be involved in a landslide is if the land surrounding the White House collapses into the Earth's core. -- bamccaig

Thomas Fjellstrom
Member #476
June 2000
avatar

Uh, doesn't the atmosphere rotate with the planet? Convection currents are altered by Coriolis forces, but that's just a detail.

Not at the same rate afaik.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Arthur Kalliokoski
Second in Command
February 2005
avatar

If the atmosphere didn't rotate with the Earth, Mt. Everest would be making quite the sonic boom, and Cat 5 hurricanes wouldn't hold a candle to the prevailing winds.

The only way Trump is going to be involved in a landslide is if the land surrounding the White House collapses into the Earth's core. -- bamccaig

OICW
Member #4,069
November 2003
avatar

Yodhe23 said:

The question is whether you are going the artistic, or realistic route...

The former. The second shot is closeup zoom of another planet with radius of 100 units and maximal height of 20 which is quite exaggerating. Everything except terrain textures is procedurally generated even positioning of dryer and wetter places, which provides unrealistic locations. But what the hell :)

My name is on those screenshots.

Yep, all in all it's the planet generator :)

[My website][CppReference][Pixelate][Allegators worldwide][Who's online]
"Final Fantasy XIV, I feel that anything I could say will be repeating myself, so I'm just gonna express my feelings with a strangled noise from the back of my throat. Graaarghhhh..." - Yahtzee
"Uhm... this is a.cc. Did you honestly think this thread WOULDN'T be derailed and ruined?" - BAF
"You can discuss it, you can dislike it, you can disagree with it, but that's all what you can do with it"

Billybob
Member #3,136
January 2003

But you're system is looking fucking great so far.

Thank you!

Quote:

It's this enormous procedural project being coded by the Admin

:o Beautiful work they've done! I envy it.

OICW said:

Allright after some time spent improving the generator and texturing here come results.

Very nice. I like it a lot 8-) I bet it would look great with some clouds (with shadows) and an atmosphere shader.

As for my puny little project, I've improved working with the machines a bit, so installing and uninstalling them is easy. They can be crafted and consume resources to craft. Planets have a few more resources that can be mined, like Crude Oil. The player can now also craft resources from other resources, like turning Crude Oil into plastic, which is used to create Circuits, which is needed for crafting Machines :)

And then, of course, Markets!

{"name":"601863","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/8\/2\/82bd5bff7fcda668b7cd2558b2237009.png","w":1040,"h":806,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/8\/2\/82bd5bff7fcda668b7cd2558b2237009"}601863

Prices are chosen by a dumb AI based on a proxy for Supply and Demand. I need to add NPCs now so that there are other people mining and using the markets. Hopefully I can get a somewhat interesting economy going soon.

SiegeLord
Member #7,827
October 2006
avatar

I really hate when these beautiful games are ruined by people adding lame gameplay to them :P That's why I still feel like Noctis is unparalleled at the proceduraly generated universe genre.

Something for a future project of mine, no doubt, heh.

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

mEmO
Member #1,124
March 2001
avatar

This looks very cool, but I'm slightly worried that you're actually trying to make real world progranisms to conquer the universe...

---------------------------------------------
There is only one God, and Connor is his son!
http://www.memocomputers.com
Happy birthday!

Johan Halmén
Member #1,550
September 2001

OICW said:

Allright after some time spent improving the generator and texturing here come results.

That's beautiful. But the mountain range forms a very straight line there. I had exactly the same problem. My algo was based on triangulating a icosahedron.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Years of thorough research have revealed that the red "x" that closes a window, really isn't red, but white on red background.

Years of thorough research have revealed that what people find beautiful about the Mandelbrot set is not the set itself, but all the rest.

OICW
Member #4,069
November 2003
avatar

Billybob said:

Very nice. I like it a lot 8-) I bet it would look great with some clouds (with shadows) and an atmosphere shader.

It would, but that would require someone hacking my fragment shader to incorporate the atmosphere. It's even in the list of things that should be done, but weren't in the specification: realtime atmospheric light scattering. That and better water.

That's beautiful. But the mountain range forms a very straight line there. I had exactly the same problem. My algo was based on triangulating a icosahedron.

Thanks. Well yes, the range is quite straight line, because all the noise added up to the straight line in that region. However on other planets I haven't seen such artifacts. Though I must say that my implementation of Perlin noise has this habit of generating repeating patterns on the sphere.

By the way I have a feeling that I'm doing something similar that you did. Though I begin with a cube and let the algorithm subdivide it. Additinal details are then supplied via normal map, otherwise it doesn't look nearly as beautiful as it looks now.

[My website][CppReference][Pixelate][Allegators worldwide][Who's online]
"Final Fantasy XIV, I feel that anything I could say will be repeating myself, so I'm just gonna express my feelings with a strangled noise from the back of my throat. Graaarghhhh..." - Yahtzee
"Uhm... this is a.cc. Did you honestly think this thread WOULDN'T be derailed and ruined?" - BAF
"You can discuss it, you can dislike it, you can disagree with it, but that's all what you can do with it"

Johan Halmén
Member #1,550
September 2001

Starting with a cube you have 8 vertices on the sphere. And 6 squares. I bet when you have subdivided them enough times, at the original 8 vertices three line segments meet, forming 120°, while at every other new vertex caused by the subdivision you have 4 line segments meeting at 90°. While the cube is a perfect polyhedron, the more complex perfect polyhedron you start with, the smaller will the difference be between the original vertices and the new ones.

When I started with an icosahedron, I had 20 triangles and 12 vertices. After each subdivision I got 4 times more triangles and... um... some more vertices. At the original vertex, 5 line segments meet, so the angle inbetween is 72° in the final (almost) sphere. At each new vertex, 6 segments meet, so the angle is 60°. I tried also with cubes - and other polyhedrons for that matter - but at least with my method the original vertices were too visible in the final image.

I bet your straight mountain range follows somewhat one edge of your original cube. And ends at one original vertex. And at the vertex you might see another line forming a 120° angle.

It might be somewhere here.
{"name":"601866","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/2\/4\/24bb10f0f97d8dffaae54f78efb0106c.jpg","w":802,"h":628,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/2\/4\/24bb10f0f97d8dffaae54f78efb0106c"}601866
The coastline above my red line to the left would support my suspicion.

In this image of mine, that I posted earlier...
{"name":"1523ef0fa16a3394c3811c0d21aa8bca.jpg","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/1\/5\/1523ef0fa16a3394c3811c0d21aa8bca.jpg","w":340,"h":354,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/1\/5\/1523ef0fa16a3394c3811c0d21aa8bca"}1523ef0fa16a3394c3811c0d21aa8bca.jpg
...you might find the vertices where only 5 triangles meet. They are the original ones of the original icosahedron, while at every other vertex you have 6 triangles that meet. This is a very rough model and the only thing that makes the original vertices hard to spot is the great part of flat ocean. Somewhere I have a better image with more subdivisions, but it took days to render.
And now I can't find it.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Years of thorough research have revealed that the red "x" that closes a window, really isn't red, but white on red background.

Years of thorough research have revealed that what people find beautiful about the Mandelbrot set is not the set itself, but all the rest.

OICW
Member #4,069
November 2003
avatar

Your theory is good one, but I'm sorry I have to prove you wrong:
{"name":"mountain-range_blend.png","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/d\/d\/dd6ae851ea93c47a50b325ead423ad46.png","w":802,"h":628,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/d\/d\/dd6ae851ea93c47a50b325ead423ad46"}mountain-range_blend.png

The original vertex is a bit off the mountain range and one of the original edges runs through the range (at one time it was even misaligned). I've blended it with the wireframe view. Though now the coast line has more vertices than necessary because of the sudden drop and error metrics in the algorithm. So it isn't that clearly visible. However it's on the south-east end of that island. When viewing the wireframe one can see six lines coming into one vertex and a triangle forming around it.

The sharpness and straightness is due the way how I've implemented Perlin noise which is then ran through the fBm function. I was inspired by Sean O'Neil's articles up to the point that I've implemented his spherical version of the ROAM algorithm. The original algorithm takes two right triangles and divides them as necessary to create "flat" terrain. In my program I take six such planes, bind them together and add a radius to the vertex heights.

[My website][CppReference][Pixelate][Allegators worldwide][Who's online]
"Final Fantasy XIV, I feel that anything I could say will be repeating myself, so I'm just gonna express my feelings with a strangled noise from the back of my throat. Graaarghhhh..." - Yahtzee
"Uhm... this is a.cc. Did you honestly think this thread WOULDN'T be derailed and ruined?" - BAF
"You can discuss it, you can dislike it, you can disagree with it, but that's all what you can do with it"

Arthur Kalliokoski
Second in Command
February 2005
avatar

Maybe you're all going about this the wrong way by trying to randomize a flat terrain and then trying to wrap it to a sphere.

I'm sure you've all heard about how to tesselate a sphere from a regular solid as finely as you want to achieve a smooth sphere, but here it is anyway.

Once you've done this to the required degree of detail, you could use fractal terrain generation to achieve realistic landscapes. You would use the creation order of the vertices as points to adjust instead of diamonds on a flat map. Of course if you wanted seas, simply "floor" the vertices distance from the center of the sphere and mark as sea level somehow.

I have to confess I haven't looked at Perlin noise at all and have no idea if it would work here.

The only way Trump is going to be involved in a landslide is if the land surrounding the White House collapses into the Earth's core. -- bamccaig

Johan Halmén
Member #1,550
September 2001

This is one image I did with my Fractal Planet generator. It's practically same as my earlier images, only different colours and more generations of subdivisions.
{"name":"601872","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/e\/4\/e48b09d41b9d71c43c094e6f3e71f5ee.jpg","w":1024,"h":768,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/e\/4\/e48b09d41b9d71c43c094e6f3e71f5ee"}601872

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Years of thorough research have revealed that the red "x" that closes a window, really isn't red, but white on red background.

Years of thorough research have revealed that what people find beautiful about the Mandelbrot set is not the set itself, but all the rest.

OICW
Member #4,069
November 2003
avatar

Looks nice. Though the method you use seems to produce really sharp mountain ranges and nothing more.

[My website][CppReference][Pixelate][Allegators worldwide][Who's online]
"Final Fantasy XIV, I feel that anything I could say will be repeating myself, so I'm just gonna express my feelings with a strangled noise from the back of my throat. Graaarghhhh..." - Yahtzee
"Uhm... this is a.cc. Did you honestly think this thread WOULDN'T be derailed and ruined?" - BAF
"You can discuss it, you can dislike it, you can disagree with it, but that's all what you can do with it"

Johan Halmén
Member #1,550
September 2001

Yes. I use exactly the method described in the link that Arthur provided. Midpoint displacement. I could have used another factor to cause softer terrain, but still there would be no variation. Everything looks evenly fractured (except the spherical zero level).

I'd love to add real shadows there. Now each triangle gets its shade depending on the angle to the light source. But that doesn't yet cause shadow casting.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Years of thorough research have revealed that the red "x" that closes a window, really isn't red, but white on red background.

Years of thorough research have revealed that what people find beautiful about the Mandelbrot set is not the set itself, but all the rest.

Arthur Kalliokoski
Second in Command
February 2005
avatar

Yes. I use exactly the method described in the link that Arthur provided. Midpoint displacement.

The point of my post wasn't so much the method to perturb the vertices, but to not have distortions trying to wrap a flat map onto a sphere. Did you do that?

The only way Trump is going to be involved in a landslide is if the land surrounding the White House collapses into the Earth's core. -- bamccaig

Yodhe23
Member #8,726
June 2007

Hi Arthur

Is this the sort of thing you were after
http://www.genekeyes.com/FULLER/BF-1-intro.html
??

www.justanotherturn.com

Johan Halmén
Member #1,550
September 2001

No, I didn't try to wrap a flat map onto a sphere. I only created a polyhedron with some 20,000 triangles, starting from an icosahedron. Each triangle got gouraud shaded.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Years of thorough research have revealed that the red "x" that closes a window, really isn't red, but white on red background.

Years of thorough research have revealed that what people find beautiful about the Mandelbrot set is not the set itself, but all the rest.

 1   2   3 


Go to: