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.

Work in Progress / Magrathea - An automatic landscape creator

Author
Message
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 13th Sep 2007 17:23
Magrathea


Magrathea is the homeworld of the magratheans. People who design worlds and landscapes. The most notable of which is Slartibartfast. Of course, anyone that has read 'The Hitch-hikers Guide To The Galaxy' will already be completely aware of this.

So, Magrathea: As the name suggests is a designer of worlds. When complete you will be able to create game-ready landscapes with the click of a single button. Of course, with the click of a few more buttons and perhaps the wave of a magic wand* you can customize the world to suit your needs.

So, What have I done so far and what is left to do?

Key:
= Done
= In Progress
= Coming soon

Designed the layout
Import height maps
Import detail maps
Import texture maps
Create texture layers
Blend texture layers
Combine layers to form new texture map
Save new combined texture maps
save/load project
Walk on newly created world
Auto texture map - One click texture map (the image in the screenie used this)

Create height maps - using the diamond/square algorithm
Create themes allowing the user to automatically create a particular style of world (tropical islands, mountainous desert, alien etc.)
Auto height map - should be very quick one the above is complete
Auto terrain - Again very quick solution
Create code - Once you are happy with your new world, Magrathea will output DBP code and media so that you can instantly create a stand-alone exe to walk on your new world




*I can't guarantee that waving a wand will achieve anything



tha_rami
18
Years of Service
User Offline
Joined: 25th Mar 2006
Location: Netherlands
Posted: 13th Sep 2007 17:46
Whoa. I think you should put in Wii-mote support to actually achieve the magic wand thing. Looking very cool there . Fun introduction to, loved the dryness of the topic.

Jeff032
17
Years of Service
User Offline
Joined: 13th Aug 2007
Location:
Posted: 13th Sep 2007 18:38 Edited at: 13th Sep 2007 18:38
That looks really nice, good work

[EDIT]Do you plan to make it free?

-Jeff

Space Game WIP
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 13th Sep 2007 19:33
WOW! Now that looks good

Would this support animated water in some form?

What world sizes will it support? This looks like quite a small map with low texture detail.

Just curious as I'm not very likely to use this any time soon, I'm working on a 2D project.

You have a bug in your layout, can you see it?

[center]
CREATE games with ease! NO programming required!
WIP
nackidno
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Där solen aldrig skiner
Posted: 13th Sep 2007 20:05
Great job!

Footsteps W.I.P

[url=nackpro.se.nu]my website[/url] It's swe!
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 13th Sep 2007 23:35
Quote: "Do you plan to make it free?"

Probably, I haven't charged for anything yet.

Quote: "Would this support animated water in some form?"

Evolved's Fresnel water would be included if you choose to output the code.

Quote: "What world sizes will it support?"

The height map can be any size, limited only by RAM
The texture size from 64 x 64 up to 4096 x 4096.
The screenie has a heightmap size 256x256 and a texture size 256x256, so it does look quite lo-res.

Quote: "Great job!"

Thank you



GatorHex
19
Years of Service
User Offline
Joined: 5th Apr 2005
Location: Gunchester, UK
Posted: 14th Sep 2007 02:04 Edited at: 14th Sep 2007 02:25
Scraggle thats top work. You always make class stuff.

I'd put the water layer as a seperate tranparent plane cutting throught the landscape.

If we could position objects on the world that would really be the cats wiskers

I'm not sure why the path is on seperate layer, but it would be cool if you could use that layer for rendering object shadow instead.

DinoHunter (still no nVidia compo voucher!), CPU/GPU Benchmark, DarkFish Encryption DLL, War MMOG (WIP), 3D Model Viewer
Mr Kohlenstoff
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Germany
Posted: 15th Sep 2007 12:59 Edited at: 15th Sep 2007 13:00
Looks fantastic. What exactly will "Auto Heightmap" do? Create a random heightmap, or will you also be able to use different parameters to define how the result will look? And will your editor support lightmapping? That would be great. And another aspect is realtime heightmap-changing, in 2D (Drawing onto the heightmapimage) or 3D (Vertex-whatever-manipulation), or would that be against the programs intention? However, it looks great.

Edit: by the way, I've read this hitchhiker's guide through galaxy this summer, good choice.

