Jump to content
  • Advertisement

Kundelstein

Member
  • Content count

    3
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Kundelstein

  • Rank
    Newbie

Personal Information

  • Role
    Programmer
  • Interests
    Programming

Recent Profile Visitors

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

  1. Kundelstein

    Root bone moving character

    Thank you for the link. It was helpful. Yes, I was trying to make a non-treadmill system, so the whole animation would be self efficient in terms of motion (though gameplay tweaking of such system is probably nightmare). I ended up with such solution: I add one extra virtual bone to the system which is holding root bone position before current update. then I mix all animation layers. Then I have new pose to display and I can calculate delta like this: delta = old_root_bone_pos - root_bone_pos; I don't really handle rotation right now but if necessary, I will just get single axis, as some animators tend to lean root bone to make characters look like running. Noticed that some programmers do it a bit differently - they generally calculate delta of the whole animation just after loading and then they "convert" the animation to treadmill by moving root bone linearly by the constant step, where step is calculated like: step = delta / number_of_anim_frames; The second approach seams a bit like cheating and won't work with complex animations but maybe it is not really a problem, specially if we put collider in root bone position and not at character origin position. I don't really know - I'm too noob in animation systems.
  2. So I have probably common question but somehow I got stuck and need a little help. I managed to glue together skinned character animation player in C++/OpenGL (though it really does not matter). As an input I use MD5 (3d models from Doom) and Spine2d (2d animations in JSON). Everything works like a charm, with full blend tree support, skeleton deforming on GPU by supplied positions and quaternions, just like mama tough us with MD5. The problem started when I tried to add a proper animation from root bone: To make blending between 2 animations a bit better, I had to remove the root bone rotation and position so the bones will "morph" more locally - otherwise If I mix animations '90 degree rotating' with 'standing still' the bones would be placed in bad positions. This is because positions are lerped, so they move on straight line. At the end of animation I just add the root bone to the whole skeleton and everything looks fine. This also served as a base to object moving. As we all know, after the walk cycle such animation will pop to the start position. Unfortunately, to make object move, I can't just add the animation delta at the end of the cycle. This is because if I change the animation weight, the end position will get weighted too. I just checked the Doom3 source code and it looks like they are storing animation delta of the full step, but maybe it is for evaluating where the animation will end up (AI and such). For now I assumed that I just need position. I store the root bone position before the frame time update as some additional old_root_bone joint. Than I pass this old_root_bone with all other bone positions (including the root bone itself) and when I'm ready to draw I can extract the difference in step and add it to the character position. It works. Some minor thing to figure out is if I should take into consideration the Bind Pose of the root bone and add it somewhere. The problem is that I have no clue what to do with the rotation. I have noticed, that some animations (I 'borrowed' animations from Batman Arkham series, as those are well suited for full character animation) rotate root bone as they please - for example in running animation the character is leaning forward - and if I rotate the model by difference in animations - I end up with character moving like hamster in the wheel. So after this wall of text my questions are: 1. Am I doing the moving character from the root bone correctly? 2. Is this a common thing to ignore rotation and do it somehow manually in script? Eventually I can extract only single axis animation and use this, but I have no idea if that is a proper choice. 3. What are common practices for this kind of animations? I'm attaching a short movie how the things look like. The 3 buttons below are: - node stand/walk/run - anim weight - node stand/rotate90/rotate180 - anim weight - cross between the above 2 nodes (actually it is the weight of the turning node, but it is the same thing in this case) BatWalk0001.mp4
  3. Kundelstein

    What is the current way - Technology

    Just to add my few cents after logging here after years of absence. I'm 20+ years game developer. At work I am strongly pressed against the wall to use Unity. After a while with Unity you will forget what good programming is and you will stick with static members/classes, public variables and singletons (not to mention the hard time you will get with enums). I really wanted to get in touch with UE4 but unless you are small cog in AAA title machine or have really dedicated team who want to make game (even just in blueprints), there is a little chance to use it. Modern C++ is a mess, when it comes to developing games. Few years ago it was even advised to use any alternative for all containers (the best at the moment would be EASTL), though luckily it got to some stable point with C++11. There is so many things put into C++ nowadays that from time to time I'm finding myself changing a really beautiful, clean C code into some C++ monster (not to mention doubtful speed improvement). Doom3 had it nice - they use C inside of C++ and somehow got away with that. Few years ago it was really cool as you could use C++ to make mobile games (Objective-C++/Android NDK), now there is Swift/Kotlin used as a main road. The gfx API world was never that fragmented as today. OpenGL is being replaced by Vulcan. DirectX goes really strong and now with their raytracing techniques it is even more attractive, but for the price of being stuck in M$ bubble. Apple has their own Metal and even if they still support OpenGL, their main focus is to get people stuck in their own fruit garden (luckily recently it got unofficial Vulcan support). Consoles nowadays use OpenGL or their own gfx pipelines (except XBox of course) - I have no clue how it is with Vulcan there, though. I have my small game engine written in C++/OpenGL. It is portable up to some point (So far it is Windows/OSX/iOS) . Every time I spend my extra time to add some feature or just refactor some parts, I start thinking is it even worth it. There are some noble examples of games using their own engines (like Darkest Dungeon) and they also had their fair share of problems due to OpenGL 3.1 not working on older hardware. There are so many techniques nowadays that it is scary. I'm not talking only about gfx technologies, but also coding techniques to squeeze more out of several cores and GPU. Resources to learn from: sites are dying like flies in the heat. Sometimes if you are lucky you can find something just by googling, otherwise you have to know what to search for and try github. Surprisingly sometimes there are nice YT tutorials where people code. Unfortunately usually you will have to filter somehow dumb questions about Unity/UE4 blueprints and some really basic stuff.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!