Shadow132 Posted November 2, 2015 Share Posted November 2, 2015 I am pretty new to this program and would like to make a basic game that has a survival aspect to it and the problem i'm running into is making the map generate more and more terrain that is completely random or if that is even possible. Quote Link to comment Share on other sites More sharing options...
Slastraf Posted November 5, 2015 Share Posted November 5, 2015 everything is possible , but its a question of effort that you put into it. I dont think the terrain can be edited inside the game itself via code, so you would need to create your own terrain from scratch (in lua or c++ scripts). I would guess it can be done in the future when theres a newer update of leadwerks Quote Link to comment Share on other sites More sharing options...
Shadow132 Posted November 5, 2015 Author Share Posted November 5, 2015 Ok thanks also would it be different if I wanted say a island that was procedural like in the game Rust Quote Link to comment Share on other sites More sharing options...
Slastraf Posted November 5, 2015 Share Posted November 5, 2015 Actually if i think about that now, you could make some Island parts in a 3d program like blender, save them as a prefab. Next thing you do is making a script that places those prefabs in a way that it looks like an island also theres an option in eladwerks that you can make water on a map. use it Quote Link to comment Share on other sites More sharing options...
Shadow132 Posted November 5, 2015 Author Share Posted November 5, 2015 Alright thanks again I'll try and make some prefabs Quote Link to comment Share on other sites More sharing options...
shadmar Posted November 5, 2015 Share Posted November 5, 2015 You can manipulate terrain using Terrain:SetHeight(x,y,z,false) with perlin noise. However computing perlin noise in lua is rather painly slow, lua doesn't do complex maths very fast compared C/C++ witch upto hundreds times faster or GLSL by thousands times faster. (yes I've tested) So I'd recommend using C/C++ or GLSL for the noise generation, rest could be done in lua just fine. Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Wedmer Posted November 8, 2015 Share Posted November 8, 2015 You can use ffi to use C functions. For example http://staffwww.itn.liu.se/~stegu/simplexnoise/Noise.lua Quote Link to comment Share on other sites More sharing options...
Wedmer Posted November 9, 2015 Share Posted November 9, 2015 Tested code from the link above. The code should be modified a bit. Generation time for 2048 map is acceptable. 2 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.