It’s a giving time and we have a little present for you: a 3D third person playground sample where you can go around, collect gold and store it - it comes with a character controller, physics, virtual gamepad, and shadow mapping!
The credit goes to @sergeysinyavsky for preparing this example and Kay, Kenney and Mesh2Motion for the assets!
P.S. We will add a little bit of a manual/documentation for it and it will be added to the Samples in Defold welcome screen in the next release (after 1.12.0).
All of the objects are kinda jittery where they meet the ground though, when you move around. As if the objects and the ground are fighting over which one should be visible.
Edit: actually it’s not just near the ground. Check this video. The plants, the strap on the wood, the bottom of the rock, etc, are all jittery.
Try testing increasing the precision in the shaders? highp instead of lowp/medp you can see high versions of the shaders in the materials folder of the repo.
I love the example. It have almost everything I need for my new game prototype. However for some reason it does not render properly with Defold 1.12.3 (works correctly with Defold 1.12.1 and 1.12.2!).
added new controls mode, and current steering mode is changed to the new “screen-fixed”, which means clicking up always get the character to the top side of the screen, etc. - in opposite to the previous mode that was used e.g. in old RE games, “tank-like”, where moving up moved the character forward to its direction (you can still use it by setting the go.property is_controls_screen_fixed to false).
added audio (sounds for picking and depositing items, collisions with balls and barrels and footstep sounds with an audio Lua module)
improved shadowmapping (refactoring code, local instancing, larger shadow buffer for high tier, reduced draw calls, removed color buffer during depth pass for shadows)
refactored shadowmapping.lua module to not use anymore deprecated APIs and constants that will be removed in the Defold 1.13.0
enhanced documentation explaining the project structure and how it works, including shadowmapping description
I was really impressed by the README, I also really liked the new control scheme and sounds, but honestly, the biggest difference for me is performance. I had no issues with the previous version, but just out of curiosity I compared both version’s FPS with Vsync off for and I’m blown away!
Previous version:
HIGH: 130
MID: 220
LOW: ~1450
New version:
HIGH: 1190
MID: 1260
LOW: ~1500 - 1600
and after my tweaks:
VERY HIGH: 1180 – Just 4k shadow buffer 8k does not improve quality, but starts to affect FPS.
ULTRA: 850 – 4k shadow buffer and 5x5 diffuse kernel.
Soooo… On high settings, new version not only works literally almost 10x faster but also looks better (prev. version had 1k buffer in high). Excellent job! I will include it in my game ASAP Many thanks!
I observed only one issue, had it too with previous version… on my Ubuntu virtual machine ground shadows seems to not work (but you can see shadows on planks) and character is not animated).
Edit: After including new rendering to my proto, my FPS went up by factor of 2 (when running 2 instances, one in VM, so large overhead) and by factor of 6 when running just 1 instance natively!
Also problems were caused by Virtual Machine - everything works fine on old laptop with Debian.
Utilising instancing and cleaning materials allowed to reduce draw calls from over 100 to 29 on mid/high, and 17 on low with shadows off (afaik this includes 1 draw call for profiler ui drawing)
Yeah, in PC games you can safely double the size of the textures, I took into account also mobile and web games, and all other settings regarding shadows can be adjusted arbitrarly.
I’m developing on Ubuntu 24.04 (and testing also sometimes on Windows 10) and everything works there. I know there were some issues in the past, especially regarding animations, but those are now fixed for Linux, so might be something specific for the VM.