F.L.E open source landscape editor. THREAD #2. first thread http://www.blitzbasic.co.nz/Community/posts.php?topic=37611
F.L.E thread 2
Miscellaneous Forums/Blitz Showcase/F.L.E thread 2 #jhocking. you can just remove the camerafog command to solve your problem. :).
what do you thing of the gui interface, and movements?
@NOEL How are your efforts with overhang creation comming along?
what do you thing of the gui interface, and movements?
@NOEL How are your efforts with overhang creation comming along?
Damn didnt see this, maybe post a moved to this thread in the old one Rif.
TO SOLVE THE RESOLUTION THING BEING TO SMALL .. you can simply change graphics3d 640,480,32,2 into
graphics3d 640,480,32,3 now you can maximize the window and everything will stretch so you can see it better..
graphics3d 640,480,32,3 now you can maximize the window and everything will stretch so you can see it better..
last update until tomorrow night at best
download old version
www.hoverhavok.mmocrafter.com/FLE_GUI_RIF.ZIP
then update the fle folder with these 3 files
http://www.hoverhavok.mmocrafter.com/fle.bb
http://www.hoverhavok.mmocrafter.com/flegui.bb
http://www.hoverhavok.mmocrafter.com/gui3.png?http://www.hoverhavok.mmocrafter.com/gui3.png
adds a menu that allows you to select terrain resolution.. meaning how many segments are in it.
download old version
www.hoverhavok.mmocrafter.com/FLE_GUI_RIF.ZIP
then update the fle folder with these 3 files
http://www.hoverhavok.mmocrafter.com/fle.bb
http://www.hoverhavok.mmocrafter.com/flegui.bb
http://www.hoverhavok.mmocrafter.com/gui3.png?http://www.hoverhavok.mmocrafter.com/gui3.png
adds a menu that allows you to select terrain resolution.. meaning how many segments are in it.
RifRaf: remove the ? from the end of the bottom link :)
there ya go.
heres a shot of a mountain top cave made in F.L.E using my pull function. am still tweaking this ability.
http://www.hoverhavok.mmocrafter.com/cavetest.jpg?
heres a shot of a mountain top cave made in F.L.E using my pull function. am still tweaking this ability.
http://www.hoverhavok.mmocrafter.com/cavetest.jpg?
A sidenote:
Working with FLE gave me some new motivation to optimize some grass functions. Currently I got a system working that is using 4 million virtual Grass quads. Physicly there are only 400 in use, just positioned around the camera, using entityAutoFade to fade from grass to nongrass. This prevents the grass poping in and out pretty well. I got 4 Million precalculated positions and rotations for the quads, stored in a 2d array, so I only got to calculate the player position inside the array. Works very well, is really fast.

EDIT:
Then again you should consider: 4 mio positions and rotations are eating 80 megabytes of ram (flag,x,y,z,pitch), tho probably this could be otimized a bit by packing multiple values into some longs, eg. the flag and pitch together surely don't need more than 16 bit... I also tried to use a system that created the positions using location-initialized random-seed, but unfortunately there is a small pause whenever the player crosses the border between 2 clusters, that is about every 20 "meters".
Working with FLE gave me some new motivation to optimize some grass functions. Currently I got a system working that is using 4 million virtual Grass quads. Physicly there are only 400 in use, just positioned around the camera, using entityAutoFade to fade from grass to nongrass. This prevents the grass poping in and out pretty well. I got 4 Million precalculated positions and rotations for the quads, stored in a 2d array, so I only got to calculate the player position inside the array. Works very well, is really fast.