zzz
18
Years of Service
User Offline
Joined: 13th Nov 2005
Location: Sweden
Posted: 16th Sep 2007 22:22
Quality stuff Scraggle, I like the name of the program!

WII number: 8220 5043 6939 7393
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 23rd Sep 2007 11:44 Edited at: 23rd Sep 2007 11:44
Quote: "I'd put the water layer as a seperate tranparent plane cutting throught the landscape."

That is how it works. Showing the water on the texture preview is just to give an idea of where the water will be and is 'turnoffable'.

Quote: "If we could position objects on the world that would really be the cats wiskers "

That is beyond what I had in mind. This will be a landscape creator only.

Quote: "I'm not sure why the path is on seperate layer"

It isn't.
At least not in the way that you seem to be thinking.
All textures are given a 'layer' until the final texture is created. This 'layer' will have an alpha map based upon start height, end height and slope values. This alpha map is then used to 'cut-out' the texture and blend it with all other layers to produce a final texture.

Quote: "What exactly will "Auto Heightmap" do?"

Auto Height Map: A one click solution for creating height maps. The height map will be a completely random creation allowing no input from you. If you want to have a say in how the height map is created then you can. There are many parameters that you can change to create new custom height maps but not using Auto Height Map.

Auto Texture Map: Once you have a height map that you are happy with, you can select Auto Texture Map to automatically generate a texture. The texture created will be based upon height and slope values and theme.

Auto Terrain: This is a combination of Auto Height Map and Auto Terrain. It is a one-click feature that will create a totally random world. It's a very fast solution but allows no input on how your world will look. If you have an idea of what your world should look like then you should go the long way around and enter all the parameters manually but if you need quick ideas then this is ideal.



Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 6th Nov 2007 18:07
How did I miss this? Looks impressive.

Have you sorted out the fractal terrain thing? I've posted some code somewhere which uses the diamond-square algorithm.
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 7th Nov 2007 15:25
Thanks GG.

I can't tell you how you missed it but you aren't missing much at the moment.

I got a little lost with the diamond square algorithm and then another project got my attention. If you can help with the algorithm then that would be insentive enough to complete this. It isn't that far off completion really and the project that has my attention now would actually benefit from having this finished.

I search the forum but couldn't find the code you posted anywhere.

Any help is, as always, greatly appreciated.

Thanks



Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 7th Nov 2007 21:44
@ Scraggle,

These links may help a bit...

http://forum.thegamecreators.com/?m=forum_view&t=68577&b=6

http://forum.thegamecreators.com/?m=forum_view&t=108844&b=1

some links within those too - the first one is GGs helpful hints for me a while back..



a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 8th Nov 2007 22:58
@Duffer

Thanks, that's the one I had in mind.

@Scraggle

Quote: "If you can help with the algorithm then that would be insentive enough to complete this."


Certainly, just shout.
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 9th Nov 2007 02:31
Thanks guys, I will have a play with the code this weekend



Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 9th Nov 2007 08:36
@ Scraggle,

No worries.

If you can do it, seamless height/terrain maps are damn useful - so you can patch all together to make an entire continent or whatever.

Code export that also places your water (n shader) would be excellent.

Good luck with the diamond square algorithm.

It's much quicker than the 'hill' algorithm.

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
Kieran
18
Years of Service
User Offline
Joined: 6th Aug 2006
Location: Hamilton, New Zealand
Posted: 9th Nov 2007 11:02
Excellent work Scraggle, good job.

Visit The Aex.Uni Forums

Chris Ritchie
18
Years of Service
User Offline
Joined: 7th Jan 2006
Location: Norn Iron
Posted: 10th Nov 2007 02:49
keeping a close eye on this as Im always looking for the next big thing when it comes to terrains, good work so far.


Lead programmer ULIDIA
Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 11th Nov 2007 21:08
@ Scraggle,

How goes it? Did the code links help?

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 11th Nov 2007 21:47
@Scraggle

I've had a look at my old diamond-square code and it looks a bit tired now.

I've revamped it a bit for heightmaps. It gives you 766 different possible heights (=255*3+1) and there is an option for it to be seamless.

The output is an (almost) grey scale image and you get the height by adding all three RGB components.

The code could probably be improved further - let me know if you need any changes.

One addition might be to make the heightmap rougher with increasing altitude - probably my next refinement (other than code optimisation which this version desperately needs ).

