I am working on my game project now for a few years and up until 2016 everything I did have been fundamentals (like network code, entity system, client side prediction, …) and because all of these parts are actually written in Ruby there was nothing to really share here.
2016 started to be a little bit different.
Around late 2015 I was doing the movement code, first using bullet, then moving to the native version of bullet and then I also implemented some collision detection library by my own. Always trying to get the performance for my heavy sweep testing using movement code and always failing (the replay part of my client side prediction code caused peaks)
During this time I was very curious about NVidias PhysX and I also got access to the github version of the library, so I thought F*** it, lets give it a try. After a “little bit” of gradle setup and writting the JNI wrapper I got it working:
And after testing it in my game I was surprised to find out that the performance of the sweep tests did not cause any issues anymore. I was really hyped about it, tbh;)
Please don’t get me wrong about this - I don’t intend in any way to say that the performance of physx is better then bullet or anything like this. It was just working better for my very specialised case.
Anyway, players have been able to move around the world and see each other - great. But I needed a little bit of a break of writing fundamental code and the first visual thing I needed to “fix” was to include animations, so that the character models are not floating around but actually walking.
After a few tries I was settled that simply playing fixed animations will not work out for me without investing a lot into creating several specialised animations. I did a little bit of looking around and found (like most probably many before me) Rune Skovbo Johansen’s master thesis about “Automated Semi-Procedural Animation for Character Locomotion” which was exactly what I wanted to have.
I looked into its unity implementation (and btw, my personal opinion on unity is that its a mess) and thought I could do a similar system in JMonkey.
Puh, it was hard but I was able to make a working prototype:
There are still a few errors in the simulation, but during locating the reasons for it, I found out that some errors are actually originated in the bad animations I am using for sampling the walk/run circle.
I was a little bit suprised how hard it is to actually find free good looking cyclic run/walk animations. Then again, I was suprised how many different skeletons are out there (I was using some bought models so far and they all had different skeletons). So I did a little retarget prototype but was not really satisfied with the result and came to the conclusion that if I really want to settle this topic, I need to take care about the “customizable characters” topic first.
So I needed to do a morphing library. From the math involved this is actually a lot easier then the motion sampling, but you need some assets to test the algorithms and I am a pretty bad artist… I started using assets from MakeHuman but soon switched to manuel bastioni’s really great looking character assets (www.manuelbastioni.com) to do a basic implementation.
This is an example using manuel’s assets, but the libray can use any blender model (custom blender exporter plugin).
I was really happy with the result and I wanted to include this morphing library into my motion test. But during putting it into place, I thought I needed a cool looking spawn effect. I always liked the visual work of tonegod, so I used his emitter project and wrapped it with some stuff, so I can also use it in the morph library (e.g.: To make burning hair or, …).
Again I was impressed by how good JME can look;) Thanks to @t0neg0d
As I was wrapping the physical influencer part, I thought I needed to include this into my PhysX pipeline to make it really work probably (adding collision objects locally was no working solution for my scenario). So I wrapped the particle PhysX module and again was pleased:
I don’t have a plan for having fluids in my game so far, but I simply could not resist to give it a try and also fluid particles are working nicely:
While browsing through the physx documentation for wrapping the particle functions I also found out that their clothing module as actually also based on the particles engine.
And again - I simply could not resist:
Currently I don’t want to use physX’s Hair module, but I think the results from using the clothing module are already ok-ish:
Now its 2017 and I feel like I went a full visual circle of side projects only to be back at clearing issues in the leg motion system:
JMonkey year 2016 was quite a ride for me. A lot of math queerness and some pain in the a** issues but also a lot of fun! Thanks a lot to all of the JMonkey community for providing this great engine in its current state. A special thanks also to @nehon and @pspeed for helping with some issues^^