A game development journey - Defold is my next stop


#1

That’s not my current career :-). I just meant the game engine I’m using to make a game.

My game development journey began 5 years ago. 2011- the year Angry Birds hit the mobile game market and was going to be popular quickly. I’m very interested in Box2D, the physic game engine which Angry Birds is using.

I posted a Facebook status “I’ve already completed the concept and game play for a game having my beloved character(keep secret for now) from my childhood". However, I did nothing after then as I continued to work on outsourcing area. The way I can get and save money easier to have a safe finance to work on which I love to do freedomly.

The image is just a demonstration, not contain the character I mentioned above.

10 years for outsourcing is enough for me, I’ve stopped to invest more time on mobile app and game independently since my wife was 6 months pregnant. I’ve spent almost efforts to make games recently.

My first game is match-3 because I’m a fan of Candy Crush Saga, great successful game made by King. I’ve completed 11 maps and 11x12 levels for the game with Facebook social integration built on Parse PaaS. However, the game art are bad as I did it by myself and I decided to unpublish it out of Google Play and Appstore. I will back to remake it in near future but it is the other story. The game is made using Libgdx purely. The game story is based on Zodiacs and its 4 elements.

In the meantime, I tried to make some Angry Bird Scenes using GameSalad and remake Flappy Bird in Unity for learning purpose. I also researched in cocos2d-x , Game Marker and Corona. The 3 last game development platforms are not suitable approaches for me.

Another day, when I took care of my 22-month son, a little boy. I was blowing a balloon and free it, the balloon flies with its long funny sound. He laughed at the balloon many time I did the same thing. I imagined to make a game call as Blowing Bubble. I got some free arts and bought 2 cartoon boys characters (Royal Free licence) to make the game arts for it and use Overlap2D, a young editor for LibGdx to do the design.

He is very attractive in the game when he is near me while I tested to publish it to Appstore and Google Play. I decided to make Blowing Bubble HD game as I though if the game only has 2 players, my son and me, I still want to make it. After then, I work with a seasonal game artist to create the game arts for Blowing Bubble HD.

At the time, RoboVM is coming down due to Microsoft and Xamarin engagement. It meant there’s an issue with iOS production after a year. Although the community might replace it with Intel’s Multi-OS Engine, but it requires a long time enough for production. Moreover, Overlap2D is very young (the latest version is 0.1.2) and has low progress on development. I’m still facing some major issues with physic interaction. I didn’t mean LibGdx and Overlap2D is not good. LibGdx is great game platform development, specially for the one coming from Java foundation, but it doesn’t have a good enough editor. Overlap2D is very promised one, but slow progress and doesn’t have an active community.

When I had some confusions for the next step, I saw a topic said about Defold in Gamasutra (Candy Crush Saga creator King has made its Defold game engine and editor available for free). Defold game engine is very attractive to me, that why I’m here. I spent one day for Getting Start tutorial , an endless jumping game, the similar simple game I’d like to make after Blowing Bubble HD and before I work on the game I keep in mind for 5 years and remake the match-3 game as I told about it before.

I’m very surprised about how easy Defold is able to use to make a game, specially 2d games. I spent a week to make the game trailer using Defold to learn it deeply. All videos are created by Defold editor and combined by a movie editor. Finally, I decided to use Defold engine/editor to build Blowing Bubble HD and ongoing games.

https://www.youtube.com/watch?v=OnEMbzGAJnw
Blowing Bubble HD game trailer - part 1 (draft)

I will use this thread to talk about Defold pros and cons, my game development progress, the experiences of using Defold as soon as I have a break week by week as the Show Case should be served for major milestone updates. Thanks for your time and accepting that English is not my native language.

My original show case post:

https://forum.defold.com/t/blowing-bubble-hd-when-the-bird-returns-our-first-game-developed-in-defold/1758


Blowing Bubble HD - When the bird returns. Our first game developed in Defold
Defold in the wilds!
#2

