Help with 3d walls
Posted 14 May 2012 - 12:04 PM
Using instances in each cell with height variations, and identifying where it needs to be drawn a cliff, then i convert all that information on a list and save it. The ''real'' programs load the map info using that file, my first attempt was creating instances just like the editor, but having a room divided into 29x29 cells, hypothetically would take 900 instances to fill the whole room, even without having to fill all the cells, using a small map of less than half of the room it was creating nearly 280 instances. On the other hand visually, the result was what I expected.
But assuming that too many instances could affect the game in the future, I decided to use tiles as they are drawn only once, and you can give them different heights using its depth, but the problem of using them is that there is no way to draw the cliffs, at least not with tiles.
Right now I'm trying to find an efficient way to achieve this. Any suggestions? or should I resign myself using instances
Sorry for my bad English. Kakaru
Posted 14 May 2012 - 01:31 PM
If you want it to be destructable, you have 2 ways: drawing all the terrain or a terrain cell from a single model and when you add/remove a block it re-makes the model, anyway that's possible only if the models are small (meant as polygons, size dont make any difference), if the models are too big you will have the game freezing for some seconds as soon as you modify the terrain.
The other way is making many instances, but for the reason i said before you need to "merge" (dont know the exact word, im not english) the blocks, doing like if there's 4 blocks you should't have 4 1x1x1 instances, but a single 2x2x2 instance, same with 3x3x3, 4x4x4, and so on.. This way you will use the minimum possible amount of instances to draw your terrain.
Anyway remember this:
GM + voxels = Not a good idea.
Posted 14 May 2012 - 02:37 PM
I do not plan to make destructible terrain, so the giant complex model seems to be the only solution here, the only problem is that I never worked with primitive before, guess I could get a list of points to generate the vertices using the information of the map file, but I have no idea how to convert those vertices into filled surfaces, nor how to add the textures correctly! Could you please advise me how to assemble the model having the height information in each cell?
Posted 14 May 2012 - 02:48 PM
If you dont know how to make a model is:
modelvariable = d3d_model_create(); d3d_model_block(modelvariable,blablablablabla);As blablabla put the arguments you need.
Adding textures actually is the biggest problem because you cant use many textures but only a single 1, you should uv-map your model, thing that im ABSOLUTELY not able to, for sure someone out here can help you with that.
And for the height informations just use a 2d array e.g. myarray[0,0] set as first number the x and as second the y, then give it the value of the z in that position, i did the same with the terrain of my game and it works perfectly.
Edited by RevenantGhost, 14 May 2012 - 02:50 PM.
Posted 14 May 2012 - 03:11 PM
Thank you RevenantGhost
Posted 14 May 2012 - 03:33 PM
it will be more efficient, but will be even more efficient if you put all the blocks into a single model or into some models to make a kind of grid.
Yes, I am currently using one array to easily locate the height of each cell, no problem with that. I'm reading in the manual that models like the tiles are drawn only once so just to be sure I understood you well, replace each instance with a block model will be much more efficient right? being so I will try to use the blocks and learn to apply textures to them.
Thank you RevenantGhost
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users