EDIT:
Then again you should consider: 4 mio positions and rotations are eating 80 megabytes of ram (flag,x,y,z,pitch), tho probably this could be otimized a bit by packing multiple values into some longs, eg. the flag and pitch together surely don't need more than 16 bit... I also tried to use a system that created the positions using location-initialized random-seed, but unfortunately there is a small pause whenever the player crosses the border between 2 clusters, that is about every 20 "meters".
Real nice, jfk.
Like I said before, the only real problem is the lower layers clipping into the top layers. I'm really not sure how to fix this problem, but it's bugging the living hell out of me.
@NOEL How are your efforts with overhang creation comming along?
Like I said before, the only real problem is the lower layers clipping into the top layers. I'm really not sure how to fix this problem, but it's bugging the living hell out of me.
JFK, can i get my hands on that grass system? :) and where did you get those trees. :)
ok made some progress on my lunch break, you can now fairly easily create caves.. will tidy up the functions tonight
http://www.hoverhavok.mmocrafter.com/caves.jpg?
http://www.hoverhavok.mmocrafter.com/caves.jpg?
It's all looking very promising.
One thing that sticks out like a sore thumb though is the way textures are stretched over the geometry. e.g. caves and pulled geometry.
Could this be easily solved?
It would make the results so much more impressive.
One thing that sticks out like a sore thumb though is the way textures are stretched over the geometry. e.g. caves and pulled geometry.
Could this be easily solved?
It would make the results so much more impressive.
Rifraf, I think this is the best thing you have done so far!!, looks very promising, the head chat program made my PC crash a lot, I'll try this one out, once you release version that has the cool cave making part. ALE killer!
RifRaf - this is the prototype test source so far:
the media used can be found in the FOREST demo from the code archives. The water AnimTexture can be produces with TextureWobbler (toolbox), make a 15*128*128 strip. The skybox is taken from the darkmatter CD, but of course any other Skybox can be used. If you use this in a release, please credit me.
Graphics3D 1024,768,32,1 SetBuffer BackBuffer() ; setup scene Global cam=CreateCamera() CameraRange cam,.05,200 CameraClsColor cam,110,169,180 ;140,160,180 CameraFogMode cam,1 CameraFogRange cam,1,35 CameraFogColor cam,100,169,160 TranslateEntity cam,0,10,0 ; player start position EntityType cam,2 EntityRadius cam,.05,.2 AmbientLight 100,100,100 light=CreateLight() RotateEntity light,25,45,0 Global windwave#,windspeed#=2,windforce#=5 Global land1,land2,sea,landw#,landd#,grassw#,grassd# ; load terrain land1=LoadMesh("test2_1.b3d") land2=LoadMesh("test2_2.b3d") EntityFX land2,32+2 EntityType land1,1 EntityParent land2,land1 landw#=MeshWidth(land1) landd#=MeshDepth(land1) ; init water ---------- sea=CreatePlane() PositionEntity sea,0,3.4,0 EntityColor sea,50,50,50 EntityAlpha sea,.7 watertex=LoadAnimTexture("waterstripc.bmp",0,128,128,0,15) TextureBlend watertex,3 EntityTexture sea,watertex,0 PointEntity cam,land2 ; --------------------- EntityPickMode land1,2 EntityPickMode land2,2 EntityPickMode sea,2 ; precalc grass quad positions and rotations Global x#=0 Global y#=0 Global z#=0 Global grapatch_x=20 ; defines the grass patch size araound the camera Global grapatch_z=20 Dim grasprite(grapatch_x+grapatch_x+1,grapatch_z+grapatch_z+1) grassw#=landw*10.0 grassd#=landd*10.0 Dim gra(grassw,grassd) Dim grax#(grassw,grassd) Dim graz#(grassw,grassd) Dim gray#(grassw,grassd) Dim graa#(grassw,grassd) For j#=0 To grassd Step 2 ; use lower step value for more grass (slow!) For i#=0 To grassw Step 2 x#=(i#/10.0)-(landw/2.0)+Rnd(landw/grassw) z#=(j#/10.0)-(landd/2.0)+Rnd(landd/grassd) p=LinePick(x,100,z,0,-200,0,0) If p<> sea ;=land1 y#=PickedY() gra(i,j)=1 grax(i,j)=x gray(i,j)=y-.05 graz(i,j)=z graa(i,j)=Rand(180) EndIf Next Next ;init grass ----- Global quad quad=LoadMesh("smplquad.3ds") FitMesh quad,-.2,-.1,0,.4,.4,0 EntityFX quad,16 Or 1 grasstex=LoadTexture("grass5f.tga",4 Or 48) ; also try Mode 4 instead of 2! grassbrush=CreateBrush() BrushTexture grassbrush,grasstex SetBuffer TextureBuffer(grasstex) LockBuffer() For j#=0 To TextureHeight(grasstex)-1 For i#=0 To TextureWidth(grasstex)-1 argb=ReadPixelFast(i,j) alph=argb Shr 24 If alph=0 Then WritePixelFast i,j,(argb And $FF000000) Or $449944 EndIf Next Next UnlockBuffer() SetBuffer BackBuffer() PaintMesh quad,grassbrush x#=EntityX(cam,1) y#=EntityY(cam,1) z#=EntityZ(cam,1) UpdateEnviroment2() HideEntity quad ;---------------- .nograss ; init forest ; load trees media ;------------------------- ast0=LoadMesh("ast3.3ds") ; limb & leaf asttextex=LoadTexture("ast1b.png",4) asttex=CreateBrush() BrushTexture asttex,asttextex SetBuffer TextureBuffer(asttextex) LockBuffer() For j#=0 To TextureHeight(asttextex)-1 For i#=0 To TextureWidth(asttextex)-1 argb=ReadPixelFast(i,j) alph=argb Shr 24 If (argb And $ffffff)=0 Then WritePixelFast i,j,$448844 EndIf Next Next UnlockBuffer() SetBuffer BackBuffer() PaintMesh ast0,asttex stammtextex=LoadTexture("stamm.jpg") ; chunk ScaleTexture stammtextex,.2,.1 stammtex=CreateBrush() BrushTexture stammtex,stammtextex ; ;create trees / forest ------------------------- ; it seems the speed is best when mutliple patches are used (it is slower when all trees are added to one single mesh) Dim forest(1000) For jj=-landd/2 To landd/2 Step 10 ; 16 forest-"patches" For ii=-landw/2 To landw/2 Step 10 forest(count_forest)=CreateMesh() For i=0 To 15 x#=Rnd(Float(jj)-1.250,Float(jj)+1.250) z#=Rnd(Float(ii)-1.250,Float(ii)+1.250) p=LinePick(x,100,z,0,-200,0,0) If p<>sea y#=PickedY()+.2 ;TerrainY(terrain,x#,0,z#)+3 If y#>0 And y#<5 ; no trees on hills ; usage: maketree(x,y,z,limb mesh handle, limb tex handle, chunk tex handle,min. height, max. height, max xz size,mode(1 to 3),dense (used as step value)) tree=maketree(x,y,z,ast0,asttex,stammtex,15,40,4.0,3,5) AddMesh tree,forest(count_forest) FreeEntity tree cube=CreateCube() ; add collisonbox to each tree PositionEntity cube,x,y,z ScaleEntity cube,.03,.015,.03 EntityAlpha cube,0.0 EntityType cube,1 EndIf EndIf If KeyDown(1) Then End Next EntityFX forest(count_forest),0 count_forest=count_forest+1 Next Next FreeEntity ast0 count_forest=count_forest-1 For i=0 To count_forest UpdateNormals forest(i) EntityFX forest(i),16 ;Or 1 Next ; eo forest ;skybox TextureFilter "",48 Or 9 sky=LoadMesh("sky01.3ds",cam) EntityOrder sky,1 ClearTextureFilters TextureFilter "",9 EntityFX sky,1 ;Or 8 ;eo skybox Collisions 2,1,2,3 MoveMouse GraphicsWidth()/2,GraphicsHeight()/2 ; ------------------------------------------- MAINLOOP --------------------------------------------- While Not KeyDown(1) TranslateEntity cam,0,-.025,0 If KeyDown(200) Then MoveEntity cam,0,0,.05 If KeyDown(208) Then MoveEntity cam,0,0,-.05 If KeyDown(205) Then MoveEntity cam,.05,0,0 If KeyDown(203) Then MoveEntity cam,-.05,0,0 mxa#=mxa-.25*MouseXSpeed() mya#=mya+.25*MouseYSpeed() If mxa<0 Then mxa=mxa+360 If mxa>360 Then mxa=mxa-360 If mya<0 Then mya=mya+360 If mya>360 Then mya=mya-360 RotateEntity cam,mya,mxa,0 MoveMouse GraphicsWidth()/2,GraphicsHeight()/2 ; water jobs a#=(a#+.001) Mod 1.0 PositionTexture watertex,0,a# If MilliSecs()>=tt tt=MilliSecs()+66 wani=wani+1 If wani>=15 Then wani=0 EntityTexture sea,watertex,wani EndIf ;---- x#=EntityX(cam,1) y#=EntityY(cam,1) z#=EntityZ(cam,1) UpdateEnviroment2() RotateEntity sky,0,0,0,1 UpdateWorld() RenderWorld() Text 0,0,"Tris "+TrisRendered() Flip Wend WaitKey() End ;----------------------------------------------------------------------------------------- Function UpdateEnviroment2() xi#=(x+(landw/2.0))*10.0 zi#=(z+(landd/2.0))*10.0 For j=zi-grapatch_z To zi+grapatch_z For i=xi-grapatch_x To xi+grapatch_x If i>=0 And i<=grassw And j>=0 And j<=grassd j2=j-(zi-grapatch_z) i2=i-(xi-grapatch_x) If grasprite(i2,j2)=0 grasprite(i2,j2)=CopyEntity(quad) EntityAutoFade grasprite(i2,j2),Float(grapatch_x)/13.3,Float(grapatch_x)/6.67 EndIf If gra(i,j)=1 PositionEntity grasprite(i2,j2),grax(i,j),gray(i,j),graz(i,j) ShowEntity grasprite(i2,j2) pitch#=Sin(windwave+x)*windforce# roll#=Cos(windwave+z)*(windforce#/2.0) RotateEntity grasprite(i2,j2),pitch,graa(i,j),roll ;RotateEntity grasprite(i2,j2),0,graa(i,j),0 ; no wind Else HideEntity grasprite(i2,j2) EndIf EndIf Next Next windwave=(windwave+windspeed#)Mod 360 End Function Function maketree(x#,y#,z#,ast0,asttex,stammtex,minh,maxh,maxsize#,mode,dense) ; x,y,z,limb mesh handle, limb tex handle, chunk tex handle,min. height, max. height, max xz size,mode(1 to 3),dense (used as step value) r#=0 ast=CreateMesh() aeste#=Rand(minh,maxh) aestemid#=aeste/2 erster_ast#=Rnd(1.5,2.5) i2=0 For i=0 To aeste ;Step dense i=i2 i2=i2+dense ast2=CopyMesh(ast0) RotateMesh ast2,0,Rand(-30,30),0 h#=Float(i)/3.0 sc#=aeste-(((h)/3))+1 If sc>maxsize Then sc=maxsize Select mode Case 1 ScaleMesh ast2,sc,((i-aestemid)/aestemid)+Rnd(-.2,.2),sc Case 2 ScaleMesh ast2,sc,1,sc Case 3 ScaleMesh ast2,sc,-1,sc End Select ; PositionMesh ast2,0,erster_ast#+h+Rnd(-.5,.5),h/4 ; orig. PositionMesh ast2,-1,erster_ast#+h+Rnd(-.5,.5),-1; current method - not pefect r#=(r+100)Mod 360 RotateMesh ast2,0,r,0 AddMesh ast2,ast FreeEntity ast2 Next RotateMesh ast,0,Rand(0,360),0 EntityFX ast,16+1 stamm=CreateCone(5,0,ast) ScaleMesh stamm,.1+aeste/40,erster_ast#+aeste/4,.1+aeste/40 PositionMesh stamm,0,MeshHeight(stamm)/2-3,0 PaintMesh stamm,stammtex AddMesh stamm,ast FreeEntity stamm ScaleMesh ast,.050,.10,.050 PositionMesh ast,x,y+.075,z Return ast End Function
the media used can be found in the FOREST demo from the code archives. The water AnimTexture can be produces with TextureWobbler (toolbox), make a 15*128*128 strip. The skybox is taken from the darkmatter CD, but of course any other Skybox can be used. If you use this in a release, please credit me.
jfk - use <codebox> instead of <code>. Saves people mousewheels. :)
Maybe the pushed/pulled parts could be subdivided?
This would prevent too stretched triangles.
This would prevent too stretched triangles.
use a little smart pushing.. dont hold push in one place.. move it around in a circle pattern ect.. play with it some and get a feel for it. if you hold it you will pull the same, verts and therefor stretch more.
Subdividing might be a solution, ill try it out and see how high the poly count gets, i imagine it will get insanely high.
Subdividing might be a solution, ill try it out and see how high the poly count gets, i imagine it will get insanely high.
Hi - can someone release the most present version (in full, all files/folders)? I've been trying to piece together from scratch but I'm getting nowhere with all these ZIPs and RARs.
should work nicely if you run the ablend3.bb (bprobably needs to be renamed to FLE_main.bb or something the sooner or the later). You could install this:
http://www.hoverhavok.mmocrafter.com/FLE_GUI_RIF.ZIP
then update
http://www.hoverhavok.mmocrafter.com/fle.bb
and
http://www.hoverhavok.mmocrafter.com/flegui.bb
And then you still need the media files (mainly 6 textures and an example heightmap), that can be found in this older release:
http://www.melog.ch/dl/fle_ablend3.zip
http://www.hoverhavok.mmocrafter.com/FLE_GUI_RIF.ZIP
then update
http://www.hoverhavok.mmocrafter.com/fle.bb
and
http://www.hoverhavok.mmocrafter.com/flegui.bb
And then you still need the media files (mainly 6 textures and an example heightmap), that can be found in this older release:
http://www.melog.ch/dl/fle_ablend3.zip
forget it
im sure nobody minds if you host anyhting , but make sure you know what your puttin up.. what you posted is not the latest version the latest version does have gui, and ive linked it above already.. just textures missing.
Here is newest version with test textures in there.
http://www.hoverhavok.mmocrafter.com/rifraf_fle.zip
http://www.hoverhavok.mmocrafter.com/rifraf_fle.zip
Of course, I meant to take only the textures from the file on my server. Sorry if I wasn't clear enough. Well, after reading it again, I think it was very clear. However.
@jfk , any wya to save the b3d export as a single B3D insstead of 2? does the b3d format allow children meshes to be included, if so we could parent the layer one to the other layers and export that way.. ????
I am not very familar with child nodes inside B3D Files, maybe somebody else may know this. I am only afraid that if you load such a multi-node mesh that includes children using the LoadMesh Command, the children will become Surfaces, so you'd need to load it using LoadAnimMesh. I am not sure about this.
well the weekend is here again. ! ill try to get some hours in on FLE. im still tweaking with it.. trying to get existing functions working better. Current shot here shows a snow scene.
next up.. a mesh dropper so you can decorate the terrain.
HTTP://WWW.HOVERHAVOK.MMOCRAFTER.COM/FLESNOW.jpg?
next up.. a mesh dropper so you can decorate the terrain.
HTTP://WWW.HOVERHAVOK.MMOCRAFTER.COM/FLESNOW.jpg?
Nice Rif, btw sorry I keep missing you online. Ill be around Sat afternoon (late)
You're doing excellent work as always ^^
the snow scene looks very nice. A bit harsh that this wasn't in side the latest newsletter, but anyway.
At some point you can add this to the toolbox IMO. And wasn't there a dedicated Forum for open source blitz projects, by ckob I think?
At some point you can add this to the toolbox IMO. And wasn't there a dedicated Forum for open source blitz projects, by ckob I think?
not sure about the forum, havent read the newsletter yet. ill add it to the toolbox as soon as i get some basic dropper fuctions in there. :) oh, and when i can get it to export to a single b3d, instead of 2
I wouldn't worry too much about the 2-file problem. There are several benefits with 2 files, eg.:
-Do collision detection only with the bottom mesh.
-Do linepicks only with the bottom mesh.
and with the Dropper funtionality I don't know if you really need that, because if you want to make it properly, it will become a huge job. Then you probably also have to include a lot more, like lightmapping, world editing (bonus, medipacks, ammo etc). well, what I want to say is: you better release a perfect Terrain editor without a dropper than a Terrain editor with a halfbaked Dropper. Droppers are pretty project-customized IMHO. Currently it is also easy to load the exported Terrain meshes with an existing Dropper.
I mean, of course, it's your decision. But personally I would use this software for it's genious terrain mapping, and not as a dropper since I already got plenty of them and I also already have choosen the one I like most, and customzed it to work together with my engine.
-Do collision detection only with the bottom mesh.
-Do linepicks only with the bottom mesh.
and with the Dropper funtionality I don't know if you really need that, because if you want to make it properly, it will become a huge job. Then you probably also have to include a lot more, like lightmapping, world editing (bonus, medipacks, ammo etc). well, what I want to say is: you better release a perfect Terrain editor without a dropper than a Terrain editor with a halfbaked Dropper. Droppers are pretty project-customized IMHO. Currently it is also easy to load the exported Terrain meshes with an existing Dropper.
I mean, of course, it's your decision. But personally I would use this software for it's genious terrain mapping, and not as a dropper since I already got plenty of them and I also already have choosen the one I like most, and customzed it to work together with my engine.

