Terrain Source Code

Community Forums/Showcase/Terrain Source Code

Pete Rigz(Posted 2005) [#1]
I started this last year sometime but stopped working on it for various reasons. Picked it up again a few days ago and thought I may aswell release the source for it.

The code is a bit of a mess, I started off knowing very little about terrain engines and botched my way through so the codes ended up a bit like a scrap book of ideas. I wouldn't expect anyone to be able to use this in a game but there should be a few ideas and methods you might be able to take from it. It's got quite a few features like colour map generation, level of detail, possible visible sets for occlusion vertex alpha for texture blending and the end result aint bad. You can see my worklog for further details here.

I've inlcuded 3 examples, see example_iceworld.bb, example_tropics.bb and example_2048colourmap.bb. Theres also the corresponding files that compiled and saved those maps named complilerfor_iceworld... etc

The controls are w,a,s,d or cursors to move. Hold space to fly about quickly. F1 to switch on a grid that shows you which terrain tiles are being hidden/shown. F3 to toggle PVS on or off and q for wireframe.

Some screens:







ckob(Posted 2005) [#2]
downloading now. If it looks as good as those screenshots...wow thanks :)


Picklesworth(Posted 2005) [#3]
I remember this from the worklogs I think :)
Downloading now... I'm excited!


Edit:
Played around with the examples for a few minutes now... I really like how you appear to have multiple texture detail layers, so when the camera gets closer to the terrain the textures still look good.


puki(Posted 2005) [#4]
Me too - looks super-interesting - a bit like me.

EDIT:
Yehhhhhh!!!

Just had a quick go on the demos - I've got to go to bed now (sniff), but this looks pretty neat stuff to me - I swear I saw a blade of grass twitch in the breeze - perhaps it was nudged by a small ant foraging?


ckob(Posted 2005) [#5]
how did you make these terrains I see there are a few files in their did you use a specific modelling program or terrain modeller?


Zmatrix(Posted 2005) [#6]
Very nice, really fast.
thanks for the source :)

Zmatrix


IPete2(Posted 2005) [#7]
looks good - downloading now...

IPete2.


Filax(Posted 2005) [#8]
Ouaouhou ! great !


Braincell(Posted 2005) [#9]
First i couldnt get it to work cos i was in debug mode (lol) and i compiled the "compiler" so too much time to generate. Now i got it working :)

Best terrain i've seen in Blitz that is for sure. Congrats Pete Rigz!

edit: oh hold on, this isn't terrain "generation" , you are using an existing height map and some colour maps. Oh too bad :( i was hoping this was being generated. Well, i can still learn about PVS and nice texturing.


OJay(Posted 2005) [#10]
so the real question here is: how to generate those colormaps? or did you rip them off somewhere?


Pete Rigz(Posted 2005) [#11]
Thanks for the comments all.

This is terrain generation from heightmaps. It takes a heightmap - in this case ones I made in photshop with the cloud filter - and then it generates the geometry, colour maps, pvs data etc etc in code from that heightmap. All of the source for this stuff is in the sourcev12.bb file.

I probably explain what it does a bit better in my worklog.


OJay(Posted 2005) [#12]
hm. in that case....wheeee O_O

i'll must have a deeper look into this...when i find time ^^

great work then, and thanks for sharing!


jfk EO-11110(Posted 2005) [#13]
cool stuff. thanks for sharing!


TartanTangerine (was Indiepath)(Posted 2005) [#14]
That looks pretty F'Ing cool (ban me!) Why did I not see this earlier?


TartanTangerine (was Indiepath)(Posted 2005) [#15]
Heh, noticed filax up there. New release soon eh Filax?

Dang! I know I should have licensed that Shadow code! For those of you who don't know "Flynn" thats me back before Indiepath!!!! Dang Dang Dang!

First 3 lines of the code
;tx Terrain builder by Peter Rigby

;Light mapper and Normal mapper by Flynn



QuickSilva(Posted 2005) [#16]
These are some great terrains, real nice stuff. I sure hope that someone adds this to an editor of some sort, hint hint Filax :) Would make a nice addition to TerraED.

Jason.


Alienforce(Posted 2005) [#17]
WOW!!! Great work....


Picklesworth(Posted 2005) [#18]
An excellent terrain editor that could be used along with this:
http://www.blitzbasic.com/Community/posts.php?topic=52132


John Blackledge(Posted 2005) [#19]
Nice work Pete.
Any plans to make this more general purpose?
(Standalone editor? Payable?)


OJay(Posted 2005) [#20]
just want to inform you, that i've started an freeware opensource editor for this.

Do you want to know more? :)


Pete Rigz(Posted 2005) [#21]
Cool, best of luck with that Ojay, it's cool to see some good use out of it. I'll try my best to answer any questions you might have about the "inner workings"

John, thanks for the comment, I'm finished with this system now so I doubt I'll add anything more to it.


Chroma(Posted 2005) [#22]
Link won't work...can someone mirror this or can you look into hosting it from another place Pete? Thanks.


OJay(Posted 2005) [#23]
if it is ok, i would mirror it on my server: http://ftp.eqil.de/txLandScapes.rar (~21MB, i've included executables for the 3 samples for the 'not 3D blitzers' :) )


John Blackledge(Posted 2005) [#24]
Go for it Ojay - nice one!


Pete Rigz(Posted 2005) [#25]
Cheers Ojay, my webhost was experiencing a temporary hitch, it should be back up again now.


Chroma(Posted 2005) [#26]
Cool I see my vector lib in there. =D

This is some very cool work. It's perfect for cruising over in a plane! Great work Pete.


jhocking(Posted 2006) [#27]
Looks very good; I'll have to check this out.


QuickSilva(Posted 2006) [#28]
These are definately the best looking terrains by far that I have seen produced with Blitz3D.

Jason.


Panno(Posted 2006) [#29]
thx


Filax(Posted 2006) [#30]
Hi :)

Don't panic Indiepath i'm working on :)


Red Ocktober(Posted 2006) [#31]
wow... super impressive!!!

--Mike


Defoc8(Posted 2006) [#32]
impressive :]


GrumpyOldMan(Posted 2006) [#33]
Hi All

The download link for this http://82.110.105.17/peterigz.co.uk/files/txLandScapes.zip is broken. Is anybody aware of anywhere else it's available?

Cheers

GrumpyOldMan


Pete Rigz(Posted 2006) [#34]
Hello, I had to take the file down because of bandwidth limits, I'd uplaod again but haven't the file at hand atm, however Ojay a few posts above kindly mirrored it and that link still appears to work.


WedgeBob(Posted 2006) [#35]
Yeah, I can see a nice military-style shooter out of this. Thanks for the release of this! Did you get any aid from TerraGen or L3DT per chance, or any tools like that, or was this stand alone with standard Photoshop, and B3D's built-in tool for terrain?


Chroma(Posted 2006) [#36]
Someone was making a terrain editor for this...but I think they didn't have the ability to finish it.

Was hoping to it would see the light. =(