Hi,
Thanks for posting your story. I’m working full time and trying to fit in the odd part time app game development, in between, TV, social life, Xbox & PS4. So I don’t have much time. What I’m interested in is how much money can be made from a semi decent app. I realise that it depends on the app, but could you tell ‘us’ if you do make any money from it?
I don’t want to know exact figures, just if it’s worth me putting down the game controllers to do a bit more coding…


#3

That’s an awesome story! Thanks


#4

Sound interested. I’ve not got the chance to work on TV, social life, Xbox & PS4 devices. To me, I work for my passion first and money comes late :slight_smile:


#5

Thanks for your nice words.


#6

I have 6-8 points about Defold in mind. Here is the first one.

A complete suite of game development tool might be overwhelmed. I have no reason to use Defold for my next game after the first day that I got the overview of its editor. Perhaps, because I’m from a developer perceptive, I like a lightweight one .

A week valuation is also not enough to cover all sides of Defold engine and editor. As its advertises, however, it is easy to recognise the most valuable thing you may consider, it’s actually free without hidden cost. I believe in that b/c it’s difficult to get profits from making games except well-known medium-big studio/game company. Nowadays, indie dev/studio needs longer time to have a successful game accepted by the market. Developers are not willing to pay a cost for a game development tool suite when they’re not sure whether they’re able to earn profits from their efforts.

I got a little worried for the first touch as I have no knowledge about Lua before. After completing the first tutorial and taking a look at Lua manual. I realised that I can make 2d games very easy in Defold. Look like Lua is designed for game, it’s very easy to learn and capture all aspects to work with Defold game engine/editor.

Of course, Defold , similar to other game engines/editors has its limitation. Since Defold has just opened for outside, the engine is not ready to add plugin/add-on for your specified requirements (I’m not sure if Defold will provide open API to take the advantages of community supports) . You might need to wait for Defold team to complete some general integrations such as Google Ad Mod, Google Play service, Apple Game Center. I’m not surprised since almost King’s games are using In-app purchase service and utilising Facebook social service for their succeeds.

As Apple won’t support iAd from June and I didn’t plan to serve Ads in my WIP game so it is not an issue for me. Although I’ve completely integrated Facebook social service for my first game, I still would like to have a simple leaderboard and a few achievements on some simple games to pay the attention on the game play. Therefore, I hope Apple Game Center and Google Play service extension is available soon. Also, In-App purchase aways add more complexity on the game play, level design. Ad service integration should be added to attract more developers who want to earn money from Ads.


#7

My first impression of Defold is animation and message. I’d like to share my animation experience for this point.

Good game art makes up a game, animation brings it alive.

Defold supports Spine animation, the most popular and effective one for 2d games, very smoothly. I don’t use Spine for my wip game as it contains only simple animations, there’s a preparation for Spine for my next one to take its advantage. If you take a look at the “getting start” tutorial, you should see how easy to do with Spine animation.

I’ve not got the chance to see a tutorial for flip book animation. Fortunately, I’m amazed the way Defold handles it, the workflow to do it is simple and easy. I found some difficulties when work with the kind of animation in other game engine and studio. The first time I used Unity, I’m very confused with the animator editor as it contains transition, condition .e.g.

