marchingcubes Posted January 1, 2015 Share Posted January 1, 2015 Hi, I've recently started using Leadwerks and so fair it's been a pretty great way to get my basic game mechanics in place. I was able to animate and texture my character models in blender, get that into the engine and animation looks and works nice - Terrain looks great (though there seems to be some non-critical performance issues that I am sure will shake out in time), and the lighting/shadows are very nice. Currently I have the Lua-only Leadwerks Indie, and it has been all I have needed to this point. However, I do have a couple of requirements for gameplay in my game that I am unsure about Leadwerk's suitability for - one is underwater swimming - this will be a big component of my game, but I don't see much in the way of support for flight/swim type character controller. I'm not really worried about the way the water looks, but when the player enters water, I would ideally like to have a completely different physics model, where buoyancy, instead of gravity is the dominant force, and 'enemies/prey' that navigate in a way that makes sense in a '3D' environment instead of on a nav mesh. I know 'Water' is on the list of things for 2015, but I am not sure what that means in terms of physics, as opposed to just pretty shaders for water surface. Another is the non-human size/shape of my characters - this already poses a bit of a visual problem navigating around the world as the character intersects with slopes - my current plan to deal with this is to raycast and adjust the character pitch (the model is separate from the invisible character controller, and its position is updated each frame), however, it would be nice if there was a robust way to get 'close to perfect' collision with an arbitary-shaped character mesh - I know from reading other forum posts this is not easy, due to assumptions made in the NavMesh code etc. Theoretically, I could probably implement everything by turning off mass on my objects and just handling motion and collision detection myself in Lua, but I have a feeling this might slow things down, or just get really ugly. Which brings me to my next question - assuming Leadwerks is unlikely to provide this kind of functionality 'out of the box' anytime soon, would I be able to implement this stuff myself using the C++ API? Is it extensible in that way, i.e. could I override the Character Controller class with my own custom setup, or would I effectively need source-level access to Leadwerks to do this kind of thing effectively? I have done a bit of work with OGRE and Bullet previously, which was a lot more 'Open' than Leadwerks is (not a complaint, I'm a happy customer) - But just want some guidance/advice on how I should best proceed with this sort of thing. Should I just buy Leadwerks C++ and get busy hacking, or is it likely that Leadwerks is just not going to work all that well for this concept, and I should look elsewhere? Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted January 1, 2015 Share Posted January 1, 2015 With C++ you can even swap out the Newton physics engine for another physics engine if you want to. This does require some decent skills with C++ though. If you stay with newton, you would have to make your own class but you can make use of the physics objects that that come with newton. Quote Link to comment Share on other sites More sharing options...
Thirsty Panther Posted January 2, 2015 Share Posted January 2, 2015 Interesting. I came across this on the the newton wiki. http://newtondynamics.com/wiki/index.php5?title=Buoyancy But I don't know if the buoyancy is exposed to Lua or C++ in Leadwerks. Maybe Josh could shed some light? Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted January 2, 2015 Share Posted January 2, 2015 Even if it is exposed, there is no official documentation. Since water is going to be added in 2015 I am expecting it will be implemented like with the water in leadwerks 2. Quote Link to comment Share on other sites More sharing options...
shadmar Posted January 2, 2015 Share Posted January 2, 2015 Not documented, but you can give it a go anyway: Entity class have this : virtual void AddBuoyancyForce(const float nx, const float ny, const float nz, const float d, const float fluidDensity=1.0, const float fluidViscosity=0.1);//lua Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB 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.