good point about the 2 file thing. however i will continue with the dropper, because its somthign i will use myself. it is not that huge of a project ive done them before .. in maptile3d, just have to find a clever way to make it very easy to scale rotate and postision without getting messy gui or controls. I mihgt post the 2 versions, terrain and terrain + dropper.
ok small progress, havent had alot of time to code today.. but i did manage to make a few functions work much better.. first thing i did was make the painting tool paint in more of a circle pattern than a square, then made the randomize texture function work more reliably. meaning the results look much more natural now. heres a pic of a randomized terrain. (rand also paints with circle brush now)
Looking good! Any chance of an updated version to try?
that landscape looks cute Id like to see that in my future game
ill try to get an update posted later tonight.
the circular brush seems to be a very useful thing.
looks nice, keep up the good work Rif =)
well i didint have the energy or time to learn the B3D file format so i just wipped up a FLE loader you can put in your project.. Now to anyone who doesnt know. The FLE editor can EXPORT B3D format, but it will spit out 2 files, one of them is the solid underlayer, the other is a combination of the other layers together. The neatest thing here is you cna set up collisions on JUST layer one if you want and that may speed up the collision checking between objects and terrain.
anyway you can use the fle loader and get it all in one mesh. works like this
MYMESH = LOAD_FLE (" test.fle")
anyway you can use the fle loader and get it all in one mesh. works like this
MYMESH = LOAD_FLE (" test.fle")
;==========FLE LOADER BY RIFRAF ; this will load a .FLE file and save it as a single MESH entity ; to use in your Blitz3D projects ;mouselook function not required.. Just used in this example Dim use_tex$(6) Dim layer(6) Dim layerbrush(6) Dim layertexture(6) Dim layertexscale#(6) Dim l_index(100,100) Dim loadscale#(6) Function assigntexture(ln,texfile$) layertexture(ln)=LoadTexture(texfile$) layerbrush(ln)=CreateBrush() ScaleTexture layertexture(ln),.01,.01 layertexscale#(ln)=.01 BrushTexture layerbrush(ln),layertexture(ln) PaintMesh layer(ln),layerbrush(ln) End Function Function CreateLayer(segs=100,parent=0,ls#=1) mesh=CreateMesh( parent ) surf=CreateSurface( mesh ) brush=CreateBrush(surf) stx#=-.5 sty#=stx stp#=Float(1)/Float(segs) y#=sty For a=0 To segs x#=stx v#=a/Float(segs) For b=0 To segs u#=b/Float(segs) l_index(a,b)=AddVertex(surf,x,0,y,u,v) VertexColor surf,l_index(a,b),255,255,255,0 x=x+stp Next y=y+stp Next For a=0 To segs-1 For b=0 To segs-1 v0=a*(segs+1)+b:v1=v0+1 v2=(a+1)*(segs+1)+b+1:v3=v2-1 AddTriangle( surf,v0,v2,v1 ) AddTriangle( surf,v0,v3,v2 ) Next Next UpdateNormals mesh ScaleEntity mesh,ls#,ls#,ls# Return mesh End Function Function createlayers(lsegments,numlayers) ;lets see if a saved file is stated ;create segments and position them barely away from each other. ;layer #6 being the top layer or surface layer ;if you have more or less layers that im using in this example you ;can just add or remove some texture assignments below For i=1 To numlayers ;To 1 Step -1 layer(i)=createlayer(lsegments,0,lscale) ; TranslateEntity layer(i),(-(lsegments/2)),(i-1)/(lscale*5),(-(lsegments/2)) assigntexture(i,use_tex$(i)) Next ;make 5 top layers alpha ready. leave bottom layer ;as no blending.. so that we dont have ghosting though ;alpha layers into dead space. For i=numlayers To 2 Step -1 BrushFX layerbrush(i),2+32 Next BrushFX layerbrush(1),2 ;parent them all up .. to top layer.. layer 6 ;now you can rotate.. scale ect layer 6 and it will apply ;to all layers ;For i=1 To numlayers-1 ;EntityParent layer(i),layer(i+1) ;Next ; EntityPickMode layer(1),2 End Function Function load_fle(sfilename3$) ; File Requester ; (for a loader filerequester use:) ; sAFilter$ = "Blitz3D (*.B3D)" + Chr(0) + "*.B3D" + Chr(0) + "3D Studio (*.3DS)" + Chr(0) + "*.3DS" + Chr(0) + "DirectX7 (*.X)" + Chr(0) + "*.X" + Chr(0) + "All Files (*.*)" + Chr(0) + "*.*" + Chr(0) ; sFileName$ = DLLGetOpenFileName$("Please select a Mesh File...","",sAFilter$,OFN_HIDEREADONLY Or OFN_FILEMUSTEXIST) ; for more info about the blitzsys read the blitzsys docs from the original distribution ; If sFileName3$<>"" Then FN$=sFileName3$ For i=1 To numlayers If layertexture(i) Then FreeTexture layertexture(i) If layerbrush(i) Then FreeBrush layerbrush(i) If layer(i) Then ClearSurface GetSurface(layer(i),1) FreeEntity layer(i) EndIf Next If fn$<>"" Then If FileType(fn$)=1 Then ;sets get segment size checkf=ReadFile(fn$) numlayers=ReadInt(checkf) lsegments=ReadInt(checkf) ;RuntimeError numlayers+" "+lsegments For i=1 To numlayers use_tex$(i)=ReadString(checkf) loadscale#(i)=ReadFloat#(checkf) ;strip path ; so strip the path For i2= Len(use_tex$(i)) To 1 Step -1 If Mid$(use_tex$(i),i2,1)="" Then use_tex$(i)=Right$(use_tex$(i),Len(use_tex$(i))-i2) Exit EndIf Next Next CloseFile checkf EndIf EndIf createlayers(lsegments,numlayers) For i=1 To numlayers layertexscale#(i)=loadscale#(i) ScaleTexture layertexture(i),layertexscale#(i),layertexscale#(i) BrushTexture layerbrush(i),layertexture(i) PaintMesh layer(i),layerbrush(i) Next lfile=ReadFile (fn$) numlayers=ReadInt(lfile) lsegments=ReadInt(lfile) For i=1 To numlayers junk$=ReadString$(lfile) jnk#=ReadFloat(lfile) Next For i=1 To numlayers s=GetSurface(layer(i),1) vc=CountVertices(s)-1 For v=1 To vc cx#=ReadFloat(lfile) cy#=ReadFloat(lfile) cz#=ReadFloat(lfile) cnx#=ReadFloat(lfile) cny#=ReadFloat(lfile) cnz#=ReadFloat(lfile) ca#=ReadFloat(lfile) VertexCoords s,v,cx,cy,cz VertexNormal s,v,cnx,cny,cnz VertexColor s,v,VertexRed(s,v),VertexGreen(s,v),VertexBlue(s,v),ca# Next Next CloseFile lfile tempmesh=CreateMesh() For i=1 To numlayers AddMesh layer(i),tempmesh FreeEntity layer(i) FreeBrush layerbrush(i) FreeTexture layertexture(i) Next Return tempmesh Else RuntimeError "FLE terrain file not found!" EndIf End Function
This is a nice idea, but tell me how ong does it take to load it this way? (sorry haven't got a 3d-capable machine running right now)
Hey , you're doing a great thing guys.
not long at all.. very fast
This sounds excellent so far.
How will it work culling wise?
I would be interested in using something like this system!
How will it work culling wise?
I would be interested in using something like this system!
well im considering making the fle loader sperate the mesh into x segments so that each segments can be hidden by others. an letting you pass how many segments in the load call. like MYMESH=LOAD_FLE ("test.fle",8) would chop it into 8 segmesnts. all parented to MYMESH so anything you do to MYMESH is done to the children.
Right now im struggling with B3D format.. the vertex colors arent saving for some reason.. anyone have any help to give on this Im just writing vertex colors after vertex positions as stated in the B3D specs.
Right now im struggling with B3D format.. the vertex colors arent saving for some reason.. anyone have any help to give on this Im just writing vertex colors after vertex positions as stated in the B3D specs.
for vert cols, the chunk header needs to be changed to accomodate it first... I forgot which parameter needs changing.
Will we be able to make and edit a long strip? I fancy making a sort of linear overhead scrolling thingy :)
Will we be able to make and edit a long strip? I fancy making a sort of linear overhead scrolling thingy :)
cough -- update! --cough :)
soon as i get vertex color saving done :) ill update, wanted a decent vertex lightmapper in it.
heres a recent shot. you can now paint colors onto the terrain too. this shot is a little extreme just to show it in action, but if you use colors that go with the terrain style it can look really cool. I made a road by painting brown onto the terrain , it looked good, and saved me from having to use another texture layer for the road.
Oh all right...
Currently I am not sure anymore if you have to use values from 0.0 to 1.0 or from 0.0 to 255.0. Simply try both. The ARGB parameter (2) is already set in the MESH chunk, so it should work.
b3dWriteFloat( 1.0 ) ; r (0.0 to 1.0 or 0.0 to 255.0?)
b3dWriteFloat( 1.0 ) ; g (However, must be floats :) )
b3dWriteFloat( 1.0 ) ; b
b3dWriteFloat( 1.0 ) ; r (0.0 to 1.0 or 0.0 to 255.0?)
b3dWriteFloat( 1.0 ) ; g (However, must be floats :) )
b3dWriteFloat( 1.0 ) ; b
0 to 1.
Regarding painting in circle pattern, please consider falloff, that is, the influence is almost zero at the edges and strongest in the middle...
I can't get this to work. Does anyone have a full ready-to-go zip of everything I need?
Did you try this:
http://www.hoverhavok.mmocrafter.com/rifraf_fle.zip
Some comments in the readme file are definitively outdated. I think you need to run "fle.bb"
make sure to run the right bb file. There must be 6 textures and the blitzsys dll. you can also take the media files from this old (no gui, no nothing) release:
http://www.melog.ch/dl/fle_ablend3.zip
If you still got problems, then some of us may need to go down on our knees and please rifraf to compile a release zip that was actually tested in a seperate folder :)
http://www.hoverhavok.mmocrafter.com/rifraf_fle.zip
Some comments in the readme file are definitively outdated. I think you need to run "fle.bb"
make sure to run the right bb file. There must be 6 textures and the blitzsys dll. you can also take the media files from this old (no gui, no nothing) release:
http://www.melog.ch/dl/fle_ablend3.zip
If you still got problems, then some of us may need to go down on our knees and please rifraf to compile a release zip that was actually tested in a seperate folder :)
fle.bb isn't in the above archive www.hoverhavok.mmocrafter.com/rifraf_fle.zip
it has fle_gui but not fle.bb
It's a shame this is so disorganised cos it really looks special.
it has fle_gui but not fle.bb
It's a shame this is so disorganised cos it really looks special.
www.hoverhavok.mmocrafter.com/rifraf_fle.zip
that is the last link i posted, and it is still a good one. the rounded painting is not in that one, but ill upload a new one in a few hours i think
that is the last link i posted, and it is still a good one. the rounded painting is not in that one, but ill upload a new one in a few hours i think
which zip do I download?? I downloaded the last one rifraf posted but I get an error saying this function cant be found
choosenewmap()
comment those lines out and it says im missing rockslope() is there an include or something missing?
choosenewmap()
comment those lines out and it says im missing rockslope() is there an include or something missing?
Rob, I thought I have seen fle.bb in this zipfile. And I was sober.
EDIT it's definitively there, at least in the zip file I downloaded right before I used to post.
EDIT2 - ah, it's ziped with a folder: myprojects\alphablend\withsave
For some weird reason this fle.bb is the only file that is using a path, the other files inside the zip are on the top level.
However, use a filefinder for fle.bb, should be somewhere on your HD.
EDIT it's definitively there, at least in the zip file I downloaded right before I used to post.
EDIT2 - ah, it's ziped with a folder: myprojects\alphablend\withsave
For some weird reason this fle.bb is the only file that is using a path, the other files inside the zip are on the top level.
However, use a filefinder for fle.bb, should be somewhere on your HD.
yeah i found it...i just unzipped it into the main folder
Weird. Thanks lads...
Not sure if this is known of not, but when I load a height map into it it seems fooked up. the black area's as really high and the white are low, its like the mesh is inverted.
Never noticed this. Maybe time for a "invert topology" button then.
havent noticed that either. will look at it. should be very very simple fix though
is it possible to make a thin long strip as opposed to a square terrain?
its very possible, but not coded in there yet
. because FLE can reference the terrain with l_index(x,z) you can in the optimizemesh function(s). Put an IF clause in there that will only copy tiangles inside your desired rectange of the terrain. make sense?
. because FLE can reference the terrain with l_index(x,z) you can in the optimizemesh function(s). Put an IF clause in there that will only copy tiangles inside your desired rectange of the terrain. make sense?
yep certainly does. I would probably try to rewrite it though as it will then allow me to edit it properly without straying out of bounds...
Also, apparently on export strange surface things happen according to Ross.
Also, apparently on export strange surface things happen according to Ross.
Yeah, when i export a terrain, it exports 2 different files. The first file contains the mesh and the first texture, the base one i'd assume. The next file contains the mesh too, but mapped with alphaed textures and such. Seems like the two should be combined.
bloodlocust, you can add that easily too, the BRINGUP() function handles painting, and such, and the ALTERLAND() function does terraforming, you can add a (in rect) check after the linepick and the small area the determines the X,Z values for l_index. if it is not inside your desired rect, just RETURN from the function
whenever I run fle.bb, it says "too many perimeters" and "function not found." is there anyway to fix this?
YES, download the latest version. posted above, and now here again
www.hoverhavok.mmocrafter.com/rifraf_fle.zip
www.hoverhavok.mmocrafter.com/rifraf_fle.zip
It downloaded OK, but fle.bb is all messed up. Even when I get the Inlcude files working, it still messes up. Does that exact link work on your computer? It doesn't on mine...
The fle.bb file is still hidden inside that other folder. IMHO thats very silly and the archive should be fixed... But what do you want for free?
Ross - yes, the first mesh is the bottom mesh, used to kill all Alpha-Z-Order Troubles caused by VertexAlpha of the second Mesh. Simply load both meshes at the same position, then assign EntityFX mesh2,34 to the second mesh.
Rifraf - you really should release the zip with an example bb that shows how to load the Exports, as well as a further example that shows how to load it from the .FLE file.
Rifraf - you really should release the zip with an example bb that shows how to load the Exports, as well as a further example that shows how to load it from the .FLE file.
its free open source, im assuming anyone interested is willing to look at the source and try to understand it. Ill compile an exe for everyone else at some point, or anyone else is more than welcome to do so. FLE is not somthign im supporting in the way i would support a compiled shareware title. im at work at the moment, and cant do anythign about the zip. but again, if anyone else wants to rezip it. you are more than welcome to do so.
To load the exported b3d..
Top=loadmesh(name_2.b3d")
Bottom=loadmesh(name_1.b3d")
entityparent (top, bottom)
to load an FLE use Loader.bb as AN include.. not in zip.. code posted above in codebox.
TERRAIN=LOAD_FLE("name.fle")
thats it.
To load the exported b3d..
Top=loadmesh(name_2.b3d")
Bottom=loadmesh(name_1.b3d")
entityparent (top, bottom)
to load an FLE use Loader.bb as AN include.. not in zip.. code posted above in codebox.
TERRAIN=LOAD_FLE("name.fle")
thats it.
Thanks jfk and RifRaf :)
How is the terrain optimised? does it reduce uneccesary polys?
yes it removes all commpletely transparent tris. btw ive the version on my HD spitting out a single B3D mesh instead of 2. with no alpha zorder issues. just need to fix the texturing and its ready.
Sounds wonderful. Is there any chance of letting people choose how many quads X and Z they want the terrain? ;)
And also maybe exporting by chopping it up into pieces for later optimisation. Maybe specify how many chunks x and z also :)
This is really good work though!
And also maybe exporting by chopping it up into pieces for later optimisation. Maybe specify how many chunks x and z also :)
This is really good work though!
Hear hear. I've been asking for a control over the number of segments for a while now.
in the latest version you have the segment control.. you can choose small, med,large, or xlarge. Now in the source code you can change what each one of thoe menu options will set the segments to. There is currenlt not a seperate variable for X and Z but you could add that easily.
Ah, I missed the last download.
woot!. ok i got single b3d mesh exporting in there. Just have to finish up on the optimizing and ill upload latest.. Ill compile it this time.
ok new download finally. This is the compiled EXE this time.
New things.
1) Paint terrain textures in circle brush, with falloff from center to edge.
2). rough lightmapper in. when you click lightmap , it will light the terrain withth elightsource at the CAMERAS position.. so move where you want the light, and click lightmap.
3). EXPORT OPTIMIZED SINGLE B3D MESH! no more loading 2 files. thanks to the awsome specs data on this site.
4). you can COLOR the terrain with the color brush.. . manually lightmap it, or add color variations for the look of it.
5). When you EXPORT the B3D, FLE will also save a *.BMP file with the same front name as the B3D file.. this BMP is lightmap you can use just in case you dont want to use the vertex lights. The lightmap BMP is created from the vertex colors. that you created while in FLE with lightmapper and color brush
a side note, you can change flags on the B3D entity once you load it and you wont effect it much, unless you add flag 32 or 4. those will alter the appearance.
thats it.. give me some feedback.
http://www.hoverhavok.mmocrafter.com/fle_compiled.zip
http://www.hoverhavok.mmocrafter.com/fle13.jpg?
New things.
1) Paint terrain textures in circle brush, with falloff from center to edge.
2). rough lightmapper in. when you click lightmap , it will light the terrain withth elightsource at the CAMERAS position.. so move where you want the light, and click lightmap.
3). EXPORT OPTIMIZED SINGLE B3D MESH! no more loading 2 files. thanks to the awsome specs data on this site.
4). you can COLOR the terrain with the color brush.. . manually lightmap it, or add color variations for the look of it.
5). When you EXPORT the B3D, FLE will also save a *.BMP file with the same front name as the B3D file.. this BMP is lightmap you can use just in case you dont want to use the vertex lights. The lightmap BMP is created from the vertex colors. that you created while in FLE with lightmapper and color brush
a side note, you can change flags on the B3D entity once you load it and you wont effect it much, unless you add flag 32 or 4. those will alter the appearance.
thats it.. give me some feedback.
http://www.hoverhavok.mmocrafter.com/fle_compiled.zip
http://www.hoverhavok.mmocrafter.com/fle13.jpg?
Yeah! Thanks RifRaf!
Woot! This latest version kicks ass.
impressive. how did you manage to save it in one B3D? Are you using multiple child nodes? And does it work with LoadMEsh, or is LoadAnimMesh required?
loadmesh works fine. and yes, you have to start the MESH chunk, then create all the NODES chuks beneath it, each node nested to the last. creating children. and removing the 65k limit for the terrain because its a mesh or surface limit and the terrain is actually 6 meshes. each can be up to the vert limit. however the optimizing works pretty good, and you wont come closee to that limit per mesh.. even per terrain in most cases
next im going to try to learn a more common 3D file format so anyone can use it, not just b3d users
is the source updated with the latest version as well? i couldnt find it
Nice I like it, apart from the camera control is a bit fiddly (I guess if you get used to it it's ok)
I would make the W,A,S and D keys go forwards/backwards and rotate left and right - only my personal preference though.
I would make the W,A,S and D keys go forwards/backwards and rotate left and right - only my personal preference though.
It's the best terrain editor I've seen that money can't buy. :)
The only thing I would suggest would be too add some more textures--add a sand texture, especially.
Going a bit farther, you could create a built-in water creator, that would create real "water-like" effects. I dunno. It just sounded interesting, since I have NO clue on how to make water....
But I strongly suggest a sand texture...I don't have the latest version in source code, so I can't add anything....
But nice work--keep it up! :)
The only thing I would suggest would be too add some more textures--add a sand texture, especially.
Going a bit farther, you could create a built-in water creator, that would create real "water-like" effects. I dunno. It just sounded interesting, since I have NO clue on how to make water....
But I strongly suggest a sand texture...I don't have the latest version in source code, so I can't add anything....
But nice work--keep it up! :)
I think you can subsitute your own textures, and also if you have the source you can have more than 6 textures. Is that right Rif?
yes try clicking on thetexture thumbnail to change it to a new texture
thanks! I'm really looking forward to this....
ummm--what about using it in commercial games? can we use it?
ummm--what about using it in commercial games? can we use it?
For some reason, I can't "paint." Everything is the default texture, no matter what. I can change the default texture, but I can't "paint" on other textures. Do you know what happened? :(
are you using right mouse button?, and yes use terrains made with it in any project
@ckob, no it isnt.
What would be cool, dunno how easy it would be to implement, texturing, based on the height of the terrain. If this were added and some sort of texturing, based on a bitmap, i'd happily pay for this. It's getting better and better all the time. Very good work man!
RifRaf: awww :) i look forward to the next code update this open source project is coming along nicely.
Ross C: its free and the best part is that its open source :)
I think texturing based on hieght is a good idea and it wouldnt be all the hard to add, would save tons of time
Ross C: its free and the best part is that its open source :)
I think texturing based on hieght is a good idea and it wouldnt be all the hard to add, would save tons of time
height-based texturing was salready in, dunno if rifraf droped it again. (formerly known as topological mapping)