`

You can add animation group and edit its properties directly in .atlas file outline, very simple.
To play the animation, just post msg with message_id as “play_animation” then listening “animation_done” message_id in on_message function to do something.

function on_message(self, message_id, message, sender)
    if (message_id == hash("animation_done")) then
		if(message.id == hash("walk")) then
			if(self.state == hash("stop")) then
				msg.post("#spriteAnim", "play_animation", {id = hash("idle") })
			else
			  self.state = hash("blowing")	
			  msg.post("#spriteAnim", "play_animation", {id = hash("blow")})	  
			end  
		elseif(message.id == hash("blow")) then
			if(self.state == hash("stop")) then
				msg.post("#spriteAnim", "play_animation", {id = hash("idle") })
			else
			  self.state = hash("walk")	
			  create_bubbles(self)
			  msg.post("#spriteAnim", "play_animation", {id = hash("walk") })
			end  
		elseif(message.id == hash("idle")) then
		         self.direction = hash("forward")
			 self.state = hash("run")	
			 msg.post("#spriteAnim", "play_animation", {id = hash("run") })	
		end		
	elseif message_id == hash("set_state") then 
        self.state = hash(message.state)    
    end 
end

In my game trailer, the bubble boy walks then blow bubbles. After blowing state is done, 3 bubbles are created and fly. In Ovelap2D, an editor of LibGdx, I can’t change animation group runtime. It means I have to remove the object and replace with a new one which contains other animation.

I’m only use 2 kind of animations. So I’m very happy how Defold supports animation.

There’s also an object animation, it is quite easy to use too. See again my game trailer, you should see 3 Lollipops which rotate forever.

go.animate(go.get_id(), "euler.z", go.PLAYBACK_ONCE_FORWARD, -360, go.EASING_LINEAR, self.speed, 0)

You can check the manual to see a lot of properties which are enable to animate (.e.g position).

Next time, I will share some experiences in message and physic engine/editor.


#8

“Communication is king”. The last word of the quote agrees with “Defold is powered by King”. However, I’m not attending to talk about that as everyone know :slight_smile:.I’d like to share about my thoughts in message mechanism, the heart of Defold engine for all interactions when making games with Defold. Message passing appears in the whole process of create games , from your game world to physics engine, the system, GUI , input, render and so on.

Message driven is most effective mechanism to communicate game objects in loose coupling style which releases the depedencies as most as possible and promote reusbility. It is also very natural. When I worked with the other engine which uses “reference”, I have to pass the HUD around the scenes/screens to update the score, progress bar(to name a few). Using Defold, the first time I involved in the message is to tell the game object to do its animation. The second, when a game object has done something, he posts a message to ask another object to get a feedback or just passes a message for other one to update their states. Today -it is not the last- I finished the splash screen and lazy resource loading for my WIP game, I also used the message passing between game world and HUD.

Although it is outside the scope, I’m very excited when working with GUI part, it is simple and easy than I expected ever. Without the message architecture, Defold might not provide how natural the way to deal with HUD. I will back to the GUI later.

Of course, It might mixture if the game contains a huge number of game objects. Then you might find a little difficult to track the sources of a message. Thus, a good state machine design is enough. To my simple game, I believe that I don’t reach that situation.


It is the turn for Physic engine.

Physic simulation always introduces the complexity. Fortunately, Defold hides the complex part for you. If you’re come from Unity, collision object is the same with rigidbody and the shapes is similar to collider. You even don’t need to know about physic body term to work with Physic here . Just naturally add collision object to a game object and decide the shapes to use. All default settings are very suitable for light weight game objects. In my current game , I’m working with birds, bubble , balloon, ball so it pretty matches with my requirements.

I’m very impressed with Defold when handling the collision filter, that’s might a difficult task for the one who is new with physic engine. In Defold, the only thing you need, is to find a name for group/mask. The default/default means to collide all if you don’t change any group name and mask.

As other game engine, Defold provides 3 kinds of collision object and introduces a new one called as trigger. That’s also an interested thing. If you’ve got the chance to read the Collection Proxy (http://www.defold.com/manuals/collection-proxy/). There’s a part , I thought it is good candidate to use the trigger one, a lightweight collision object. It is about a case as the character jumps to the gate between 2 game worlds, the trigger message is listened to load the 2nd world for effective memory usage. There’s also many interested thing to talk about the collection/collection proxy but it is too long for now.

The missing which is just a minor, I expect for Physics mostly, Defold will support polygon shape in a near release as it takes a little more time for me to complete the shapes for the bubble gum machine in my WIP game.

Defold editor :

Overlap 2D :

Unity :


#9

Refactor the codes of Blowing Bubble HD to use trigger collision.

https://youtu.be/EPFYeoxcl8c

It is fairly straightforward after refactoring the codes to use trigger collision.

The codes initially use hardcode x axis value BEGIN and END to check whether the position of bubble boy reaches the BEGIN and END constant to change its direction.
After reviewing for a while I added 2 bounds, one for left, the other for right. Then I’m using trigger_response message receiver to change the direction.

Before :

if(self.pos.x <= BEGIN) then
    self.direction = hash("forward")
elseif(self.pos.x >= END) then
    self.direction = hash("back")
end

After :

    if message_id == hash("trigger_response") then  
        	if message.group == hash("right_bound") then
        		back(self)
        	elseif message.group == hash("left_bound") then
        		forward(self)
        	end    	
    end	

Although, we can use kinematic to serve the same purpose. But the a light weight collision object like trigger should be better.


#10

The implementation for placing balls in Blowing Bubble HD game.

After blowing balloons to be large enough and release, the balloon boy places the balls to the machine to get coins. Balloon is kinematic and ball is dynamic.

https://www.youtube.com/watch?v=6-sAukTQZ1Y

The balloon is Kinematic since it is controlled by player (scaling). When the ball is thrown, it is applied force and gravity, so it is Dynamic.

After placing ball, the boy moves around then blowing another balloon, he get diffrence distance from the machine. Thus , the different force values should be applied.

local p = go.get_world_position()
p.x = p.x - 6
msg.post("#collisionobject", "apply_force", {force = vmath.vector3(forceX , forceY, 0), position = p})
self.state = hash("throw")  

The force is not applied to the center as it needs a little rotation. The speed and rotation is slower a bit in its movement, so it is applied small Linear Damping and Agular Damping amount.

Perhaps, update the mass to 0.1 - 0.3 should be better, but just keep its default value then change the
force to be greater numbers.


#11

That was the day to shoot the bird.

https://youtu.be/M581tgCHy1w
The sound is not good as I recored via laptop microphone.

Similar to place a ball to the machine, The shot ball is dynamic as it is applied gravity and force, a little
damping in rotation and angular. The restitution is greater as the ball is bounced further when it hit the bird as well as the ground. The distance depends on the value of force, Greater x value makes the ball throwing far and greater y value leads the balls higher.

The bird is kinematic as it flies in its bounds. it means there’s no effector for the bird when it hits the ball. Is it quite complicated for the effector? No, everything here, you need to apply a correction and it is available in Defold manuals. That is the reason I personally love the Defold tutorial and manual as it is very practical and almost contains the best practise.

If you’ve got the chance to read through the physic manual, specially the section “Resolving Kinematic collisions” you got it in handy (http://www.defold.com/manuals/physics/
). Perhaps , I need an particle effect here to make the game more interested. But it is good enough for now.

Another thing for the collision is to work with the sounds. Whenever a collision happens, collision response messages are sent a lot of times. It is noise if you play a sound here and there’s best practice in Defold manual too. I had to have a mixture condition checking workaround solution before.

Again, if you take a look at Sound manual (http://www.defold.com/manuals/sound/). There’s a part named as Gating sounds, a suitable solution for the case.

Now, everything is OK . When the ball hits the bird, the bird is dizzy but he is not falling now. Wait for the next.


#12

I were silent the recent days as I need to focus on the development as there’s a change on the the game play. A screenshot might show how is the game changed.

It is quite changeling for me to support separate game asset resolutions. The game originally designed in 2048x2048 base and need to narrow down to 1024x1024 for old devices at the final stage.

It was also an interested time to make the same physic simulation for the 2 virtual viewports. The game was completed last week and tested and fixed bugs this week. For some reason, only 35% effort on development was actually invested to the game.

Hope to have no issues with Appstore approval and it is available by June 15th.