Hello, everyone! I’m Maksim, and we run a two-person company with @aglitchman. Last year, I had thoughts about making a game with Defold that will use 2d physics and physics joints in an enjoyable way. I came up with the idea of implementing a soft body in Defold. Also, I wanted to use the physics API provided by the engine without any external native extensions. I managed to do it, and I want to point to this tutorial because it helped me a lot in this task.
So, I got a soft blob-like thing, and I was tossing with it in a prototype for a very long time. It turned out that it’s tough to invent something new. Finally, I got an idea of a fat cat that likes to blow balloons. The name of the game is Puffy Cat, and I’ll be glad if you play it on Poki!
The final version of the game has 150 levels, 26 hats, 18 balloon skins, 225 sprites, 35 sound fx, and plenty of fun! And we agreed with the publisher to make two more games in the Puffy Cat series with new game mechanics and content.
What I like the most about Defold is that:
- I use Defold IDE to make levels, i.e. I have quite a few pre-made game objects to construct a level. Every level is a collection with references to these game objects. All these levels linked to the parent collection as Defold’s collection factories. It’s an easy way to make levels without any external editors like Tiled etc.
- All I need to run a game from sources is to download Defold IDE and build/run a project.
- Amazing build time and the run-fix-restart-fix-restart-… loop. I absolutely agree with the slogan: “Spend time making games, not waiting for builds!”.
- Defold has the CLI tool
bob.jar
that we use for CI to make debug builds for internal use, and release builds for the publisher. - Defold has free source code access, and that gives, especially for us, two important things. First, the engine is not a black box, and if something doesn’t work as you expect, you can look into the source code and find the answer. The second is that you can propose any useful changes, and we added the Weld joint to the engine that we’re going to use in the next part of Puffy Cat.
Gotchas
- While the development I faced this issue, but I managed to fix it by moving a reference to a common large collection from levels collections to a parent collection.
- In-game physics is tuned up to run with a fixed timestep on 16.67ms (60fps) or less. Otherwise, objects could fall through each other. We set
display.vsync
= on,display.update_frequency
= 60, and it turned out to be an issue because the game runs in “slow-mo mode” if a player has really slow hardware. @aglitchman did a temporary workaround for this. To sum up, it will be awesome if a developer can write his own “gameloop script” to control update/physics/render steps. @aglitchman will write his thoughts soon, I think.
Acknowledgements
I use the following dependencies in the game:
- https://github.com/Insality/druid - for GUI. It saves lots of time!
- https://github.com/britzl/defold-orthographic to control aspect ratio and scale, convert window/world coordinates.
- https://github.com/britzl/defold-input to interact with bodies using triggers.
-
https://github.com/britzl/ludobits -
flow
greatly simplifies game logic. - https://github.com/subsoap/defos for the local development to resize and center game’s window on Windows.
-
https://github.com/subsoap/defsave to store saves in
LocalStorage
. - https://github.com/AGulev/defold-poki-sdk to implement Poki API.
- https://github.com/rxi/lume - it’s a useful collection of functions for Lua.
- https://github.com/indiesoftby/defold-sharp-sprite to make graphics look sharp at any screen resolution from Apple’s Retina to old PC’s 720p screens.
- https://github.com/indiesoftby/defold-liveupdate-reszip to implement lazy loading of game resources.
- https://github.com/GameAnalytics/GA-SDK-DEFOLD to track Lua errors.
Thanks @Insality, @AGulev, @britzl, @Pkeod, the great Defold community! And the Defold team for the engine, of course. I didn’t face any blocking bugs or issues while developing the game!
The great in-game artwork was done by Tatiana Guleva.