Jump to content

Josh

Staff
  • Content Count

    16,301
  • Joined

  • Last visited

Community Reputation

8,709 Excellent

About Josh

  • Rank
    Advanced Member

Profile Information

  • Gender
    Male
  • Location
    San Francisco, CA

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. One player class? Yeah. I'm aiming for 1000 lines of code, maximum, and to keep it as simple as possible. The idea is to make a core game that is very easy to understand, and then let people go crazy adding whatever they want to it.
  2. Josh

    Bone Attachments

    The physics system is an IK system, and could be used for character joints. It's not easy, but renaming a bunch of commands would not make it any easier.
  3. Josh

    Bone Attachments

    No plans for this.
  4. Josh

    VSCode Lua debugger

    Oh god, it's not compatible with 5.1 nor is it compatible with 5.3. What are these guys thinking?
  5. Josh

    VSCode Lua debugger

    I don't know what Lua file is supposed to get executed.
  6. Josh

    Bone Attachments

    Bones can also be positioned with code, using many of the same commands as the entity system (although they are not the same code internally).
  7. Josh

    Bone Attachments

    In Leadwerks Game Engine 4, bones are a type of entity. This is nice because all the regular entity commands work just the same on them, and there is not much to think about. However, for ultimate performance in Leadwerks 5 we treat bones differently. Each model can have a skeleton made up of bones. Skeletons can be unique for each model, or shared between models. Animation occurs on a skeleton, not a model. When a skeleton is animated, every model that uses that skeleton will display the same motion. Skeletons animations are performed on one or more separate threads, and the skeleton bones are able to skip a lot of overhead that would be required if they were entities, like updating the scene octree. This system allows for thousands of animated characters to be displayed with basically no impact on framerate: This is not some special case I created that isn't practical for real use. This is the default animation system, and you can always rely on it working this fast. There is one small issue that this design neglects, however, and that is the simple situation where we want to attach a weapon or other item to an animated character, that isn't built into that model. In Leadwerks 4 we would just parent the model to the bone, but we said bones are no longer entities so this won't work. So how do we do this? The answer is with bone attachments: auto gun = LoadModel(world, "Models/gun.gltf"); gun->Attach(player, "R_Hand"); Every time the model animation is updated, the gun orientation will be forced to match the bone we specified. If we want to adjust the orientation of the gun relative to the bone, then we can use a pivot: auto gun = LoadModel(world, "Models/gun.gltf"); auto gunholder = CreatePivot(world); gunholder->Attach(player, "R_Hand"); gun->SetParent(gunholder); gun->SetRotation(0,180,0); Attaching an entity to a bone does not take ownership of the entity, so you need to maintain a handle to it until you want it to be deleted. One way to do this is to just parent the entity to the model you are attaching to: auto gun = LoadModel(world, "Models/gun.gltf"); gun->Attach(player, "R_Hand"); gun->SetParent(player); gun = nullptr; //player model keeps the gun in scope In this example I created some spheres to indicate where the model bones are, and attached them to the model bones: Bone attachments involve three separate objects, the entity, the model, and the bone. This would be totally impossible to do without weak pointers in C++.
  8. Has anyone been able to use the Lua debugger VSCode extension by "devcat"? I am trying to get this working. It requires luasocket and I am not sure how to set that up.
  9. There is something else you can try. There is a secret setting you can add to the Leadwerks config file found at "Documents/Leadwerks/Leadwerks.cfg" "maxpublishzipsize" is the maximum zip file size, in bytes. Try adding that key in with a value of maybe 268435456. Then start Leadwerks and publish again, and it will create multiple zip files.
  10. This character is pretty much perfect: https://cubebrush.co/fabianoribeiro?product_id=rynrgq
  11. If we make that the long-range weapon, you might want to put a scope on it.
×
×
  • Create New...