T.ED Terrain Issues

Blitz3D Forums/Blitz3D Programming/T.ED Terrain Issues

iamdaman13(Posted 2008) [#1]
When I export multi-mesh terrians from T.ED, I always get an index out of bounds error using the epr loader if I use alpha vertex texturing. If I use a supertexture instead, it works fine, but it's blurry. Also, I can use a alpha vertex if my terrain is a single mesh. How do I properly use a multimesh terrain from T.ED in Blitz with alpha vertex texturing?


Ross C(Posted 2008) [#2]
I assume it's a vertex count problem. The reason it would be blurry, is because the supertexture doesn't have the resolution of the tiled, independant textures.


D4NM4N(Posted 2008) [#3]
As ross said.

Index out of bounds probably means you have not set the arrays that hold the data to match the size of either your terrain blocks resolution or (more likely) the array that holds the blocks themselves. Ie, you are specifying 6x6 blocks but are trying to stuff 7x7 blocks into it.
If it's still having problems, please feel free to zip it up and email me a link (in confidence) and I will take a look for you and see what the problem is.

Can you post the section & line the debugger is failing on?


iamdaman13(Posted 2008) [#4]
"Surface Index out of range" as soon as the epr loader gets to the line "surf2=GetSurface(ted_terrain(a,b+1),s)". I simply exported the terrain from T.Ed as b3d with alphatexturing.


iamdaman13(Posted 2008) [#5]
I figured it out! I needed to set "Ted_Trn_With_Children=True". One more question, however, how do I get the alphatexturing to work if I use .x instead of b3d? My .x terrains are textureless when I export them with alpha texturing.
Thank you.


iamdaman13(Posted 2008) [#6]
I also noticed that in blitz3d, if you use the option I mentioned above, collision doesn't work with the terrain in the epr as is because it doesn't check the child nodes for the terrain blocks. I added a few lines to the collisions section of the epr loader code to fix this, hope this helps for future updates on your epr loader:

c = CountChildren(ted_terrain(a,b))
For d = 1 To c
EntityType GetChild(ted_terrain(a,b), d), C_Scene
Next


D4NM4N(Posted 2008) [#7]
Correct.

Although you only need to set collision on the base mesh, not all the texture layer's geometry. You can do this by tracking down the base mesh name. Its something like trn_baselayer or something. Im not at my PC so cant remember. However, have a look whats its called in a 3D app (or dump the entitynames to the debuglog in b3d). It will certainly speed up your collision!

PS: if you want different footstep sounds ie, snow grass etc then use an AI color recognition from a tiny downward render capture, rather than testing collisions on all that extra geometry ;)


X when loaded seems to ignore the vertex alpha values even though they are in the file. This isnt just in blitz3d, it even happens in MS's own X viewer too and i have no idea why. However, search my forum there is some code in there to re-parse the X file once loaded and set the alpha values on the loaded mesh correctly.