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.

DarkBASIC Discussion / PG Island

Author
Message
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 27th Jan 2013 07:45 Edited at: 7th Jul 2013 03:35


I've been toying with procedural generation a lot recently but this is the first time I've come up with my own algorithm from scratch.
I'm very pleased with the results.
[edit: code updated]
Fluffy Rabbit
User Banned
Posted: 27th Jan 2013 09:13
Your islands look very nice. I think it would also look very cool in 3D. Assuming your code generates a heightmap and you know how to use the matrix mesh library, you just pop in some generic transparent plane for the surface of the water and you're all set. There could also be a clone of the matrix with a repeating grain/static texture to give it detail up close.
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 27th Jan 2013 17:38
That's a good point, yes the map(x,y) array stores a "height" value (currently 0 to 255). I see two issues though: matrices can only be about 70x70 resolution, and texturing would be difficult.

Meanwhile...
Fluffy Rabbit
User Banned
Posted: 28th Jan 2013 02:41
@OBese87-

Luckily for you, there is an exact library that I had in mind. It allows you to use blanket textures and heightmaps of any resolution.
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 28th Jan 2013 09:36
Thanks, I'll take a look.

Meanwhile...
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 29th Jan 2013 07:35 Edited at: 29th Jan 2013 07:40
I've redone the colouring and it looks much better. It's all trial and error though, I wish I knew a proper formula for getting nice colours.

Now to try with those matrices...

Meanwhile...

Attachments

Login to view attachments
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 30th Jan 2013 20:16 Edited at: 30th Jan 2013 20:18
I thought I posted on here before... hmm...

OBese87 - can you export a 2048x2048 texture? [or 4096x4096 even]

EDIT

Realised why I gave posting a miss... this is for DBC which I have but used for 5 minutes or so...

Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 31st Jan 2013 14:48 Edited at: 31st Jan 2013 14:48
Made a few tweaks to the code and colours. Added a gradient function to get smoother colour transitions.

Meanwhile...

Attachments

Login to view attachments
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 31st Jan 2013 14:59
OBese87 - Hmm, 3DWS is giving me issues with loading height maps... I will try converting that sample and see if I can create anything with it... just to show how it looks in other applications, such as 3WS

Phaelax
DBPro Master
20
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 1st Feb 2013 22:19
Very cool, it indeed looks like an island. And the code seems relatively simple. (works in DBP btw)

"You're not going crazy. You're going sane in a crazy world!" ~Tick
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 2nd Feb 2013 01:36
Thanks! Yeah I was surprised when it worked fine in DBP, that is rare for my DBC code.

Meanwhile...
HomerS
16
Years of Service
User Offline
Joined: 8th Apr 2007
Location:
Posted: 7th Mar 2013 22:59
verry nice coding!

can you make it to a matrix and post your code here too?

that would be nice, i am not so good with the matrix programming.

greetings!

Toedeledoki

Login to post a reply

Server time is: 2024-03-29 08:46:42
Your offset time is: 2024-03-29 08:46:42