Here's the new code:

Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 11th Nov 2007 22:32
Wow, this looks great, nice job . So does it export the map as a .x object?


Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 11th Nov 2007 23:25
Quote: "So does it export the map as a .x object?"


Are you asking about my code - or Scraggle's?

My code just exports a heightmap as an image.
El Goorf
18
Years of Service
User Offline
Joined: 17th Sep 2006
Location: Uni: Manchester, Home: Dunstable
Posted: 13th Nov 2007 11:42
i once coded such a thing for the nvidia competition, but it started to fall apart when i tried generating the rivers. do you also plan on automatic river generation? what i tried to code was an algorithm that would randomly pick a source (more likely to start in higher ground), and then for each step along the river, check for 7 directions around (8 points around minus the direction the river came from) and then, decide which direction was the steepest, and the river would take that path for one unit, then repeated until it reached my defined sea level. however, this was all fine and dandy until it ran into a ditch in the ground, and the only directions were up.

of course in the real world, this would fill up the ditch to form a lake, and then overflow down a new path, but i could never seem to get this bit to work.

if you find a way to solve this (assuming you are implementing rivers in your random world generator), you're gonna release the code (or at least the jist of the algorithm) right?

http://notmybase.com
All my base are not belong to anyone.
Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 14th Nov 2007 00:47
@GG,
That code is so damn quick! But if you type in 16 for the power of 2 it throws a wobbler...?

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 14th Nov 2007 12:27
Quote: "But if you type in 16 for the power of 2 it throws a wobbler...?"


Hardly surprising, 2^16 = 65536 which means you are asking the program to create a 65536x65536 image, i.e. approx 17180 megabytes assuming 4 bytes for each pixel!! Perhaps you should try a smaller value ...
Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 14th Nov 2007 20:56
whoops

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 17th Nov 2007 06:15
@ Scraggle - how goes it?

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 17th Nov 2007 08:58
Disasterously!

I found in bug in BlueIDE2 which caused it to eat source code and guess what got eaten!
It didn't eat the include files, so all of the front end is still intact but I have lost everything else. I will try to find time to rewrite it whilst it is still fresh in my head.



Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 17th Nov 2007 09:51
The default editor makes backups of the code, doesn't BlueIDE 2 do so as well?


Cheers,

-naota

"I'd newbie slap here, but I've no idea how far I'd need slap before they'd come back with a clue." - VanB
Aex.Uni forums
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 17th Nov 2007 12:53
Quote: "The default editor makes backups of the code, doesn't BlueIDE 2 do so as well?"


That was my thought too.

As a matter of routine, if I'm working on a major program, I work on a copy of the code just in case either I or the editor does something silly (and cats have been known to stomp on the keyboard at critical moments too ).

The downside to that is that I often end up with a collection of versions and it isn't always obvious which is the current best one if I return to the project after a gap (some are just experiments rather than real new versions).

In theory I keep a back-up of everything important on my laptop - in practice the PC's CD writer is unreliable so the backup doesn't always happen. It's usually quicker and safer to e-mail the stuff to myself and collect it on the laptop.

But even that ploy isn't fool-proof as I've discovered ...

Of course, you could follow Lee's advice from a recent newsletter.

Anyway, let's hope you get it sorted soon.

Didn't something like this happen to you once before?

They say "once bitten, twice shy" - but in my experience programmers seem to be immune to that particular "bite".
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 17th Nov 2007 14:17
I turned off the save backups feature because I kept a version on my laptop and my main PC, so it seemed like a waste of space. The trouble is that when I find out that I couldn't load the source anymore on one PC, I tried the same thing on the other and lost both versions.

... Backups are now turned back on!

Quote: "Didn't something like this happen to you once before?"


I lost the Roughnecks folder with all code and media when it was very nearly complete. That wasn't an IDE eating it though, that was a cat sleeping on the keyboard.



Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 17th Nov 2007 18:40
if that was the last thing you compiled it should be in DBP folder>TEMP>full source dump


Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 17th Nov 2007 20:40
@ Scraggle - sorry I asked

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 17th Nov 2007 21:57
Yes, it was all your fault.

Login to post a reply

Server time is: 2024-09-29 22:34:20
Your offset time is: 2024-09-29 22:34:20