F.L.E free landscape editing code

Community Forums/Showcase/F.L.E free landscape editing code

RifRaf(Posted 2004) [#1]
Hi all. whipped up a multi layer alpha blending terrain thing and will share in code archives soon.. you can do the following

Select as many layers as you like. i use 6. have a texture for each layer.

select texture scale for each layer

easily bring one layer to the front(in view) smoothly and blend them around in unique ways.

lacks an exporter, would be cool if one of you familiar with b3d format would make an optimized exporter that removes verts covered up by other layers.. ect.

source will be provided, very simple stuff, nothing amazing, but you can play with it and imporve it all you like, tried to keep alot of things in functions that you can reuse.. and set up most layer data via constants.. so you can change vert count and things easily.

should have it up tomorrow evening
anyhoo.. heres a pic of it so far

http://www.hoverhavok.mmocrafter.com/fle.jpg?


Falelorn(Posted 2004) [#2]
Excellent, thanks Rif


Rob Farley(Posted 2004) [#3]
Looking forward to having a play.


Binary_Moon(Posted 2004) [#4]
This sounds cool. Thanks muchly.


ashmantle(Posted 2004) [#5]
Marvelous!! thank you very much ^^


Ricky Smith(Posted 2004) [#6]
Looks really cool AND free - many thanks RifRaf !


Rob(Posted 2004) [#7]
Nice one rifraf, u done good.


jfk EO-11110(Posted 2004) [#8]
looks very nice, very useful stuff.

Concerning optimation, how about:
let's say layer zero is the one that is (theoreticly) the lowest layer.

All other layers are optimized the following way: Triangles with 3 invisible Vertices (Vertex Alpha=0.0) will be removed. At the same time we use an array that will store a flag for each Triangle, that is fully opaque on ANYONE OF the Layers other than layer zero.

Now we can remove all triangles from layer zero that are flagged in the array.


RifRaf(Posted 2004) [#9]
sounds great.. on my lunch break at the moment .. will tidy up my code when i get home and post it. if you want to add that in there that would be awsome. oh and i dont think i mentioned but it has no gui either.. i kludged some mouse and key controls in to make it usable however.


RifRaf(Posted 2004) [#10]
ok its going up in archives.. heres a link as well
http://www.hoverhavok.mmocrafter.com/fle.zip

its zipped only because i included some small 64x64 textures so you can test it without getting textures set up.. zip is 75k with source.. any mods / or improvements..Please post them :) needs exporter still, gui, and small improvemets.

comments are very welcome just remember it was only about an hour or so of work, not much time to refine anything.


RifRaf(Posted 2004) [#11]
another shot of it. noticed i never fixed the painting issue .. meaning using large brush properly.. ill get around to it soon
http://www.hoverhavok.mmocrafter.com/fle2.jpg?


jfk EO-11110(Posted 2004) [#12]
I'll look into optimation and saving options in the weekend, if I'm gonna find some time. Tomorrow I got a lot to do and now it's already 3.30 o clock in the morning, so I gotta go sleep soonish.


RifRaf(Posted 2004) [#13]
awsome, also in addition to removing tris with total of 0.0 alpha, would be nice to check for all 3 verts of a tri being 1.0, and if they are then we can remove the exact same tri on all layers below it


RifRaf(Posted 2004) [#14]
updated zip file, and code archives. Brushchange fix has been put in.


Rob Farley(Posted 2004) [#15]
Downloaded... I'll take a look at this tonight.


jhocking(Posted 2004) [#16]
Looks very useful. Downloading now to give it a whirl.


RifRaf(Posted 2004) [#17]
not printed on screen , but you can use + and = to increase and decrease brush size.


jfk EO-11110(Posted 2004) [#18]
phew, 196'608 Tris rendered with 30 fps on a crappy radeon 9200se...


jfk EO-11110(Posted 2004) [#19]
uhm, it isn't so easy as I thought first. DirectX has a limit of 64k Vertices for a mesh, so I cannot simply add tem all together and then optimize it... got to find a way around this...


jfk EO-11110(Posted 2004) [#20]
Currently I don't see a way to overcome this problem. Saving a Mesh with more than 64 ktris seems not possible. Someone correct me if I am wrong. Well it used to freeze my machine when I tried to ass more than 2 of the six layers to one mesh. Each layer uses one surface, so I guess the surface count doesn't have anything to do with the Vertices Maximum.

Yes, it would maybe be possible to save them as child nodes, but then you still got more than 64kVertices in one Mesh when you load it with LoadMesh and not with LoadAnimMesh.

I guess the easiest way will be to save out 6 meshes instead. THe user will then simply have to load all those 6 meshes and parent them as you did it in the code.

Any better ideas?

BTW - the basic layer that is visible from beginning on, thats layer 6, right?

And I need to make the brush faster, esp. for debugging purposes.


RifRaf(Posted 2004) [#21]
LOL.. that tri count i sbecause hte quads are set to 128x128 per layer.. reduce it to 64 for lower tris. youll get around 50k

The top layer is 6.. thats correct..

brush faster? changing fadespeed to a higher number will increase fade speed


jfk EO-11110(Posted 2004) [#22]
Are all vertices shared? Should I limit to 64*64 quads? Ok. One mesh is really much more handy.


RifRaf(Posted 2004) [#23]
why limit?


jfk EO-11110(Posted 2004) [#24]
because even when the vertices are shared, there's that max of 64k vertices.


Shambler(Posted 2004) [#25]
It's a long time ago since I checked but I'm sure the 64K limit is per 'surface' not per 'mesh'.

At work atm so can't test it.

Write a small program to create a mesh with 2 surfaces then add 64K verts to each surface...does it crash or not?


jfk EO-11110(Posted 2004) [#26]
yes, maybe thats true, thanks. But now there's a new problem. I have z-order troubles when all layers are one mesh. Well, I guess thats the reason, still try to fix it somehow. at least saving works partially atm.

EDIT - but shambler, then I ask myself why wasn't it possible to add the 6 layers to one mesh together, each layer was using a diffrent surface, nevertheless it didn't work (it worked with 2, but not with 3).


RifRaf(Posted 2004) [#27]
another shot.. added random terrain functon to see some neat combos w/out the work of hand painting it.

http://www.hoverhavok.mmocrafter.com/fle3.jpg?


jfk EO-11110(Posted 2004) [#28]
can't see it.


RifRaf(Posted 2004) [#29]
@jfk.. awsome.. keep it up!


RifRaf(Posted 2004) [#30]
refresh


jfk EO-11110(Posted 2004) [#31]
looks nice. I am afraid I gotta restart pretty much from scratch. Or at least we have to drop the Idea of a single mesh, because this is the typical behaviour of single Mesh Alpha Z-order mess. I guess the only reason this don't happens in the editor is because there you are using 6 independent meshes. So there are two ways: Save 6 meshes, or save one mesh and then after loading split it up into surfaces and make 6 meshes out of it. Both is kinda sucking, but I think it's required to prevent the z-order problem.


RifRaf(Posted 2004) [#32]
saving as single mesh, then loading one and splitting sounds like the cleanest way to do it.. you already have the optimizing stuff in there too ?


jfk EO-11110(Posted 2004) [#33]
yes, but something is still buggy. It looks like when you set the entityFX for layer 1 to 32 only in the editor, that kind of z-order problem. and then the texture of layer 6 simply disappears...
I guess the easiest way to prevent Z-Order Problems once and for all is: load layer 6 as a seperate mesh without any alpha, then load the oother layers as combined optimized mesh. Not a big deal to load 2 meshes instead of one IMHO.


RifRaf(Posted 2004) [#34]
Layer 6 is the upper most layer.. the top layer.. it needs alpha.. layer 1 is the very bottom, and requires no alpha because there are no layers beneath it.


jfk EO-11110(Posted 2004) [#35]
You need to explain this a little closer - seems like I don't get it right :) - layer 6 needs alpha, ok. But the other layers, I thought they have their vertex alpha set to zero as long as they don't show up. But now it seems they are all set to non-zero, but are only occluded? How can I optimize it then? I can ask if layer 6 is not zero, ok, but then I still don't know which other layer need to be displayed, unless I show / save them all.

Any hints for me here?


jfk EO-11110(Posted 2004) [#36]
YYYYYEEEEEEAAAAAAHHHHH got it working!!!

had to add VertexColor surf,l_index(a,b),255,255,255,0

right after the vertex createion inthe CreateLayer Function. Now all layers are transparent per default, only layer 1 has fx 32 not set, so it's opaque. that means tex1 is now the bottom texture. But all in all it works great. And it really takes only the tris of the slpha combined mesh that are used by each layer. and no more z.order issues. Loading is as easy as
l1=loadmesh()
l2=loadmesh
entityfx l2,34

got to clean the code, gonna post it soon. Still has some stuff to fix with scaletexture, I had to use brushes instead of textures to make it work, still something wrong there, but I guess that isn't a big problem.


jfk EO-11110(Posted 2004) [#37]
ok, scaling works too now. I go sleep, will clean and upload tomorrow. BTW. I tried the 128*128 size, but the result was completely messed up. I think this happens because the model is temporarily too large (right after optimation it's unwelden, using unshared vertices). Then after welding the number of vertives is legal again, and it renders without a MAV, but some Vertices (about the half of the ones that are part of the surface that was too big) are misplaced, at the bottom of the mesh, seems like they became Zero Coords.
However, 100*100 works, since 100*100*2*3=60'000, that is below 64k.


RifRaf(Posted 2004) [#38]
excellent!


jfk EO-11110(Posted 2004) [#39]
Ok, here is the version with Saving:
www.melog.ch/dl/fle_ablend3.zip

This is really a gem of a tool. although still very inhouse-ish (hotkeys only etc.) it's already very useful and I bet I cannot resist to use one of these landscapes in my next level work :)

the 100*100 Mesh has 120kTris originally, and in the optimized version only about 30k, depending on the way you use the spray tool. I suggest to use to most covering texture as layer 1.


jfk EO-11110(Posted 2004) [#40]
uh, all of a sudden it seems like there is still a very little bug. A hand full of tris seem to be not saved correctly (maybe a floating point inaccuracy problem?). This results in a very few z-fighting-blinking Tris (I had 3 of them). It can be solved by

translateentity land2,0,0.01,0 ; (second mesh)

after loading the exported meshes

But then there are still the contours of those Tris that are not fully correct.

Maybe somebody can fix this.


ckob(Posted 2004) [#41]
well I decided to help out on this project a little and added a simple GUI using BlitzUI. It isnt fully functional but im working on it and should be able to upload a fully working source by tonight or tomorrow morning. I also will clean it up a bit I wanted to get the functionality in first whats the best look for the GUI ? the top control bar bottem, left or right?

http://www.banished-studios.com/FLEGUI.jpg?


RifRaf(Posted 2004) [#42]
jfk.. thats awsome.. thanks! hey pop this function in there and assign a button to it..

whoa! ckob , thanks. looks great!

<code>
Function randterr()
For i=numlayers To 2 Step -1
s=GetSurface(layer(i),1)

If i<6 Then s2=GetSurface(layer(i+1),1) Else s2=GetSurface(layer(i-1),1)
If i<5 Then s3=GetSurface(layer(i+2),1) ElseIf i<5 Then s3=GetSurface(layer(i)-2,1) Else s3=GetSurface(layer(i),1)
If i<4 Then s4=GetSurface(layer(i+3),1) ElseIf i<4 Then s4=GetSurface(layer(i)-3,1) Else s4=GetSurface(layer(i),1)
If i<3 Then s5=GetSurface(layer(i+4),1) ElseIf i<3 Then s5=GetSurface(layer(i)-4,1) Else s5=GetSurface(layer(i),1)
If i<2 Then s6=GetSurface(layer(i+5),1) ElseIf i<2 Then s6=GetSurface(layer(i)-5,1) Else s6=GetSurface(layer(i),1)


v=CountVertices(s)

For ii=1 To 10000
rv=Rand(1,v-1)
a#=Rnd(0,1)

VertexColor s,rv,VertexRed(s,rv),VertexGreen(s,rv),VertexBlue(s,rv),a#

a2#= VertexAlpha (s2,rv)
a3#= VertexAlpha (s3,rv)
a4#= VertexAlpha (s4,rv)
a5#= VertexAlpha (s5,rv)
a6#= VertexAlpha (s6,rv)

DA2=Rand(-1,1)
DA3=Rand(-1,1)
DA4=Rand(-1,1)
DA5=Rand(-1,1)
DA6=Rand(-1,1)

a2#=a3#+(a2# * DA6)
a3#=a4#+(a3# * DA2)
a4#=a5#+(a4 * DA3)
a5#=a6#+(a5# * DA4)
a6#=a#+(a6 * DA5)



VertexColor s2,rv,VertexRed(s2,rv),VertexGreen(s2,rv),VertexBlue(s2,rv),a2
VertexColor s3,rv,VertexRed(s3,rv),VertexGreen(s3,rv),VertexBlue(s3,rv),a3
VertexColor s4,rv,VertexRed(s4,rv),VertexGreen(s4,rv),VertexBlue(s4,rv),a4
VertexColor s5,rv,VertexRed(s5,rv),VertexGreen(s5,rv),VertexBlue(s5,rv),a5
VertexColor s6,rv,VertexRed(s6,rv),VertexGreen(s6,rv),VertexBlue(s6,rv),a6

Next
Next

For l=2 To numlayers
doit=Rand(0,50)
layertexscale(l)=0.01
ScaleTexture layertexture(l),layertexscale(l),layertexscale(l)

If doit<10 Then
layertexscale(l)=Rnd#(0.012,.13)
ScaleTexture layertexture(l),layertexscale(l),layertexscale(l)
EndIf

If doit<4 Then
For lx=2 To lsegments-1
For lz=2 To lsegments-1
s=GetSurface(layer(l),1)
a1#= VertexAlpha (s,l_index(lx+1,lz))
a2#= VertexAlpha (s,l_index(lx-1,lz))
a3#= VertexAlpha (s,l_index(lx,lz+1))
a4#= VertexAlpha (s,l_index(lx-1,lz))
a5#= VertexAlpha (s,l_index(lx,lz))
newa#=(a1+a2+a3+a4)/5
rv=l_index(lx,lz)
VertexColor s,rv,VertexRed(s,rv),VertexGreen(s,rv),VertexBlue(s,rv),newa#
Next
Next
EndIf
Next




End Function
<code>


RifRaf(Posted 2004) [#43]
hm.. jfk use the above code to randomize your terrain, then save.. and view the saved mesh. Textures(or alpha) is not correct.


ckob(Posted 2004) [#44]
I will add a randomize button as well then:)


R0B0T0(Posted 2004) [#45]
This is great stuff guys! Came together quickly and with a nice sense of community spirit. This will definitely be a useful tool. Just need to add terraforming now ;)

Thanks!


Caff(Posted 2004) [#46]
Yeah keep it up, great to see it taking shape!


ckob(Posted 2004) [#47]
Yeah im currently adding in a bunch of stuff for the UI rifraf if you could stop adding stuff just until i get this done that would be great :P


jfk EO-11110(Posted 2004) [#48]
Cool, please use my version that can export the mesh. I also had the idea to make a function that lets the user define 3 textures for 3 diffrent heights, one for west-side vegetation, and probably an other function that is slope-based (too steep= rock, other=grass etc.)

Later. Just a wip screen:

http://www.melog.ch/screens/fle_test.jpg?


jfk EO-11110(Posted 2004) [#49]
rifraf - I don't really understand what your function is doing (byside randomizing), please help me to make it work.


ckob(Posted 2004) [#50]
GUI Code Added by ckob using BlitzUI
Keys Added
F1 to switch editmode on and off

*note* when you start the app it will ask you for the 6 textures to use pick them and it will create a config file to read from.


Right, I used the current build and it creates the B3d files so I think its the right one.

http://www.banished-studios.com/FLEGUI.zip

I hope this helps. BTW there are couple things that steal need polising with the GUI the texture Scale slider bar dosnt work but i have to go so I cant work on it for a bit feel free to fix it...should be easy I think.


jfk EO-11110(Posted 2004) [#51]
cool, thanks a lot ckob!


ckob(Posted 2004) [#52]
hey no problem


jhocking(Posted 2004) [#53]
Very awesome guys! This tool will be VERY useful for doing terrain.


RifRaf(Posted 2004) [#54]
@jfk. it doesnt do anything special, jsut does alot of alpha variations on each layer.. but when i did that. saved with your funciton.. then loaded the same terrain with your test.bb it did not look correct. il post in editor, and saved mesh shots to show you what im talking about.


RifRaf(Posted 2004) [#55]
@ckob gui not complete right? or am i missing somthing. :)


ckob(Posted 2004) [#56]
while we're at it we should throw in the ability to export to X file as well so other communities can use this.


jhocking(Posted 2004) [#57]
Have any optimizations been done, like removing completely transparent tris and tris completely obscured by layers above it? This thread is getting a little long for me to find out by reading all the posts.


RifRaf(Posted 2004) [#58]
yes .. just as soon as someone who knows the format jumps in to help.. lol i dont know it a bit.

@jfk ok HERE IS A SHOT OF THE TERRAIN IN F.L.E in edit
http://www.hoverhavok.mmocrafter.com/inedit.jpg?

and HERE IS THE SAME MESH AFTER SAVE. LOADED AS B3D
the camera is very close to same position in both shots.
http://www.hoverhavok.mmocrafter.com/aload.jpg?

hope that helps


N(Posted 2004) [#59]
This is really quite an indispensible tool as it is. Gonna have to download it and tweak it for my own purposes ;)


RifRaf(Posted 2004) [#60]
@jhocking.. no just removes tris that are all 0.. im going to add removing tris on layers underneath all alpha-1 tris.

meaning if the top layer tri has all alpha 1, then every other layer will have that exact tri removed.

@noel.. lol please share your tweaks. :)


jfk EO-11110(Posted 2004) [#61]
does X support vertexalpha?

rifraf - I experienced a problem too, I described it earlier in this thread, right after my release of the saveing version. I have made a function that will put rocks on steep slopes, (this saves a lot of work and is looking pretty good). After saving I had a lot of tris missing in the mesh 2. Now this problem is solved. It happened in the optimized Welding code. I took the original weld code from terabit now, and it works without problems now. The only problem is, the original welding code is a lot slower than the optimized one. So currently it takes a half a minute to weld on a 1GHz machine. (well, you only do this once, when you export it) I will post this include file here soon (you will only have to replace the weld_inc.bb), as well as the slope mapping function, plus I gotta update the download file.

Let's see if this is going to solve your problem too.


N(Posted 2004) [#62]
@noel.. lol please share your tweaks. :)


Don't worry, if I do anything with it I'll make the changes publicly available.


jfk EO-11110(Posted 2004) [#63]
rifraf - don't think that I didn't already try to remove all tris of the bottom layer that are obsured anyway. Problem is that vertexalpha works on the mesh level and not per-vertex (read versions.txt), thus if you remove the occluded tris of the bottom mesh, you gonna have z-order troubles. I tried it. No way.

as for your other problem and the two images - what are you talking about exactly? Are the wrong textures in use, or is the order of textures diffrent from the one in the editor?

I suggest not to use more than two layers whereever possible. I still don't know exactly how Blitz/DX is handling this. When it loads a multisurface mesh, the order of surfaces is not the same every time, it sorts them rather randomly, so this could be a reason why it looks diffrent.

Anyway, currently it does store all tris that are not zero, so when you spray 6 layers onto one another, they will all be saved and rendered. Somebody may optimize this further.

For me it was already pretty tricky to make it work the way it currently does. I have no idea how to sort the order of the surfaces in a good way. But the saving code is there, you can easily use it for all layers seperatly and save 6 meshes (as we initially thought was an option) and then load the layers the way you want and y-translate them slightly to force the z-order you prefere.


jhocking(Posted 2004) [#64]
ckob, it would be really nice if you added the ability to change the textures by clicking on them in the GUI, and a way to minimize the window so it isn't in the way.

Incidentally, why have F1 toggle editing on/off? Why ever turn it off?


jfk EO-11110(Posted 2004) [#65]
ok, here is the weld include file ("weld_inc.bb"). If you have missing Tris on the exported mesh or something, then replace the current weld_inc.bb by the following code:
;weld mesh by terabit, vertexalpha handling added by jfk
Dim txv(3)
Type TRIS
Field x0#
Field y0#
Field z0#
Field a0#

Field u0#
Field v0#
Field U20#
Field V20#

Field x1#
Field y1#
Field z1#
Field a1#

Field u1#
Field v1#
Field U21#
Field V21#

Field x2#
Field y2#
Field z2#
Field a2#

Field u2#
Field v2#

Field U22#
Field V22#

Field surface
End Type


Function Weld(mish)

;RenderWorld : Text GraphicsWidth()/2,GraphicsHeight()/2,"Optimising Please Wait..",True,True : Flip 

For nsurf = 1 To CountSurfaces(mish)
su=GetSurface(mish,nsurf)
For tq = 0 To CountTriangles(su)-1
txv(0) = TriangleVertex(su,tq,0)
txv(1) = TriangleVertex(su,tq,1)
txv(2) = TriangleVertex(su,tq,2)
vq.TRIS = New TRIS
vq\x0# = VertexX(su,txv(0))
vq\y0# = VertexY(su,txv(0))
vq\z0# = VertexZ(su,txv(0))
vq\a0# = VertexAlpha(su,txv(0))
vq\u0# = VertexU(su,txv(0),0)
vq\v0# = VertexV(su,txv(0),0)
vq\u20# = VertexU(su,txv(0),1)
vq\v20# = VertexV(su,txv(0),1)

vq\x1# = VertexX(su,txv(1))
vq\y1# = VertexY(su,txv(1))
vq\z1# = VertexZ(su,txv(1))
vq\a1# = VertexAlpha(su,txv(1))
vq\u1# = VertexU(su,txv(1),0)
vq\v1# = VertexV(su,txv(1),0)
vq\u21# = VertexU(su,txv(1),1)
vq\v21# = VertexV(su,txv(1),1)

vq\x2# = VertexX(su,txv(2))
vq\y2# = VertexY(su,txv(2))
vq\z2# = VertexZ(su,txv(2))
vq\a2# = VertexAlpha(su,txv(2))
vq\u2# = VertexU(su,txv(2),0)
vq\v2# = VertexV(su,txv(2),0)
vq\u22# = VertexU(su,txv(2),1)
vq\v22# = VertexV(su,txv(2),1)
Next

ClearSurface su

For vq.tris = Each tris

vt1=Findvert(su,vq\x0#,vq\y0#,vq\z0#,vq\u0#,vq\v0#,vq\u20#,vq\v20#)

If vt1=0 Then
loca=AddVertex(su,vq\x0#,vq\y0#,vq\z0#,vq\u0#,vq\v0#)
VertexColor su,loca,255,255,255,vq\a0#
VertexTexCoords su,mycount,vq\u20#,vq\v20#,0,1
vt1 = mycount
mycount = mycount +1
EndIf

vt2=findvert(su,vq\x1#,vq\y1#,vq\z1#,vq\u1#,vq\v1#,vq\u21#,vq\v21#)
If Vt2=0 Then
loca=AddVertex(su,vq\x1#,vq\y1#,vq\z1#,vq\u1#,vq\v1#)
VertexColor su,loca,255,255,255,vq\a1#
VertexTexCoords su,mycount,vq\u21#,vq\v21#,0,1
vt2 = mycount
mycount = mycount +1
EndIf

vt3=findvert(su,vq\x2#,vq\y2#,vq\z2#,vq\u2#,vq\v2#,vq\u22#,vq\v22#)

If vt3=0 Then
loca=AddVertex(su,vq\x2#,vq\y2#,vq\z2#,vq\u2#,vq\v2#)
VertexColor su,loca,255,255,255,vq\a2#
VertexTexCoords su,mycount,vq\u22#,vq\v22#,0,1
vt3 = mycount
mycount = mycount +1
EndIf

AddTriangle su,vt1,vt2,vt3

Next

Delete Each tris
mycount=0
Next
End Function

Function findvert(su,x2#,y2#,z2#,u2#,v2#,u22#,v22#)
For t=0 To CountVertices(su)-1
If VertexX(su,t)=x2# Then
If VertexY(su,t)=y2# Then
If VertexZ(su,t)=z2# Then
If VertexU(su,t,0)=u2# Then
If VertexV(su,t,0)=v2# Then
If VertexU(su,t,1)=u22# Then
If VertexV(su,t,1)=v22# Then
Return t
EndIf
EndIf
EndIf
EndIf
EndIf
EndIf
EndIf
Next
Return 0
End Function


unfortunately this version is a lot slower than the previous one that was optimized, but what is speed, when some Tris get lost on the way ? :o)

Ok, the zipfile from http://www.melog.ch/dl/fle_ablend3.zip
is now updated too. Please replace your weld_inc.bb file since the old (faster) one really has a bug inside. Problably you need to ad an alert in your app, something like "WELDING MESH, THIS IS GOIN TO TAKE A WHILE - IT ISN'T FROZEN, JUST VERY BUSY"


ckob(Posted 2004) [#66]
alright ill do that with the textures :)
The reason I made the F1 key is because if it isnt turned off then the mouse is stuck in the middle so you cant use the GUI :P


jhocking(Posted 2004) [#67]
Oh yeah, duh. Carry on soldier.

Having the circle in the middle change size to reflect the brush size setting would be really useful, but considering this is a free app I'm starting to quibble.

ADDITION: I was about to point out it would be useful if the config allowed you to select a heightmap to load, and then it occurred to me the app should have editing of the terrain.


RifRaf(Posted 2004) [#68]
@jhocking you can load heightmap.. just need a selector.


jfk EO-11110(Posted 2004) [#69]
In the function SaveLandscape() is an Example on how to use the Fileselector to load a file.


ckob(Posted 2004) [#70]
ill add that in when i make the noted improvements

jfk or rifraf can u update the latest code with GUI from now on? that way we can work a little more togethor on this?


RifRaf(Posted 2004) [#71]
jfk, i found the cause of the problem i was having .. in the optimizelandscape2 function. you had

For ch=2 to numlayers

wich caused vertices from lower layers to get wrote on top.

if you change it to

For ch=numlayers To 2 Step -1

all is well. please test this on your end as well


@ckob .. you bet


jfk EO-11110(Posted 2004) [#72]
rifraf - that's great, yes, I'm gonna edit that too.

ckob - yes, of course. To prevent mutliple versions I suggest that we use one MOTHER version that is kept under control of one coder, I suggest that's rifraf since he's the original author. So if we make additions etc. there are two ways: get the latest version from him and send him the modification back asap, or post new functions that can be implemented easily here.

How easy is BlitzUI to handle? I ask because from tme to time it will be required to add a button or something.


Ok, here is the rocky Slope Function. Not very clever, and not very accurate, and also pretty slow :), but anyway:

Function rockyslope(whatlayer,slope#=.85)
 old_layer=selectedlayer
 selectedlayer=whatlayer
  For z#=-(MeshDepth(layer(1))*lscale/2.0) To MeshDepth(layer(1))*lscale/2.0 Step .1
   For x#=-MeshWidth(layer(1))*lscale/2.0 To MeshWidth(layer(1))*lscale/2.0 Step .1
    bringup_topdown(x#,z#,slope#,1)
   Next
  Next
 selectedlayer=old_layer
End Function


Function bringup_topdown(x#,z#,slope#=.85,area=4,fs#=.06)
 area2=area
 cp=LinePick(x,200,z,0,-400,0,0.0)


 If cp Then 
  s=PickedSurface()
  t=PickedTriangle()
  v=TriangleVertex(s,t,1)

  fxx=-1
  nx#=PickedNX()
  ny#=PickedNY()
  nz#=PickedNZ()

  If abs(ny)<slope

  ;lets locate the v vertex in our precaled l_index
  For cvx=0 To lsegments
   For cvz=0 To lsegments
    If l_index(cvx,cvz)=v Then 
     fxx=cvx
     fzz=cvz
     ; Exit
    EndIf
   Next
  Next

  ;if we did not find the vertex in our l_index .. return
  If fxx=-1 Then RuntimeError "hm";Return

  For i= numlayers To 1 Step -1
   s=GetSurface(layer(i),1)
   For skanx= 0 To 0 ;-area To area
    skx=skanx
    For skanz= 0 To 0 ;-area2 To area2

     skz=skanz

     If (fxx+skx)>=0 And (fxx+skx)<=lsegments And (fzz+skz)>=0 And (fzz+skz)<=lsegments
      v=l_index(fxx+skx,fzz+skz)
      old_al1#=VertexAlpha(s,v)
      ;fade all layers out except selected
      ;fade selected back to view
      If i>selectedlayer Then  old_al1#=old_al1#-(fs#) 
      If i<selectedlayer Then  old_al1#=old_al1#-(fs#)
      If i=selectedlayer Then  old_al1#=old_al1#+(fs#)
      If old_al1#<0 Then old_al1#=0
      If old_al1#>1 Then old_al1#=1
     VertexColor s,v,VertexRed(s,v),VertexGreen(s,v),VertexBlue(s,v),old_al1#
     EndIf
    Next
   Next
  Next
 
  EndIf
 EndIf
End Function


simply call it this way, eg:
rockyslope(2)

if layer 2 is the rock texture you want to use. As I said, it's not perfect, but feel free to optimize this.

it can be implemented easily somewhere, eg. a button or keypress. Takes some time to complete, half a minute or so.


jfk EO-11110(Posted 2004) [#73]
BTW. I suggest that we offer the most recent version as a download in the code archives, is that ok, rifraf?


RifRaf(Posted 2004) [#74]
jfk, havent tested yet, but im going to!! thanks.

btw to you have AIM. my screen name is Bigchance25, IM me if you have it.


N(Posted 2004) [#75]
Right now I'm:

-Adding an interface to the editor via my GUI
-Adding in various fail-safes (try painting the edge of the terrain in the current version and you'll get a MAV)
-Making creation of terrain a bit easier by applying certain layers depending on a vertex's normal (e.g., rock goes on those with a low Y normal)
-Making the brush size and where it'll paint a little more visual


jfk EO-11110(Posted 2004) [#76]
RifRaf, sorry no AIM or such a thing.

Noel - sounds good, but it confuses me that we have two GUI versions now. Of course, you can always work on a special edition.


ckob(Posted 2004) [#77]
Noel I already added a GUI :)


N(Posted 2004) [#78]
ckob: I don't like BlitzUI that much- too slow. Eniretu should be a lot faster in comparison. I'm not asking that my version be stuck into the official one, I'm just doing it 'cause it's what I can work with best.


jfk EO-11110(Posted 2004) [#79]
I just fixed an important bug in the RockySlope Functions that I posted earlier in this thread, so please use the latest version, looks much better, much more accurate, thanks noel, you just made me realize that there was a mistake in the code.


RifRaf(Posted 2004) [#80]
i added more optimizing.. now cuts alot of tris out if you use the upper layers more. if you fill an ara with layer 6.. layers 5,4,3,and 2 on that tri get removed. Ill add your rockside to it and then post updated code

Ckob, can you get the GUI stuff working fully? if not thats ok but ill update the old code without gui with all the new functions, then when GUI works fully ill add it in main code and post for all.. is that ok?


jfk EO-11110(Posted 2004) [#81]
BTW, yes, there's a mav when painting the border or something, happened to me too one time, but I couldn't reproduce it in the few times I tried to.


RifRaf(Posted 2004) [#82]
that will be gone with next zip file link.. in about 10-20 minutes


N(Posted 2004) [#83]
This is mine so far. Most of the time has been spent tinkering with failsafes and setting zones for drawing..

The UI is kindof bare at the moment and I can't seem to figure out why labels in Eniretu aren't drawing...

IMAGE


RifRaf(Posted 2004) [#84]
link. ? :)

blah, having issues with optamizing when vertain layers overlay.. .workig on it though.


N(Posted 2004) [#85]
I'll upload it in a few minutes, just trying to work one little thing out of Eniretu.


RifRaf(Posted 2004) [#86]
latest file. w/ out textures.
http://www.hoverhavok.mmocrafter.com/fle.zip

decided not to give myself any more of aheadache with more optimizing.. the 120k can get down to 30k at export with current optimizer.

just added some error checking, and the rock face function by jfk.. wich is activated by using mousebutton3


N(Posted 2004) [#87]
Here's my version, everything needed to use it is included.

Still WIP, but I said I'd make my changes public and I will.


Download


RifRaf(Posted 2004) [#88]
i like your version very much.. good job. if i were to use it, the only thing i would ad is the ability to move with mouse 2 when you hold mouse 3


jfk EO-11110(Posted 2004) [#89]
well, we don't have to finish this today. I think there is still a lot we can do with this. Currently I am working on a function that lets map a certain topologic height, eg. seaground or snow. Combined with the rockyslope function this almost produces finished terrains. Additionally I will need a Triangle-Remove Option to allow to build holes in the middle of the terrain, where I can place entrances for underground buildings or tunnels. I think there is a Triangle-Remove source in the code archives, I hope this can be implemented instantly.

Concerning the GUI work I think probably it's better to wait until a number of features are there and then do the GUI, to prevent the need for continously adding things to the gui.

BTW - now imagine those Terrains with Vegetation, Grass and Trees :)


RifRaf(Posted 2004) [#90]
jfk that include file, is in the last zip i have linked above. I agree with you on the gui, it should be added last.


N(Posted 2004) [#91]
BTW - now imagine those Terrains with Vegetation, Grass and Trees :)


I'm not imagining it, I'm seeing it. Ulysses looks nifty added to it.


RifRaf(Posted 2004) [#92]
give a screen shot.


N(Posted 2004) [#93]
For some reason it ain't working right at the moment (I was fiddling with Ulysses for a bit and boom- which is how most of my projects end up...). Anyhow, once I get it working right again I'll post a shot.


RifRaf(Posted 2004) [#94]
http://www.hoverhavok.mmocrafter.com/treeshot1.jpg?


jfk EO-11110(Posted 2004) [#95]
hehe, very nice. so we are all working on grass/trees atm :)


N(Posted 2004) [#96]
Added terraforming to my version, but it's slow as hell. I can't say for sure, but I think it's the calls to VertexCoords()

Anyhow, a bit of fiddling in this screenshot (and a glitch due to a zero brush area):
IMAGE


ckob(Posted 2004) [#97]
I was planning on waiting until the rest of the features are in that way we dont have to throw source all over


RifRaf(Posted 2004) [#98]
latest file. w/ out textures.
http://www.hoverhavok.mmocrafter.com/fle.zip

has noels small red box showing brush area, and my own terraforming function. using [ and ] keys to raise and lower land


jfk EO-11110(Posted 2004) [#99]
The following functions can be used to map a specific topologic height or belt, eg. if you want to use a seaground texture for the lowest surfaces, use this. It works the same way as the RockySlope one:

MapTopology(layer, low, high)

where low is the botton border of the mapping and high is the top end of the mapping. if you want eg. seaground, you would use it this way:

MapTopology(3, 0, 3.3)

depending on your world shape etc.

Function MapTopology(whatlayer,lowlevel#,highlevel#)
 old_layer=selectedlayer
 selectedlayer=whatlayer
  For z#=-(MeshDepth(layer(1))*lscale/2.0) To MeshDepth(layer(1))*lscale/2.0 Step .1
   For x#=-MeshWidth(layer(1))*lscale/2.0 To MeshWidth(layer(1))*lscale/2.0 Step .1
    bringup_MapTopology(x#,z#,lowlevel#,highlevel#,1)
   Next
  Next
 selectedlayer=old_layer
End Function


Function bringup_MapTopology(x#,z#,lowlevel#,highlevel#,area=4,fs#=.06)
 area2=area
 cp=LinePick(x,200,z,0,-400,0,0.0)


 If cp Then 
  s=PickedSurface()
  t=PickedTriangle()
  v=TriangleVertex(s,t,1)

  fxx=-1
  py#=PickedY()

  If (py >= lowlevel#) And (py# <= highlevel#)

  ;lets locate the v vertex in our precaled l_index
  For cvx=0 To lsegments
   For cvz=0 To lsegments
    If l_index(cvx,cvz)=v Then 
     fxx=cvx
     fzz=cvz
     ; Exit
    EndIf
   Next
  Next

  ;if we did not find the vertex in our l_index .. return
  If fxx=-1 Then RuntimeError "hm";Return

  For i= numlayers To 1 Step -1
   s=GetSurface(layer(i),1)
   For skanx= 0 To 0 ; this may be slightly offset
    skx=skanx
    For skanz= 0 To 0 ; this too

     skz=skanz

     If (fxx+skx)>=0 And (fxx+skx)<=lsegments And (fzz+skz)>=0 And (fzz+skz)<=lsegments
      v=l_index(fxx+skx,fzz+skz)
      old_al1#=VertexAlpha(s,v)
      ;fade all layers out except selected
      ;fade selected back to view
      If i>selectedlayer Then  old_al1#=old_al1#-(fs#) 
      If i<selectedlayer Then  old_al1#=old_al1#-(fs#)
      If i=selectedlayer Then  old_al1#=old_al1#+(fs#)
      If old_al1#<0 Then old_al1#=0
      If old_al1#>1 Then old_al1#=1
     VertexColor s,v,VertexRed(s,v),VertexGreen(s,v),VertexBlue(s,v),old_al1#
     EndIf
    Next
   Next
  Next
 
  EndIf
 EndIf
End Function





It is still pretty slow, however.

BTW. I think what we really need is a saving format, that can be loaded again to be able to continue the work on a terrain. Any Ideas? Probably it would be the easiest way to simply save the layers as seperate meshes, then then load them back, using as additional special terrain-description file that includes information about the 6 meshes, the used textures, current settings for brush speed, size etc.

As long as we don't have this, it's gonna feel kind of like a oneway ticket.


ckob(Posted 2004) [#100]
JFK: Once a save command is in place I will add the GUI code for it. I am kind of sitting back waiting for the features to be added :P


jfk EO-11110(Posted 2004) [#101]
oh, yeah, and I suggest to show the current brush all the time, at least when in painting mode. For this you can load the textures as images too, but rescale them to 128*128 and permanently DrawBlock the current one eg. in the top right corner of the screen.


jfk EO-11110(Posted 2004) [#102]
ckob - yes, off course that's what they always say :P . No, seriously, that's the only thing you can do atm.


Rob(Posted 2004) [#103]
I'm happy with one person doing the gui. lets vote for eithe ckob or noel as two people doing the gui will really kind of complicate matters.


jhocking(Posted 2004) [#104]
How do you adjust the brush size? Also, you should make the speed of changes variable. That is, the user should be able to set how quickly the applied layer turns opaque and how quickly the vertices move while terraforming.

ADDITION: I just noticed the AZ keys aren't scaling textures, just moving them. Is that a mistake or are there other keys for scaling the texture?


N(Posted 2004) [#105]
BloodLocust: Well, I'm just doing my own special little version, I figure ckob's version should contain the offical GUI code, since the one I'm doing is really tailored to my own needs.


ckob(Posted 2004) [#106]
well I've got BlitzUI pretty much doing everything at the moment..well to FLE's extent anyway. Im still working on adding in the ability to change the textures by clicking the imagebox instead of going through the configuration menu.


RifRaf(Posted 2004) [#107]
@jhocking
A Z does scale. as a texture scales it appears to move.. hold it for some time and you will see it grow.

Brush size is changed with - and = keys


jhocking(Posted 2004) [#108]
Oh, I see what you mean. The scaling is just a lot slower than I expected, so I wasn't holding it down long enough. But don't speed it up; now that I'm expecting it, the current speed is good so that you can adjust it finely. In fact, I would recommend slowing down all the other changes. Textures being painted on turn fully opaque too quickly, and terraforming is difficult because the raise/lower tools are too fast.


RifRaf(Posted 2004) [#109]
@jhocking.. lol well terraform gets much slower the larger your terrain is.. your setting is 32 segments .. up that to 100 and try terraforming, its almost unusable.


jfk EO-11110(Posted 2004) [#110]
so you could divide the speed by the terrain size to get the same speed every time.
BTW the Brush Speed that is responsible for how fast it gets opaque is a constant, it can be made a global variabl easily, the same way like eg. scaling etc. in the end it's the variable "area" that is used internally by the "bringup" function. I suggest to allow an area size of zero, so the brush can be even smaller. Currently the min is 1, resulting in for i= -1 to 1, but with area=0 you could for i=0 to 0 ; use a 3 times smaller brush that would be useful for paths etc.


RifRaf(Posted 2004) [#111]
jfk, area size 0 is allowed.. just hit minus until its zero
divide speed by terrain size? you mean the rate the terrain deforms, if so then you would not only have slow deformation but large jumps that would not allow fine tuning.. but whatever works for the individual, the code is there :). im working on the savework and loadwork functions now


jfk EO-11110(Posted 2004) [#112]
cool!

everybody : please remove the pics that are not neccessary here. ok, some may remain, but currently it's too much.

Probably you can make it a clickable link by appending a "?" at the end of the img URL


jhocking(Posted 2004) [#113]
So how do I change the number of segments?


RifRaf(Posted 2004) [#114]
in code for now. change
Const Lsegments
100 is max you can set to for now as well


RifRaf(Posted 2004) [#115]
@jfk
can you give me a barebones example on how to LOAD a file with blitzsys?


N(Posted 2004) [#116]
I'm working on a file format the will allow loading and saving of work in progress landscapes.

The file structure is similar to that of gile[s]'s, so it's very easy to add and remove new pieces as you see fit.


RifRaf(Posted 2004) [#117]
im done with it.. i just need to make a the loader work with file requester


ckob(Posted 2004) [#118]
Rifraf, The GUI version I made has a file request thats super easy to use.


RifRaf(Posted 2004) [#119]
latest file. w/ out textures.
www.hoverhavok.mmocrafter.com/fle.zip

update include ability to save progres in custom format, and shows a picture of texture being used to spray. and adds ability to load heightmap at any time.


N(Posted 2004) [#120]
RifRaf: Bit too tedious finding when and where someone said they were doing something in this thread, so most of my work done on FLE is going to be independent of changes made by others (already done or not).


RifRaf(Posted 2004) [#121]
@noel. do what you like, im not saying otherwise. Im trying to be helpful in letting you know what im working on in case you would rather work on somthing else.

what else are you doing with it currently? not sure what else i want to do. maybe add object placement wrap a gui over it..shrug


N(Posted 2004) [#122]
Right now I'm trying to figure out why it's running at 1 fps all of a sudden. Was running fine a couple minutes ago and I haven't changed anything, so I'm confused as heck.


RifRaf(Posted 2004) [#123]
lol.. another shot. jfk i removed my old ones so dont panic :)




N(Posted 2004) [#124]
Turns out a program had crashed in the background and was sucking a lot of memory. Quick reboot and it works fine again.

Anywho, pictar of some stuff I did earlier out of boredom. It's really quite fun to just screw around.




jhocking(Posted 2004) [#125]
This is shaping up very nicely. One or two more tweaks and I will heartily recommend this tool to any newbies as an excellent choice for terrain creation.

The main addition that comes to mind right now is adding a control to adjust the terrain detail. I imagine every change would take a little time to update so a slider wouldn't be useful, but maybe a way to type in the number of segments used, or even just a selection of a few preset detail levels (low, med, high)


RifRaf(Posted 2004) [#126]
jhocking..

i was thinking of small, medium, large and extra large.. selgments being 25, 50, 75, AND 100


ckob(Posted 2004) [#127]
Noel can you upload your current code? I really want to see that GUI implamented it looks better then BlitzUI


N(Posted 2004) [#128]
Sure thing, here you go:

http://s87776868.onlinehome.us/stuff/fle_ablend3_01.zip


jfk EO-11110(Posted 2004) [#129]
Personally I don't care too much which GUI is used, but I hope there is a version that uses all additions we made lately.

Rifraf, if you still need a fileselector to load, just scroll to the SaveLandscape() function, there are two filerequester examples, the "Save as" is used in my version, and the Load version is REMARKED.

But anyway, it doesn't matter what filerequester you gonna use, the one of BlitzUI or the WinAPI one, as long as it works properly.


RifRaf(Posted 2004) [#130]
JFK. download the latest and gimme some feedback.

http://www.hoverhavok.mmocrafter.com/fle.zip


Inner(Posted 2004) [#131]
RifRaf: Nice :) keep up the good work, nice to see someone supporting open source 100% in this area.


jfk EO-11110(Posted 2004) [#132]
rifraf, it's very nice. a few things: for the heightmap loader the filerequester button still says "Save". You need to use the other code that is remarked: DLLGetOpenFilename$() and not DLLGetSaveFilename. Just use the remarked 2 lines, adjust the extensions filter as you like (currently alows to select b3d, 3ds, x or all files).

Then I suggest to display keys help for all options onscreen, and for the rockySlope function I'd use a kEy too, not MouseButton 3. And also add the MapTopology function to the menu. In the end we need to allow te user set the layer that is used for rockySlope and topology, as well as the slope angle or the min and max watermarks. of course, this can be done in a gui. Probably there should be an option to use more than one texture for this, like you did it with the Rand(4,5) parameter for the layer, but please note that if you call the RockySlope function this way, it will be only choosen only once. If you really want to use it randomly, you need to tansport those values (4,5) trough function parameter handover to be used inside the inner loop of the said function.

Additionally I have to say, the keys for = and + are not the same on other coutries keyboard layouts, eg. on my keyboard "?" is "=". So maybe you better check all keys with Getkey, but this will be soved with the gui anyway, I just hope, the gui will work quickly, as hotkeys do.

For some special actions like RockSlope or MapTopology I suggest to use the F-keys ATM, they are the same on most keyboards.

The Save and Load function works like a charm! All you need to add is nformation about the texture scaling, and probably about the textures that where used (for future compatibility when you can replace a texture at runtime). Personally I would also store the Brushspeed and Brushsize in the file and restore it after loading, so the user can have individual work settings.

Finally, no need to include the example exported map or the saved work file in the distro, the smaller, the better.

Great Job, trickiest Stuff is already done!


RifRaf(Posted 2004) [#133]
jfk.. if you could make those changes and post the .bb ill update the zip :)


jfk EO-11110(Posted 2004) [#134]
Oh yeah, and a pause function that will allow to use the mouse for other tasks on the desktop, if required (eg. to read the source to see what keys I have to press ;) )


jfk EO-11110(Posted 2004) [#135]
I'll do some of it, but please would you do the Save stuff, cause you know the format best, so I can save some time when I don't need to learn how it works first :)


RifRaf(Posted 2004) [#136]
no problem


RifRaf(Posted 2004) [#137]
ok done.. when you get those other adjustments and additions in, just post the BB and ill put my changes in yours then update the zip.


jfk EO-11110(Posted 2004) [#138]
ok, I made some mods:
http://melog.ch/dl/ablend3_src.zip

Especially the keys are now used sightly diffrent, but this is gonna become obsolete anyway when there will be a GUI.

I have seen you have added elias_t's RemoveTriangle Function. I didn't activate it because I don't know if there are going to be complications with savework and loadwork, or if they are only going to be ignored? Because, when you remove tris, the order of the vetices will be messed up, and no longer fit to the initial grid order.

However, if you decide to activate such a function, all you need to do is a line pick and use pickedsurface and pickedtriangle as parameters for the RemoveTriangle Function, as far as I see.

I tried to list all working functions, and also added keys to alter fadespeed, reimplemented it's usage btw. Onscreen help can now be hidden.


RifRaf(Posted 2004) [#139]
yeah, i am not using it for that reason. im going to add a gui right now.. my own. ill have it ready shortly


jfk EO-11110(Posted 2004) [#140]
Did you add the advanced optimation you where talking about? I mean, ignore fully obscured tris that are non-zero, in the 2nd mesh (layer 2 to 6)?

I didn't see such an optimation - or is it done while painting? WOuld be relatively easy, simply check if the current layers triangle is fully opaque, and if so, make all tris fully transparent that are below it. Well, all but layer 1.

Oh, you gonna add your own gui? Then we have 3 Versions :/ I don't know, but maybe this is going to be a bit disappointing for those who said they gonna do the GUI works.


RifRaf(Posted 2004) [#141]
except that once you remove the tris you oblitterate the l_index refrences to the proper vertex


RifRaf(Posted 2004) [#142]
ok gui comming along.. hes a WIP shot.
http://www.hoverhavok.mmocrafter.com/fle5.jpg?

im going to have a gui_setup, gui_update, and gui_remove... SETUP will set up button positions, UPDATE will check button presses and change global variables accordingly, and REMOVE will remove buttons .. 3 commands and I can remove my entire GUI, so if somoene(ckob) has a more functional one ill gladly update the zip with his :)


N(Posted 2004) [#143]
jfk: I think it's a great idea- far from disappointing. Personally, I won't be updating the base code I'm using at all with new source updates from others because I already know what I've done so far.

By the way, I'm working on allowing non-vertical modification of the terrain. What that means is you'll be able to create overhangs, sortof push bits into the terrain and create pseudo-caves (you could thereinafter import the exported mesh into a modelling application and tweak it a bit form there maybe. Also, I added a smooth brush-mode to my code, so if you end up creating terrain that's far too pointy you can smooth is out little by little.


RifRaf(Posted 2004) [#144]
NOEL i have that in now as well.. you can pull verts up down, and on x/z axis


jfk EO-11110(Posted 2004) [#145]
but isn't this messing up the UV Coords?


RifRaf(Posted 2004) [#146]
yes the textures will stretch some, but not in a bad way unless you streth them very very very far on only 1 or 2 tris. much th same way on a steep cliff.


N(Posted 2004) [#147]
Exactly. As long as you're careful it'll work out fine. The real problem I'm having is making sure that the triangles on underlying layers don't clip the ones above them.


Inner(Posted 2004) [#148]
why not use Xlnt2 ?


RifRaf(Posted 2004) [#149]
anyone can. .im not familiar with it myself, and am almost done with a small gui


N(Posted 2004) [#150]
Inner: Costs money, I don't think anyone can be bothered paying for it. Anyway, BlitzUI works fine, and I'm sure that RifRaf's GUI will do the job.


jfk EO-11110(Posted 2004) [#151]
BTW, rifraf, maybe it's the easiest way to implement the RockySlope and MapTopology Function to use the currently selected texture ?

As for XLnt2 - could make problems with the open source concept.


RifRaf(Posted 2004) [#152]
yeah, i think using selected layer would be very easy .. and functional


Inner(Posted 2004) [#153]
I'm using it, in an open source project .. I'd have to check but I think you only have to pay if your going to sell your project not sure on that one.

ED:

Non-Registered License

Users who have not registered are limited in their use of the XLnt ii GUI library. They may not release ANY software created using, or containing, XLnt ii code. This restriction applies to all programs and source code - FreeWare, Public Domain, ShareWare, or Commercial Software.
Non-registered users may make feature/update requests but registered users' requests will always take precedence.
Only registered users will have access to the most current features and updates.

Damn, wish I'd seen this before, thanks for the heads up, now I have to re-write an entire project (not pleased)

Registered Licence
Users who register have no restrictions placed upon them - they may release any code created with XLnt ii, including full commercial releases! The author of XLnt will claim no ownership of said releases. Registered users will also be entitled to free upgrades, plugins etc so it pays to register!

Interesting, if that is the case if I brought it and I had "no restrictions" I could release the code under a GPL Licence and you guys could use it free with no restrictions, something must be wrong here.

None the less I've had to modify my version of xlnt2 I can't remember what I modified now though.


RifRaf(Posted 2004) [#154]
OK.. here is gui version WIP still, let me know what you think. its not a flexable gui, its tailored JUST for specific thigns.. changable but changes take time to add/fix.. anway. give it a go .. HOLD CONTROL DOWN to free mouse for GUI usage.

http://www.hoverhavok.mmocrafter.com/flegui.zip


RifRaf(Posted 2004) [#155]
need a differnt control scheme.. need mouse free at all times


ckob(Posted 2004) [#156]
In the GUI version i uploaded up there ^^^ F1 releases the mouse to work with the GUI. I've been waiting for more features to be added to add them to the GUI.


Rob(Posted 2004) [#157]
I have to re-write an entire project (not pleased)
just buy it or don't release anything.

And the idea of automatic topology mapping is good, so long as you can overwrite it with normal painting after :)


jhocking(Posted 2004) [#158]
RifRaf, I understand why posting just the additions/changes is necessary so that people don't have to download everything they already have, but since it is considerably less than clear what all is part of the tool you should also post a complete version which you can download and run as-is. I would really like to try out the last version you posted, but I have no idea what "ingredients" to mix together to run it. For that matter, it is getting unclear what .bb file to actually execute to run the program, and because the controls keep changing here and there every new version you really should be outlining the full control scheme every time somewhere; READMEs are our friends!


RifRaf(Posted 2004) [#159]
jhocking, ill have a more complete GUI version up soon.


RifRaf(Posted 2004) [#160]
@jfk , any chance you can see if we can get the export down to 1 mesh. i just loaded a multisurface mesh from 3dcafe that had 250,000 triangles all together and it loaded fine.. not sure hwt we need to do , but it would be nice to just have a single mesh loaded


jhocking(Posted 2004) [#161]
I'm looking forward to the complete download! Don't forget to put in an adjustment for terrain detail.

I hope I'm not being a bother with my requests/suggestions. This is a really wonderful thing you guys are developing.


jfk EO-11110(Posted 2004) [#162]
rifraf, the control scheme is ok, ctrl to go into gui mode. You NEED the mouse to steer, other NAV methods are simply unbearable.

Rob, I was missing a "clear everything" function too, but then again you always can exit and restart the app in seconds, this is probably faster than to overpaint it. And manual painting is possible anyway.

Ckob, I think I know how this feels, and I am not very happy this way. Of course, I also gut several GUIs here and for a second a thought to quickly implement one of them, be it XLnt (I am a registered user), WinB3D, heck even AlphaGui would be cool. But then again, if somebody else said he's gonna do the GUI, then let the man do his job.

Anyway, take it easy. You have the choice, make your own version, or simply don't care about it and use it with any gui, for the sake of the product. Actually that's what I am gonna do, and for me this has already enough features.

There are further things to consider that have to be done in the game code. eg: a 2nd Texture set with a fine-grainy Structure Texture to make things look detailed even when close up (because when you scale up eg. Rock textures to prevent a "tilish-look", the become pretty blurred).


RifRaf(Posted 2004) [#163]
@JFK, because you are only using 6 textures for the entire terrainyou can afford larger ones that dont appear so tiled.. give it a shot.. load a 512x512 or 1024x1024 rock texture in and see. The gui im working on is just for my style, I dont agree with some on GUI so just thought i would whip one up and see how it goes.. I said ill use any gui that is functional and easy.. and i would still ditch my efforts for a better one. im not trying to step on anyone toes . what do you mean ("im not very happy this way")

anyhoo.. im off to work on it a bit more.
heres latest shot. most buttons in the shot are working now
http://www.hoverhavok.mmocrafter.com/fle6.jpg?


jfk EO-11110(Posted 2004) [#164]
No problem, rifraf. Looks good, so far. Now how do you steer?


RifRaf(Posted 2004) [#165]
you can use ARROW KEYS to translate around, PAGE UP and PAGE DOWN to translate up and down. HOME and END to pan left-right, and INSERT and DELETE to pan up-down. OR you can use the buttons on the bottom right GUI to do the same things.

the still at all times use the mouse to paing, and use brushes .. meainig you can move the brush around with mouse still. the cameras absolute position is now done with keys and gui buttons.

on my keyboard, all of those keys are in a 3 x 2 row above arrow keys. so it makes it easy to use.


jhocking(Posted 2004) [#166]
Can you change the textures using your GUI? I can't tell from that screenshot. I imagine a file requester that comes up when you click on the texture image would be a good interface for that.


RifRaf(Posted 2004) [#167]
good idea, i was going to ad another function button, but changine the texture pic to the button would be great, thanks


ckob(Posted 2004) [#168]
RifRaf: I think we should just stick with your GUI it looks better and runs fine on my rig. plus its native to FLE :) This project is coming along very nicely


RifRaf(Posted 2004) [#169]
.


ckob(Posted 2004) [#170]
or not :P


RifRaf(Posted 2004) [#171]
lol.. no no .. I had posted a question asking how to access the mousewheel.. then a quick check in the docs and i found it..so I removed the question..

ckob, thanks for the comments on my little gui :)


ckob(Posted 2004) [#172]
well I decided to keep going using BlitzUI, and I wrote an add on sort of a moduler thing. Just throw these files in the root of yuor FLE folder and add the following

Include "GUI_Include.bb"

right above the createlayers()command is used.

then in the main loop after renderworld() put
GUI_Update()


that should be it,works like a charm on my pc but if you have a problem let me know so I can get it fixed.

http://banished-studios.com/FLEGUIModuler.zip

*note* still working on the GUI its almost fully functional.
If you want to use the F1 key to unlock the mouse to use the GUI adjust the following code. where the code is that controls the mouse replace it with this


If Edit_Mode = True Then

mouselook(camera)

If MouseDown(2) Then MoveEntity camera,0,0,.05

EndIf




I think this is the direction this project should go, any new additions should be added via includes or something so we can just add it on.


RifRaf(Posted 2004) [#173]
awsome! well ive shifted to terraforming functionality. Im getting some cool effects with pulling verts on x/z axi. heres a shot.

http://www.hoverhavok.mmocrafter.com/fle7.jpg?
heres another
http://www.hoverhavok.mmocrafter.com/fle8.jpg?
and another better functionality in place on this shot
http://www.hoverhavok.mmocrafter.com/fle9.jpg?


still early, im tweaking how you can create overhangs still


jhocking(Posted 2004) [#174]
double post


jhocking(Posted 2004) [#175]
BTW, can you include an adjustment for the fog? Or at least a toggle to turn it off.

Hm, trees. Does your latest version have entity placement/dropper functionality?


RifRaf(Posted 2004) [#176]
No dropping functions yet, those trees i placed in a preview program.
@jfk did you see my question above.. im wondering if we can figure out how to save it all into one b3d instead of 2. thanks. :)


ckob(Posted 2004) [#177]
new GUI im working on, Ill upload it when I have it working with Rifrafs latest code. So Rifraf if you added anything new let me know or upload it so I can work with the latest and greatest.



ckob(Posted 2004) [#178]
hmm just noticed the FPS wasnt being displayed problem fixed :)


jhocking(Posted 2004) [#179]
Looks good ckob. Don't forget a button in Terrain Edit to change the terrain detail.


RifRaf(Posted 2004) [#180]
ill update it soon.. before i go to bed tonight


RifRaf(Posted 2004) [#181]
OK HERE IT IS!.. lol my gui setup. For me its perfect, but i get a sinking feeling you all may hate it. :)

heres the rundown on new features.
1) there is a new gui duh
2) you can now change textures for any layer by clicking on the texture selection image.
3) You can smooth teh entire map, or smooth the brush area
4) You can pull land around.. still experimental, it uses normals to determine how its pulled. but with practice you can make some neat overhangs.
5). you can use GUI buttons to navigate, OR use mouse control.. but to use mouse control you MUST hold CONTROL BUTTON to activate mouse look, then you can use MOUSE BUTTON 3 to move, and mouse button 2 to use brush.

Thats it i think. added some tweaks here and there. PLEASE GIVE ME SOME FEEDBACK. :)

http://www.hoverhavok.mmocrafter.com/FLE_GUI_RIF.ZIP


I have room on the GUI for 3 more functions, and 1 more selection box. not sure what ill put there. I want to be able to select a frsh map and select size. so i guess ill work on that next.


jfk EO-11110(Posted 2004) [#182]
where's the rock-slope gone?


RifRaf(Posted 2004) [#183]
oh.. i called it ridge. sorry ill rename it


jhocking(Posted 2004) [#184]
Doh! Link doesn't work.


RifRaf(Posted 2004) [#185]
fixed


jfk EO-11110(Posted 2004) [#186]
nono, ridge is ok, as long it isn't tom rigde :)


jhocking(Posted 2004) [#187]
Ah, thanks. Very nice! This tool is approaching a complete and robust feature set. There were a couple things that irked me while working with it and both are relatively minor:

One, the view is too small. Between the little 640x480 window and the space taken up by the GUI, the view area to work in is pretty cramped.

Two, the fog is frustrating. I found I kept flying out for a wide overhead shot of the landscape I was working on, but when I do that everything gets fogged out.


jfk EO-11110(Posted 2004) [#188]
BTW. Maybe we should now start a second thread fo this topic. Simply set a link to the next thread at the end of this one. (and a link back to this thread at the top of the new one) - maybe, probably, eventually, perhaps, or something.


Falelorn(Posted 2004) [#189]
I agree new topic 190 or so is alot

But I think 3 - resolutions would be better (640x480) is just WAY to small even at 1024x768, and im normally at 1600x1200.

But I like it. Few small things should change, but its a great product, and I think it will be useful to many people. I would love to see more community projects. Once I get a little slower with work, id love to help out.

Kudos to Rif and the rest (im not reading all the posts to see who contributed sorry :p )


jfk EO-11110(Posted 2004) [#190]
THIS THREAD IS CONTINUED HERE:

http://www.blitzbasic.com/Community/posts.php?topic=37805