DarkBASIC Professional Matrix Command Set
Community Forums/Showcase/DarkBASIC Professional Matrix Command Set
| ||
Hehe, yep the title is right. This is the DarkBASIC Professional matrix commands recreated in Blitz3D for the heck of it, just incase any DBP deserters missed them :) The new B3D commands do not have spaces in the names: Convert Commands MAKE MATRIX Matrix Number, Width, Height, XSegments, ZSegments DELETE MATRIX Matrix Number PREPARE MATRIX TEXTURE Matrix Number, Image Number, Across, Down POSITION MATRIX Matrix Number, X, Y, Z FILL MATRIX Matrix Number, Height, Tile Number RANDOMIZE MATRIX Matrix Number, Maximum Height GHOST MATRIX ON Matrix Number[,2] (,2 reverse ghosts) GHOST MATRIX OFF Matrix Number SHIFT MATRIX DOWN Matrix Number SHIFT MATRIX LEFT Matrix Number SHIFT MATRIX RIGHT Matrix Number SHIFT MATRIX UP Matrix Number SET MATRIX HEIGHT Matrix Number, TileX, TileZ, Height SET MATRIX NORMAL Matrix Number, TileX, TileZ, NX, NY, NZ SET MATRIX TILE Matrix Number, TileX, TileZ, Tile Number UPDATE MATRIX Matrix Number =MATRIX EXIST(Matrix Number) =MATRIX POSITION X(Matrix Number) =MATRIX POSITION Y(Matrix Number) =MATRIX POSITION Z(Matrix Number) =MATRIX TILE COUNT(Matrix Number) =MATRIX TILES EXIST(Matrix Number) *=GET GROUND HEIGHT(Matrix Number, X, Z) *=GET MATRIX HEIGHT(Matrix Number, TileX, TileZ) Commands Not Included SET MATRIX WIREFRAME ON Matrix Number SET MATRIX WIREFRAME OFF Matrix Number SET VECTOR3 TO MATRIX POSITION Vector, Matrix Number SET MATRIX TEXTURE Matrix Number, Texture Mode, Mip Mode SET MATRIX Matrix Number, Wire, Transparency, Cull, Filter, Light, Fog, Ambient =MATRIX WIREFRAME STATE(Matrix Number) Extra Commands Included NORMALISE MATRIX Matrix Number ...Sets normals automatically COLLISION MODE ON Matrix Number ...Sets matrix to Blitz style polygonal collision *=GET COLLISION HEIGHT Matrix Number, X, Z ...Performs a collision test COLLISION MODE OFF Matrix Number ...Turns off Blitz style polygonal collision *returns an integer, but value also loaded into variable "height#" which can be globalised for float return. Type matrix Field id,bank,ent,surface Field xSeg,zSeg Field xSize#,zSize Field tileSX#,tileSZ# Field texture Field tileCount End Type Type matrixTileTexture Field id Field tile Field u#,v# Field uM#,vM# End Type Const MatrixTileBankBit=14 ;Demo & Test Program Global height# Graphics3D 800,600,0,2 SetBuffer BackBuffer() makeMatrix(1,5000,5000,50,50) texture=LoadTexture("D:\Banshee\MightyEmpires\Gfx\terrain.jpg",1+16+32) prepareMatrixTexture(1,texture,4,4) fillMatrix(1,5,0) randomizeMatrix(1,100) ghostMatrixOn(1) ghostMatrixOff(1) setMatrixHeight(1,25,25,0) setMatrixHeight(1,26,25,0) setMatrixHeight(1,25,26,0) setMatrixHeight(1,26,26,0) setMatrixTile(1,25,25,3) updateMatrix(1) collisionModeOn(1) camera=CreateCamera() CameraRange camera,.1,5000 PositionEntity camera,0,10,0 Repeat If KeyDown(200) Then MoveEntity camera,0,0,1 If KeyDown(208) Then MoveEntity camera,0,0,-1 If KeyDown(203) Then TurnEntity camera,0,1,0 If KeyDown(205) Then TurnEntity camera,0,-1,0 If KeyDown(57) shiftMatrixDown(1) updateMatrix(1) EndIf getCollisionHeight(1,EntityX(camera),EntityZ(camera)) ; getGroundHeight(1,EntityX(camera),EntityZ(camera)) PositionEntity camera,EntityX(camera),height+3,EntityZ(camera) RenderWorld landscape.matrix=First matrix Flip 0 Until KeyDown(1) ;end Demo Function makeMatrix(id,xSize#,zSize#,xSegs,zSegs) If (xSegs*zSegs*4)-1>32768 Then RuntimeError("Matrix <"+id+"> exceeds vertex limit") landscape.matrix=New matrix landscape\id=id landscape\bank=CreateBank((xSegs+1)*(zSegs+1)*MatrixTileBankBit) landscape\ent=CreateMesh() landscape\surface=CreateSurface(landscape\ent) landscape\xSeg=xSegs landscape\zSeg=zSegs landscape\xSize=xSize landscape\zSize=zSize landscape\tileSX=Float(xSize)/xSegs landscape\tileSZ=Float(zSize)/zSegs For x=0 To xSegs-1 For z=0 To zSegs-1 bankPos=((x* landscape\zSeg)+z)*MatrixTileBankBit PokeShort landscape\bank,bankPos+0, AddVertex( landscape\surface, x*landscape\tileSX ,0, z*landscape\tileSZ , Float(x)/landscape\xSeg ,Float(z)/landscape\zSeg ) PokeShort landscape\bank,bankPos+2, AddVertex( landscape\surface, (x+1)*landscape\tileSX ,0, z*landscape\tileSZ , Float(x+1)/landscape\xSeg ,Float(z)/landscape\zSeg ) PokeShort landscape\bank,bankPos+4, AddVertex( landscape\surface, x*landscape\tileSX ,0, (z+1)*landscape\tileSZ, Float(x)/landscape\xSeg ,Float(z+1)/landscape\zSeg ) PokeShort landscape\bank,bankPos+6, AddVertex( landscape\surface, (x+1)*landscape\tileSX ,0, (z+1)*landscape\tileSZ , Float(x+1)/landscape\xSeg,Float(z+1)/landscape\zSeg ) AddTriangle landscape\surface,PeekShort(landscape\bank,bankPos+0),PeekShort(landscape\bank,bankPos+4),PeekShort(landscape\bank,bankPos+2) AddTriangle landscape\surface,PeekShort(landscape\bank,bankPos+2),PeekShort(landscape\bank,bankPos+4),PeekShort(landscape\bank,bankPos+6) Next Next End Function Function deleteMatrix(id) For landscape.matrix=Each matrix If landscape\id=id FreeBank landscape\bank FreeEntity landscape\ent If landscape\texture Then FreeTexture landscape\texture Delete landscape EndIf Next End Function Function prepareMatrixTexture(id,texture,xSegs,zSegs) pixelSizeU#=1.0/Float(TextureWidth(texture)) pixelSizeV#=1.0/Float(TextureHeight(texture)) For landscape.matrix=Each matrix If landscape\id=id landscape\texture=texture EntityTexture landscape\ent,landscape\texture For tex.matrixTileTexture=Each matrixTileTexture If tex\id=id Then Delete tex Next textureCount=xSegs*zSegs landscape\tileCount=textureCount x=0 : z=0 : tile=0 u#=1.0/Float(xSegs) v#=1.0/Float(zSegs) For texture=0 To textureCount-1 tex.matrixTileTexture=New matrixTileTexture tex\id=id tile=tile+1 tex\tile=tile tex\u=x*u tex\v=z*v tex\uM=((x+1)*u)-pixelSizeU tex\vM=((z+1)*v)-pixelSizeV x=x+1 If x=xSegs x=0 z=z+1 EndIf Next EndIf Next End Function Function positionMatrix(id,x#,y#,z#) For landscape.matrix=Each matrix If landscape\id=id PositionEntity landscape\id,x,y,z EndIf Next End Function Function fillMatrix(id,tile,height#=0.0) For landscape.matrix=Each matrix If landscape\id=id For x=0 To landscape\xSeg For z=0 To landscape\zSeg bankPos=((x* landscape\zSeg)+z)*MatrixTileBankBit PokeFloat landscape\bank,bankPos+8,height PokeShort landscape\bank,bankPos+12,tile Next Next EndIf Next End Function Function randomizeMatrix(id,height#) For landscape.matrix=Each matrix If landscape\id=id For x=0 To landscape\xSeg For z=0 To landscape\zSeg bankPos=((x* landscape\zSeg)+z)*MatrixTileBankBit PokeFloat landscape\bank,bankPos+8,Rnd(height) Next Next EndIf Next End Function Function ghostMatrixOn(id,mode=3) For landscape.matrix=Each matrix If landscape\id=id EntityBlend landscape\ent,mode EndIf Next End Function Function ghostMatrixOff(id,mode=1) For landscape.matrix=Each matrix If landscape\id=id EntityBlend landscape\ent,mode EndIf Next End Function Function setMatrixHeight(id,xSeg,zSeg,height#) For landscape.matrix=Each matrix If landscape\id=id PokeFloat landscape\bank,(((xSeg* landscape\zSeg)+zSeg)*MatrixTileBankBit)+8,height EndIf Next End Function Function setMatrixTile(id,xSeg,zSeg,tile) For landscape.matrix=Each matrix If landscape\id=id PokeShort landscape\bank,(((xSeg* landscape\zSeg)+zSeg)*MatrixTileBankBit)+12,tile EndIf Next End Function Function setMatrixNormal(id,xSeg,zSeg,nx#,ny#,nz#) For landscape.matrix=Each matrix If landscape\id=id bankPos=((xSeg* landscape\zSeg)+zSeg)*MatrixTileBankBit vertex=PeekShort(landscape\bank,bankPos+0) VertexNormal landscape\surface,vertex,nx,ny,nz vertex=PeekShort(landscape\bank,bankPos+2) VertexNormal landscape\surface,vertex,nx,ny,nz vertex=PeekShort(landscape\bank,bankPos+4) VertexNormal landscape\surface,vertex,nx,ny,nz vertex=PeekShort(landscape\bank,bankPos+6) VertexNormal landscape\surface,vertex,nx,ny,nz EndIf Next End Function Function normaliseMatrix(id) For landscape.matrix=Each matrix If landscape\id=id UpdateNormals landscape\ent EndIf Next End Function Function shiftMatrixLeft(id) For landscape.matrix=Each matrix If landscape\id=id oldBank=landscape\bank landscape\bank=CreateBank((landscape\xSeg+1)*(landscape\zSeg+1)*MatrixTileBankBit) For x=0 To landscape\xSeg destX=x-1 If destX<0 Then destX=landscape\xSeg For z=0 To landscape\zSeg sourcePos=((x* landscape\zSeg)+z)*MatrixTileBankBit destPos=((destX* landscape\zSeg)+z)*MatrixTileBankBit For byte=0 To 7 PokeByte landscape\bank,sourcePos+byte,PeekByte(oldBank,sourcePos+byte) Next For byte=8 To matrixTileBankBit-1 PokeByte landscape\bank,destPos+byte,PeekByte(oldBank,sourcePos+byte) Next Next Next FreeBank oldBank EndIf Next End Function Function shiftMatrixRight(id) For landscape.matrix=Each matrix If landscape\id=id oldBank=landscape\bank landscape\bank=CreateBank((landscape\xSeg+1)*(landscape\zSeg+1)*MatrixTileBankBit) For x=0 To landscape\xSeg destX=x+1 If destX>landscape\xSeg Then destX=0 For z=0 To landscape\zSeg sourcePos=((x* landscape\zSeg)+z)*MatrixTileBankBit destPos=((destX* landscape\zSeg)+z)*MatrixTileBankBit For byte=0 To 7 PokeByte landscape\bank,sourcePos+byte,PeekByte(oldBank,sourcePos+byte) Next For byte=8 To matrixTileBankBit-1 PokeByte landscape\bank,destPos+byte,PeekByte(oldBank,sourcePos+byte) Next Next Next FreeBank oldBank EndIf Next End Function Function shiftMatrixUp(id) For landscape.matrix=Each matrix If landscape\id=id oldBank=landscape\bank landscape\bank=CreateBank((landscape\xSeg+1)*(landscape\zSeg+1)*MatrixTileBankBit) For z=0 To landscape\zSeg destZ=z-1 If destZ<0 Then destZ=landscape\zSeg For x=0 To landscape\xSeg sourcePos=((x* landscape\zSeg)+z)*MatrixTileBankBit destPos=((x* landscape\zSeg)+destZ)*MatrixTileBankBit For byte=0 To 7 PokeByte landscape\bank,sourcePos+byte,PeekByte(oldBank,sourcePos+byte) Next For byte=8 To matrixTileBankBit-1 PokeByte landscape\bank,destPos+byte,PeekByte(oldBank,sourcePos+byte) Next Next Next FreeBank oldBank EndIf Next End Function Function shiftMatrixDown(id) For landscape.matrix=Each matrix If landscape\id=id oldBank=landscape\bank landscape\bank=CreateBank((landscape\xSeg+1)*(landscape\zSeg+1)*MatrixTileBankBit) For z=0 To landscape\zSeg destZ=z+1 If destZ>landscape\zSeg Then destZ=0 For x=0 To landscape\xSeg sourcePos=((x* landscape\zSeg)+z)*MatrixTileBankBit destPos=((x* landscape\zSeg)+destZ)*MatrixTileBankBit For byte=0 To 7 PokeByte landscape\bank,sourcePos+byte,PeekByte(oldBank,sourcePos+byte) Next For byte=8 To matrixTileBankBit-1 PokeByte landscape\bank,destPos+byte,PeekByte(oldBank,sourcePos+byte) Next Next Next FreeBank oldBank EndIf Next End Function Function debugMatrix(id) For landscape.matrix=Each matrix If landscape\id=id For x=0 To landscape\xSeg-1 For z=0 To landscape\zSeg-1 bankPos=((x* landscape\zSeg)+z)*MatrixTileBankBit Text x*50,z*20,Int(PeekFloat(landscape\bank,bankPos+8)) Next Next EndIf Next End Function Function updateMatrix(id) For landscape.matrix=Each matrix If landscape\id=id For x=0 To landscape\xSeg-1 For z=0 To landscape\zSeg-1 bankPos=((x* landscape\zSeg)+z)*MatrixTileBankBit tiled=0 For tex.matrixTileTexture=Each matrixTileTexture If tex\tile=PeekShort(landscape\bank,bankPos+12) u#=tex\u v#=tex\v uM#=tex\uM vM#=tex\vM tiled=1 EndIf Next vertex=PeekShort(landscape\bank,bankPos+0) VertexCoords landscape\surface,vertex, VertexX(landscape\surface,vertex), PeekFloat(landscape\bank,bankPos+8), VertexZ(landscape\surface,vertex) If tiled Then VertexTexCoords landscape\surface,vertex,u,v bankVPos=(((x+1)* landscape\zSeg)+z)*MatrixTileBankBit vertex=PeekShort(landscape\bank,bankPos+2) VertexCoords landscape\surface,vertex, VertexX(landscape\surface,vertex), PeekFloat(landscape\bank,bankVPos+8), VertexZ(landscape\surface,vertex) If tiled Then VertexTexCoords landscape\surface,vertex,uM,v bankVPos=((x* landscape\zSeg)+z+1)*MatrixTileBankBit vertex=PeekShort(landscape\bank,bankPos+4) VertexCoords landscape\surface,vertex, VertexX(landscape\surface,vertex), PeekFloat(landscape\bank,bankVPos+8), VertexZ(landscape\surface,vertex) If tiled Then VertexTexCoords landscape\surface,vertex,u,vM bankVPos=(((x+1)* landscape\zSeg)+z+1)*MatrixTileBankBit vertex=PeekShort(landscape\bank,bankPos+6) VertexCoords landscape\surface,vertex, VertexX(landscape\surface,vertex), PeekFloat(landscape\bank,bankVPos+8), VertexZ(landscape\surface,vertex) If tiled Then VertexTexCoords landscape\surface,vertex,uM,vM Next Next EndIf Next End Function Function matrixExist(id) ;Returns entity memory address or 0 for does not exist For landscape.matrix=Each matrix If landscape\id=id found=landscape\ent landscape=Last matrix EndIf Next Return found End Function Function matrixPositionX(id) ;Returns integer only For landscape.matrix=Each matrix If landscape\id=id Return EntityX(landscape\ent) EndIf Next End Function Function matrixPositionY(id) ;Returns integer only For landscape.matrix=Each matrix If landscape\id=id Return EntityY(landscape\ent) EndIf Next End Function Function matrixPositionZ(id) ;Returns integer only For landscape.matrix=Each matrix If landscape\id=id Return EntityZ(landscape\ent) EndIf Next End Function Function matrixTileCount(id) For landscape.matrix=Each matrix If landscape\id=id Return landscape\tileCount EndIf Next End Function Function matrixTilesExist(id) For landscape.matrix=Each matrix If landscape\id=id If landscape\tileCount Then found=1 EndIf Next Return found End Function Function getGroundHeight(id,x#,z#) ;only returns an integer, but loads the variable height# with the result which can be globalised and read for a float return For landscape.matrix=Each matrix If landscape\id=id x=x-EntityX(landscape\ent) z=z-EntityZ(landscape\ent) tileX=Floor(x/ landscape\tileSx) tileZ=Floor(z/ landscape\tileSz) offX#=(x- (tileX*landscape\tileSx))/landscape\tileSx offZ#=(z- (tileZ*landscape\tileSz))/landscape\tileSz If tileX<=landscape\xSeg And tileX=>0 HeightTL#=PeekFloat(landscape\bank, (((tilex* landscape\zSeg)+tilez)*MatrixTileBankBit)+8 ) Else heightTL#=0.0 EndIf If tileX+1<=landscape\xSeg And tileX=>0 heightTR#=PeekFloat(landscape\bank, ((((tilex+1)* landscape\zSeg)+tilez)*MatrixTileBankBit)+8 ) Else heightTR#=0.0 EndIf If tileZ+1<=landscape\xSeg And tileZ=>0 heightBL#=PeekFloat(landscape\bank, (((tileX* landscape\zSeg)+tilez+1)*MatrixTileBankBit)+8 ) If tileX+1<=landscape\xSeg And tileX=>0 heightBR#=PeekFloat(landscape\bank, ((((tileX+1)* landscape\zSeg)+tilez+1)*MatrixTileBankBit)+8 ) Else heightBR#=0.0 EndIf Else heightBL#=0.0 EndIf reverseX#=1.0-offX reverseZ#=1.0-offZ height#=(heightTL*reverseX*reverseZ)+(heightTR*offX*reverseZ)+(heightBL*reverseX*offZ)+(heightBR*offX*offZ) EndIf Next Return height End Function Function getMatrixHeight(id,x,z) ;only returns an integer, but loads the variable height# with the result which can be globalised and read for a float return For landscape.matrix=Each matrix If landscape\id=id height#=PeekFloat(landscape\bank, (((x* landscape\zSeg)+z)*MatrixTileBankBit)+8 ) EndIf Next Return height End Function Function collisionModeOn(id) For landscape.matrix=Each matrix If landscape\id=id EntityPickMode landscape\ent,2 EndIf Next End Function Function getCollisionHeight(id,x#,z#) ent=LinePick(x,65535.0,z, 0.0,-65535.0,0.0) height=PickedY() Return height End Function Function collisionModeOff(id) For landscape.matrix=Each matrix If landscape\id=id EntityPickMode landscape\ent,0 EndIf Next End Function |
| ||
"This is the DarkBASIC Professional matrix commands recreated in Blitz3D for the heck of it, just incase any DBP deserters missed them :)" <sound of crickets chirping> Nope, didn't think so. :-) |
| ||
ew, why? |
| ||
ew, why? Actually this is a fairly powerful tileable landscaping system, add a detail texture to it (which admittedly I havn't built in a command in for but is very easy to do) and you've got yourself a powerful, deformable, tileable landscaping system that happens to use the same command names as DBP's matrix command set. Besides, it's funny. |
| ||
how about a createpowerfultileablelandscapingsystem() command instead of all those matrix commands |
| ||
Thanks, Becky! |
| ||
I thought I saw something like this already in the default Blitz3D examples. Probably much simpler, though. One thing I hated about DBPro (in addition to it's bugs and language inconsistancies) was the use of numbers instead of entities/pointers/handles like blitz. Why don't you improve it a little and use type handles instead of the dreaded structure-defying number system. Using hard-coded numbers isn't really well suited for any management of multiple items, IMHO. I made a terrain system similar to this once in blitz, although it didn't put the entire terrain in one huge entity. It split it up into segments to take advantage of blitz's view culling. I also couldn't seem to get rid of an ugly mip-mapping effect between unwelded tiles that appeared in the distance (although apparently DBPro suffers from this too when a terrain is mip-mapped). I'm curious as to whether you noticed this at all on your terrain system or not. |
| ||
I'm curious as to whether you noticed this [mip mapping bleed over] at all on your terrain system or not. Woah steady there, this isn't *my* terrain system :) - this is a tongue in cheek release which might be semi-useful to someone... I also couldn't seem to get rid of an ugly mip-mapping effect between unwelded tiles that appeared in the distance If you are using a tiled texture image then adjust the UV's by the width of a pixel so that you do not read the u/v co-ords from the very edge of each tile (where the adjacent tile will bleed over). pixelSizeU#=1.0/Float(TextureWidth(texture)) pixelSizeV#=1.0/Float(TextureHeight(texture)) You should have the pixel size calculated anyway in order to adjust the bottom right u/v co-ord - so you simply take away from the bottom right twice and add the pixel width to the top left once. When DBP had this problem it was a shortsighted bug. I imagine it's fixed by now it's been half a decade or so... The choice to use hard coded numbers was all part of the tongue in cheekniness of it using the same function names, although it does allow quite an interesting feature because you can give multiple "matrixes" the same ID number and adjust them in tandem. I'm not sure what you'd use that for though... To be frank if I was writing a generic terrain system for general release it wouldn't be this - I spent just over half a day on the code above and that's only because I threw it away twice whilst aimlessly deciding to change the way I was doing things for no other reason than I was just playing around. If there is seriously a market for a terrain handling command set i'll write one, but dont take it as this please! I mean it's useful and it does what it says on the tin and everything, but it's not exactly a shining example of how to do deformable terrain. |
| ||
If you are using a tiled texture image then adjust the UV's by the width of a pixel so that you do not read the u/v co-ords from the very edge of each tile (where the adjacent tile will bleed over). Ok thanks.. I think I'll try that. The choice to use hard coded numbers was all part of the tongue in cheekniness of it using the same function names, although it does allow quite an interesting feature because you can give multiple "matrixes" the same ID number and adjust them in tandem. I'm not sure what you'd use that for though... :) I never thought of that, although I don't think DB allows multiple matrixes to use the same number (I could be wrong..) Anyway, thanks for posting this. I'm sure some will find it useful. :) |
| ||
The mipmapping bleed issue is not one that you can really fix. Even if you adjust the UV's in by several pixels so that the closest mip levels look okay, you'll still have problems with more distant mip levels. Also, updating meshes is really slow, so the DB style of terrain was really only useful when 3D cards could not render many polygons. Fewer polyons meant less data to be uploaded to the card every frame. For today's terrains this sort of system is inadequate. But it does have the benefit of being easy to use. If you don't need your terrains to be large, or particularly detailed, but you do need a lot of variation in the texture and can't or don't want to use one very large texture, then maybe this might be of some use to you. It all boils down to using what's right for a partiuclar situation. |
| ||
Have you implemented any random bugs to give the functions a true BPPro feel? Something like this should do it:Function DBPRoEmulator() If Rand(1000)=Rand(1000) RuntimeError "Unknown error." End Function |
| ||
If you don't need your terrains to be large, or particularly detailed, The only serious limitation of DBP's tiled landscape system was that it had no secondary texture. If you want a big terrain a matrix is actually an excellent way of going about doing it but you dont make it big, you make it small - and then have it follow the camera. Basically this is the same as any other terrain system except: :( It requiresdouble the number of vertices of a conventional quad assembled landscape; :) It supports tiling of the texture; :) It can be used dynamically for ultra-large landscapes; :( It cannot feature LOD or poly reduction and still retain it's dynamicism :( Sucessful implementation of any LOD or poly reduction system will be in part impaired by the tiled nature of the lanscape. :) The last two points dont matter because it can be used dynamically around the camera |
| ||
"If you want a big terrain a matrix is actually an excellent way of going about doing it but you dont make it big, you make it small - and then have it follow the camera." I don't agree. Consider a 64x64 mesh. If you scale that to be a mere 64 meters wide, that's a detail level of one tile per meter. You don't really want to go much lower than that. 64 meters with you at the center means a maximum viewing distance of just 32 meters. A meter is approximately equal to a yard, and a yard has three feet. Telephone poles are spaced 100 feet apart. So 32 meters is approximately the distance between two telephone poles. I think you will agree that is not a very good view distance. Even if you reduce the level of detail to one tile for every two meters, you're still going to be seriously limited in your view distance. You might be okay if your game is set in the woods, but if you want open plains you'll have to do better than that. But that's besides the point, because even at a resolution of a mere 64x64 tiles, you cannot update the mesh in realtime. You'll kill the framerate. This is a big problem when people want to render water, because water requires vertex animation. So you're probably going to be realistically limited to a 16x16 terrain or at most 32x32 if you are willing to take the framerate hit. That's simply nowhere near the detail of modern 3D games. My own terrain system uses "tiles" where each tile is a 16x16 mesh itself, and it has like 32x32 of these tiles in a grid. That's way way more detail than what you're talking about and it's still just barely acceptable. I'm not trying to bash your terrain system or anything to sell my own. Nobody buys mine. :-) I'm just telling you my own exerience from using the DB terrains so long ago and from programming my own. Yes, with a scrolling terrain you can have extremely large terrains, but if you can't see more than a couple hundred feet in front of you, it's a lot less useful than it sounds. If you wanted to make a whole game set in the woods, I guess it would be of some use, but if I'm playing a gme set in the woods, sometimes you want to get out of them onto the vast open plains and see hills in the distance. :-) Oh and another drawback is that you can't go very high above the terrain because the terrain doesn't exist far from the camera. |
| ||
Like I said earlier, if there is demand for a landscaping command set i'll write one. You can run a matrix'esque landscape at high resolutions, although they're a bit slower than a quad mesh landscape like you are using because of the extra vertices. Those extra vertices serve a purpose though, which is tiling the texture - which massively increases the base texture detail. You can stitch multiple matrixes together just like your system, or you can lower the detail level and use them dynamically. The only difference to a quad mesh is that they have double the vertex count and so they can use repeating textures. As for this system, it uses DBP command names but please dont confuse it with DBP - i've no idea how it performs in comparison to DBP. One thing to note when doing dynamic landscapes, if you centre the view distance on the centre of the camera's view, and not the camera itself, you can increase your dynamic mesh view range by around 70%. I was doing 50x50 matrixes in DBP in realtime on a P400 and I see no reason why this system could not do that or even exceed it. I havn't done any speed tests though. In terms of vertice density 1 metre scales and all that, you've missunderstood the applications this would be usedful for, think Populous or Gliderrider on the Spectrum. Note everything is first person. With a tiled landscape texture you have a much higher texture detail so it's a tradeoff - base texture quality or vertex quality... What's important of those two isn't the same for each project. Anyway, ever heard the expression dont knock it until you've tried it? perhaps I should try this system myself... lol, half of it I didn't even test. EDIT: Just read back and saw that earlier you did say sort of the same thing before we deviated, sorry. |
| ||
LOL @ jb On-Topic: Great work Becky Rose! :D |
| ||
god Becks... you have waaaaaaayyyyy tooooo muuuuch freeeee tiiiime on your hands... :) kinda neat though... now, if you could recreate the Blitz3D command set in DBPro (even with Entities the entire set would number only just a lil more than the matrix commands you just translated) that would be an accomplishment that i'd be impressed with... --Mike |
| ||
I did miss those commands. Thanks |
| ||
The stuffy academics said that it couldn't be done, Captain Wicker. The straight-laced clergymen said that it shouldn't be done. The rest called you a madman. But you've proved them all wrong... because it's alive! Alive!!! Last edited 2011 |
| ||
Chiefy Brown himself couldn't have necro'ed any better than that. |