This is my first project with Defold. Wanting to make a relaxing boat simulator game on top view.
I’m making the first steps after studying Defold tutorials:
There is viscosity friction affected by the orientation of the boat. It should slide better moving forward, while having more resistance opposition from water when having lateral motion.
I used Linear Damping and Angular Damping to simulate the general friction of the movement in any direction, but calculated and applied the additional viscosity friction on every frame of the simulation.
You can play with the demo, compare behavior of the standard dynamic objects vs the green boat and read about the easy math behind, here on my blog.
With this first quick test level I could feel how is to rowing the boat for longer distances… and is actually fun!
Imagine that you can’t do collision with solid obstacles or your boat will crack, after 3 times you sink… that’s will add lot of tension to the game, and focus on precision and anticipation instead of high-peed.
Had a little dalay today of few ours because a little issue with float point precision…
I was a bit worried about high definition displays on devices. (Since people are buying whatever companies want them to buy, like this 806ppi phone) Maybe because I grow up with CGA, I still like to see my pixels… well:
Documentation suggest to use graphics content of the game as double size, then scall down 0.5x. Then my worries were that the modest innocent low resolution phones will suffer lower performance to please the big expensive ones…
Good news: There is almost not performance lost
Tested with @britzl bunnymark project on standard resolution phone.
With sprites at %100 I get 8,000 bunnies at 29.8 FPS.
Scaled all bunnies on photoshop, to %200, added then tested like this and I got 18.3 FPS for the same 8,000 bunnies.
Finally scaled by code at runtime the bunnies game objects to 0.5x, and I got 28.6 FPS.
For me is conclusive, no more worries, everything would be scaled down. Maybe you all now that but this is news for me
Now we just need a setting on atlases to scale down all sprites images at once.
Great! thank you, That is my next need, custom shapes to make a kayak an other types of boats… currently using basic shapes only.
I was scaling the game objects only on X and Y axes, collision objects ignored the transformation, now I know that need to scale uniform and always include Z axis too. Problem solved.