Jump to content

making leadwerks work for non-FPS


marchingcubes
 Share

Recommended Posts

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?

Link to comment
Share on other sites

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

HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...