MexSource Posted December 12, 2013 Share Posted December 12, 2013 Hello, I would like to create a cube but don't assign it to a variable like create unlimited, but i only found entity::copy... i have a cube that i want copied but it seems like i need somthing to copy it to. any solution? - Mex Quote C++ :3 Link to comment Share on other sites More sharing options...
Rick Posted December 12, 2013 Share Posted December 12, 2013 You won't be able to create unlimited number of these. At some point you'll hit a major slowdown if you make boxes like this. There is a way that'll give you more on screen as it creates instances instead of a new, however they will share the same material so changing a material on 1 will change it on all. I think a parameter to the instanced function will allow you to have new materials but again it'll hit limits faster. Are you thinking of a minecraft type game because if you are it's not going to be as simple as you are thinking. Nothing ever is in game development. If you haven't already you'll want to see what minecraft does to make things an acceptable speed. Create a cube via code http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/model/modelbox-r346 You'll most likely want to save these in variables or you'll get memory leaks. Just store them in a std::list or vector. Quote Link to comment Share on other sites More sharing options...
MexSource Posted December 12, 2013 Author Share Posted December 12, 2013 Thought about this :/ and yes i think minecraft running not extremely laggy because minecraft doesnt render any blocks that you can't see (you see it when you stuck in glowstone if the bug isn't fixed) But it should not be a second minecraft, it should be a puzzle game with block placement (puzzle game with voxel elements) Will try The list (forgot about that...) - Mex Quote C++ :3 Link to comment Share on other sites More sharing options...
Josh Posted December 12, 2013 Share Posted December 12, 2013 Entity::Instance() will be faster, but for Minecraft style scenery there is a special algorithm you should look into. 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...
Guppy Posted December 12, 2013 Share Posted December 12, 2013 Google marching cubes - it's an old naive approach but for minecraft style landscapes it's perfect. ( just Need to alter the look up tables to squares ) Quote System: Linux Mint 17 ( = Ubuntu 14.04 with cinnamon desktop ) Ubuntu 14.04, AMD HD 6850, i5 2500k Link to comment Share on other sites More sharing options...
Rick Posted December 12, 2013 Share Posted December 12, 2013 Josh, why is Entity::Instance() crossed out in the docs? Quote Link to comment Share on other sites More sharing options...
ZioRed Posted December 13, 2013 Share Posted December 13, 2013 Entity::Instance() will be faster, but for Minecraft style scenery there is a special algorithm you should look into. Oh finally, I had speed lag issues with Copy for my bullets, now with Instance it works smoothly! Thanks 1 Quote ?? FRANCESCO CROCETTI ?? http://skaredcreations.com 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.