Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Perlin Noise

Author
Message
T3dd1n0us
12
Years of Service
User Offline
Joined: 24th Aug 2011
Location:
Posted: 19th May 2012 14:25
Does anyone have any source code (Tier 1) that can generate planets at run time using permin noise?

Thanks
Matneee
12
Years of Service
User Offline
Joined: 17th Feb 2012
Location:
Posted: 22nd May 2012 19:20
Depends what you mean by "planets", really. A planet image, a 2D cave system like, say, Terraria?

If it's just the latter, it might be easier/quicker to use something like a 4-5 Cellular Automaton. Give the code below a whirl and see if it's anything like what you're after. Sorry it's a bit of a mess and almost completely uncommented, but I've literally thrown it together in the past 15 mins. If it's any remotely like what you're after I'll tidy it up a bit, bung in some helpful pointers and explanations, and generally de-fudge the whole thing.
You'll need to put two images in the project's media folder btw - one called "blank.png" for empty space, and one called "ground.png" for, er, the ground. Both images need to be 16x16 pixels

T3dd1n0us
12
Years of Service
User Offline
Joined: 24th Aug 2011
Location:
Posted: 23rd May 2012 20:03
Thanks Matneee

I am more looking to generate planets as would be see from space.

Something in the line as seen here: http://josiahhester.com/jh/index.php?option=com_content&view=article&id=5&Itemid=5
Matneee
12
Years of Service
User Offline
Joined: 17th Feb 2012
Location:
Posted: 24th May 2012 16:04
Oh OK, I see what you're after. As it happens the code snippet solved a problem I had anyway (i.e - I'm far to lazy to get on with designing maps for the project I'm "supposed" to be working on) so it'll get used anyway.

I've been meaning to look at Perlin noise for a while as it happens. I've got some spare time in a couple of weeks, so I might take a prod at it again - the hard part is probably getting it to run fast enough to be practical, but I think a lot of that is down to what smoothing method you use (also a 'revision' of the Perlin algorithms known as Simplex noise might be worth looking at). I'll let you know if anything decent comes of it. It looks like there's some decent code on the DBpro forums about perlin btw - they look like they wouldn't take that much to get working in AppGameKit (then again I've never tried, so I might be telling colossal fibs there...)

Login to post a reply

Server time is: 2024-04-28 04:40:41
Your offset time is: 2024-04-28 04:40:41