Road Kill Kenny Posted September 17, 2012 Share Posted September 17, 2012 Hi All, I'm trying to make a very difficult decision concerning level construction in my game and thought I'd bring it forward to see what other people think. Currently my levels are broken up into a bunch of sections. Each section contains a floor which is one mesh for the entire floor of that section and then a number of walls (varying per section). You may have seen this in one of my past blogs called "A Bucket 'O' Walls". Now this has worked and it is possible for me to go all the way like this. However, there are some downfalls namely Every section has to be modelled uniquely (almost) which means a lot of extra artwork and man hours The positioning of these can't really be "snapped" into nice unit lengths because they are all unique. Some rather big pieces with possibly bigger textures than I may want. Kinda pointless making an editor for it when everything has to be modelled in Blender first. Now I have been pondering another method which acts more like a construction kit/set where I pre model a bunch of level parts that I can re-use to make almost any level I want. I could make this work in an editor nicely and you simply put it together like lego and then add assets once the level frame is made. Some example pieces would be like 1x1m floor, 1x2m floor 10x10m floor, 5x3m wall, 1x1m wall corner etc. etc. Everything would be based on unit dimensions (no decimal points) that way the level could be made to snap together nicely. I could also have a set of standard textures that I could slap on them and would fit nicely to make level creation very quick. However, there are problems with this as well that I can see: Possibly too many entities making performance bad. Well yeh that's about it but that could be a killer. So what do you think, risk the many entities or go with the unique level models and extra work. I'm kind of undecided at the moment. Please keep in mind when r esponding that my game is completely data driven and for certain reasons I cannot, use .sbx or leadwerks editor to make levels. I also doubt that the CSG editor in LE3 would mesh nicely with my code architecture (subject to testing) so for the sake of my question please pretend CSG & LE3 does not exist even though I may port my game over to it. Quote STS - Scarlet Thread Studios AKA: Engineer Ken Fact: Game Development is hard... very bloody hard.. If you are not prepared to accept that.. Please give up now! Link to comment Share on other sites More sharing options...
macklebee Posted September 17, 2012 Share Posted September 17, 2012 the camera angle that you are using would probably prevent any problems with large amounts of entities being drawn when using the second style of snap-together parts... we did a similar thing in a small project and the cameraview culling items not seen seemed to work just fine... and your camera angle seems to be more topdown than what we had so it should work even better... the scene shown here are all parts snapped together... 2x4 floors, 2x4 walls, etc.. http://www.leadwerks.com/werkspace/page/videos/_/xray-shader-kinda-r114 Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Road Kill Kenny Posted September 17, 2012 Author Share Posted September 17, 2012 Let the construction kit begin Quote STS - Scarlet Thread Studios AKA: Engineer Ken Fact: Game Development is hard... very bloody hard.. If you are not prepared to accept that.. Please give up now! Link to comment Share on other sites More sharing options...
Paul Thomas Posted September 17, 2012 Share Posted September 17, 2012 Balance your distance culling and you'll be fine. One of the major benefits of modular meshes is sadly lost in LE and that's scaling. Culling is your friend, clever culling makes it undetectable by the player, and have fun. Your project looks fun, let me know if you ever need help with something. Quote Link to comment Share on other sites More sharing options...
Daimour Posted September 17, 2012 Share Posted September 17, 2012 I think construction kit will be the best solution. Especially if you will release your planned feature to load and unload parts of level when needed. Quote Link to comment Share on other sites More sharing options...
Josh Posted September 17, 2012 Share Posted September 17, 2012 The Amnesia developers used an approach similar to what you describe. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Road Kill Kenny Posted September 19, 2012 Author Share Posted September 19, 2012 So I've got it mostly working though I forsee a problem. I was hoping to just have 1 of each type of "lego piece" (if you will), and then just paint them with different materials. However, when you load the same mesh twice it automatically instances the one that is already loaded and if you paint one you paint them all. This means I can't have a differently textured floor in one room than another unless that different room uses different meshes. So basically for each lego piece I can only have 1 texture on for a whole level. Is there any way to separate them (un-instance) the meshes without having to make duplicate gmf files of every single lego piece? If not I could potential just support a maximum of 3-5 differently named pieces that are exactly the same but different file name but I'd rather not if there is a better way. Quote STS - Scarlet Thread Studios AKA: Engineer Ken Fact: Game Development is hard... very bloody hard.. If you are not prepared to accept that.. Please give up now! Link to comment Share on other sites More sharing options...
Roland Posted September 19, 2012 Share Posted September 19, 2012 So basically for each lego piece I can only have 1 texture on for a whole level. I was also into this idea but found the same problem. Did not find any really good solution so I'm exited to see if someone has one. Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
Road Kill Kenny Posted September 19, 2012 Author Share Posted September 19, 2012 Well I've consulted the Command Reference Documentation in Leadwerks for meshes and found AddMesh(TMesh src, TMesh dst). Not a function I've ever used but may work if it works how I think it does. http://www.leadwerks...es/addmesh-r308 So from what I gather it adds the data of one mesh to the data of another. I'm not sure if that includes UVs (but I hope it does). So perhaps I can just make it so that when I have the same mesh with a different texture I can just Add the mesh from one to an empty mesh (which is created with CreateMesh() and then paint it different. I have no idea if this will work though because I don't know the nature of the function but we'll see. Here's a question for Josh. Am I likely to have this same problem in LE3 or does it work differently in LE3? 1 Quote STS - Scarlet Thread Studios AKA: Engineer Ken Fact: Game Development is hard... very bloody hard.. If you are not prepared to accept that.. Please give up now! Link to comment Share on other sites More sharing options...
tjheldna Posted September 19, 2012 Share Posted September 19, 2012 With my indoor level I have gone the building block approach. If that function AddMesh can return an entity that can be repainted that would be nice indeed. Let me know what you find! Quote Link to comment Share on other sites More sharing options...
Daimour Posted September 19, 2012 Share Posted September 19, 2012 It should work. CreateMesh() and then AddMesh(). Probably you will need TranslateMesh() for correct positioning. And don't forget about UpdateMesh(). And physics body, if you need them. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.