# Bring Me Cakes. Red Riding Hood Puzzle

**URL:** <https://forum.defold.com/t/bring-me-cakes-red-riding-hood-puzzle/3164>\
**Category:** Dev diaries\
**Created:** [October 10, 2016, 10:32am UTC](https://forum.defold.com/t/bring-me-cakes-red-riding-hood-puzzle/3164 "2016-10-10T10:32:13Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [December 21, 2016, 8:49pm UTC](https://forum.defold.com/t/bring-me-cakes-red-riding-hood-puzzle/3164/21 "2016-12-21T20:49:50Z")

</div>

> [@AGulev](#):
>
> But I didn’t make an in-app purchase restore.

What kind of products will you be selling? Will you do any server side validation of receipts? Will you keep track of user inventory on the backend or will all of the bookkeeping be done in the client?

A call to iap.restore() will restore any non-consumable items. The iap listener will be invoked with iap.TRANS\_STATE\_RESTORED for each product that is restored.

---

<div class="post-metadata">

**Author:** ![AGulev](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/agulev/32/4541_2.png) [@AGulev](https://forum.defold.com/u/AGulev)\
**Post date:** [December 21, 2016, 9:00pm UTC](https://forum.defold.com/t/bring-me-cakes-red-riding-hood-puzzle/3164/22 "2016-12-21T21:00:40Z")

</div>

Cool, thanks.  
For now all IAP code on client side.  
We will have few non-consumable items but for now all items consumable.  
I dont want to do server, but I think I should for a progress save and sync.

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [December 21, 2016, 9:07pm UTC](https://forum.defold.com/t/bring-me-cakes-red-riding-hood-puzzle/3164/23 "2016-12-21T21:07:57Z")

</div>

> [@AGulev](#):
>
> I dont want to do server, but I think I should for a progress save and sync.

You should look into PlayFab. It would fit very well with persisted user progress and similar. They also have receipt validation for iOS and Google Play.

---

<div class="post-metadata">

**Author:** ![AGulev](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/agulev/32/4541_2.png) [@AGulev](https://forum.defold.com/u/AGulev)\
**Post date:** [January 22, 2017, 12:14pm UTC](https://forum.defold.com/t/bring-me-cakes-red-riding-hood-puzzle/3164/24 "2017-01-22T12:14:41Z")

</div>

Biggest changes last month:

- added alternative way for a first chapter with the easier levels (it is 19 new levels)

 ![](https://forum-defold-uploads.b-cdn.net/original/2X/b/b762c6640ce3e71332da07b0d6dab49b06a6f69b.png)

- fully finished sound design and music for the game.

And, of course, many small things and fixes (including prepare for GDC Competition).

---

<div class="post-metadata">

**Author:** ![AGulev](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/agulev/32/4541_2.png) [@AGulev](https://forum.defold.com/u/AGulev)\
**Post date:** [February 2, 2017, 1:55pm UTC](https://forum.defold.com/t/bring-me-cakes-red-riding-hood-puzzle/3164/25 "2017-02-02T13:55:57Z")

</div>

Optimisation is one of final step of game development.  
But after @Mattias_Hedberg [post](https://forum.defold.com/t/draw-calls-and-defold/4674), I tried to optimize one of scene.

It’s the shop collection, with 3 tabs. All made in gui.

 ![](https://forum-defold-uploads.b-cdn.net/original/2X/0/0d363b42c377b24f4231a3df70b19dd7404e450b.png) ![](https://forum-defold-uploads.b-cdn.net/original/2X/2/2b1537865e44924fbdf61022281072d3ef90c480.png) ![](https://forum-defold-uploads.b-cdn.net/original/2X/5/55d52798239c0ad642bbfd3557ce1a0f23a4b774.png)  
fist tab with particles and a spine animation. Other just boxes and text nodes.  
And results:  
1st tab:  
before: 24 draw calls  
after: 7 draw calls

2nd tab  
before: 45 draw calls  
after: 2 draw calls

3rd tab  
before: 48 draw calls  
after: 2 draw calls

The main tricks are:

> [@Draw calls and Defold](https://forum.defold.com/t/draw-calls-and-defold/4674/1):
>
> Box nodes (sprites) are rendered even if they do not have a texture, got alpha 0 or size 0,0,0. They should always have a texture assigned. If you must have an empty node, then set the size to 0, 0, 0 and assign a texture to it.

and Layers.

One more thanks @Mattias_Hedberg !!!

And I continue my optimisations with other scenes =)

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [February 2, 2017, 2:10pm UTC](https://forum.defold.com/t/bring-me-cakes-red-riding-hood-puzzle/3164/26 "2017-02-02T14:10:06Z")

</div>

Wow, nice optimisations!

---

<div class="post-metadata">

**Author:** ![sven](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/sven/32/1086_2.png) [@sven](https://forum.defold.com/u/sven)\
**Post date:** [February 2, 2017, 3:11pm UTC](https://forum.defold.com/t/bring-me-cakes-red-riding-hood-puzzle/3164/27 "2017-02-02T15:11:41Z")

</div>

Haha, that’s fantastic! Great job @AGulev, and super useful post @Mattias_Hedberg!

---

<div class="post-metadata">

**Author:** ![AGulev](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/agulev/32/4541_2.png) [@AGulev](https://forum.defold.com/u/AGulev)\
**Post date:** [February 19, 2017, 2:45pm UTC](https://forum.defold.com/t/bring-me-cakes-red-riding-hood-puzzle/3164/28 "2017-02-19T14:45:19Z")

</div>

Last week we are worked on prepairing to GDC - it is many works with materials and other non game development things.

But we made few interesting things too.

I am finished with performance optimisation. One more achievement is optimize main scene of first world from 160-170 drawcals to 10-12 drawcals. This was made possible by replacing software tint trees to tint and save textures of trees.

 ![](https://forum-defold-uploads.b-cdn.net/original/2X/3/3d7962ed8f9a3f5bce04be49715ce25c411ca600.png)

We finished with levels of third world and many other small things.

Also we made small playable **demo** with uniqe 8 levels (final game has other first levels):  
[http://bring-me-cakes.com/demo/](http://bring-me-cakes.com/demo/) (but I can’t edit main post to add this link ☹ )

---

<div class="post-metadata">

**Author:** ![Ivan\_Lytkin](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/ivan_lytkin/32/2654_2.png) [@Ivan\_Lytkin](https://forum.defold.com/u/Ivan_Lytkin)\
**Post date:** [February 19, 2017, 6:35pm UTC](https://forum.defold.com/t/bring-me-cakes-red-riding-hood-puzzle/3164/29 "2017-02-19T18:35:59Z")

</div>

How did you animate the girl?  
Is it Spine “pseudo” 3D or real 3D renders?

---

<div class="post-metadata">

**Author:** ![AGulev](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/agulev/32/4541_2.png) [@AGulev](https://forum.defold.com/u/AGulev)\
**Post date:** [February 19, 2017, 6:39pm UTC](https://forum.defold.com/t/bring-me-cakes-red-riding-hood-puzzle/3164/30 "2017-02-19T18:39:31Z")

</div>

It is 2d and spine.

Our animator’s article about it  
[Анимация в Spine, советы и рекомендации, псевдо 3D эффект / Habr](https://habrahabr.ru/post/315950/) (in russian)

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [February 20, 2017, 5:24am UTC](https://forum.defold.com/t/bring-me-cakes-red-riding-hood-puzzle/3164/31 "2017-02-20T05:24:24Z")

</div>

> [@AGulev](#):
>
> but I can’t edit main post to add this link

I’ve added the link to the main post for you. Why couldn’t you edit the main post btw?

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [February 20, 2017, 5:32am UTC](https://forum.defold.com/t/bring-me-cakes-red-riding-hood-puzzle/3164/32 "2017-02-20T05:32:20Z")

</div>

This is the first time that I’m playing Bring me Cakes and I must say that it looks and plays great. You guys have done a fantastic job and I’m sure the finished product will be a really great game.

---

<div class="post-metadata">

**Author:** ![AGulev](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/agulev/32/4541_2.png) [@AGulev](https://forum.defold.com/u/AGulev)\
**Post date:** [February 20, 2017, 8:04am UTC](https://forum.defold.com/t/bring-me-cakes-red-riding-hood-puzzle/3164/33 "2017-02-20T08:04:58Z")

</div>

> [@britzl](#):
>
> Why couldn’t you edit the main post btw?

It’s some protection for old posts or posts with many edits, I don’t know exactly.

> [@britzl](#):
>
> I’m sure the finished product will be a really great game.

Thank you! 😊

---

<div class="post-metadata">

**Author:** ![sicher](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/sicher/32/8_2.png) [@sicher](https://forum.defold.com/u/sicher)\
**Post date:** [February 20, 2017, 8:12am UTC](https://forum.defold.com/t/bring-me-cakes-red-riding-hood-puzzle/3164/34 "2017-02-20T08:12:02Z")

</div>

There’s a 60 day limit to editing old posts in the Discourse settings. I’m removing that now.

---

<div class="post-metadata">

**Author:** ![sicher](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/sicher/32/8_2.png) [@sicher](https://forum.defold.com/u/sicher)\
**Post date:** [February 20, 2017, 8:21am UTC](https://forum.defold.com/t/bring-me-cakes-red-riding-hood-puzzle/3164/35 "2017-02-20T08:21:33Z")

</div>

Just played through the demo levels. More please! I love this!

---

<div class="post-metadata">

**Author:** ![AGulev](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/agulev/32/4541_2.png) [@AGulev](https://forum.defold.com/u/AGulev)\
**Post date:** [February 20, 2017, 10:10am UTC](https://forum.defold.com/t/bring-me-cakes-red-riding-hood-puzzle/3164/36 "2017-02-20T10:10:03Z")

</div>

> [@sicher](#):
>
> Just played through the demo levels. More please! I love this!

Thank you! =))

---

<div class="post-metadata">

**Author:** ![gianmichele](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/gianmichele/32/24028_2.png) [@gianmichele](https://forum.defold.com/u/gianmichele)\
**Post date:** [February 20, 2017, 1:34pm UTC](https://forum.defold.com/t/bring-me-cakes-red-riding-hood-puzzle/3164/37 "2017-02-20T13:34:38Z")

</div>

Really nice!

Tried to test on Safari for iOS, but unfortunately the screen does not scale well. I know it’s not officially supported by Defold but it would be great in the future.

---

<div class="post-metadata">

**Author:** ![AGulev](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/agulev/32/4541_2.png) [@AGulev](https://forum.defold.com/u/AGulev)\
**Post date:** [February 20, 2017, 1:42pm UTC](https://forum.defold.com/t/bring-me-cakes-red-riding-hood-puzzle/3164/38 "2017-02-20T13:42:16Z")

</div>

Thank you.

I made scaling of canvas size by javascript in index.html and dmloader.js.  
I did not expect to mobiles. Only for a desktop.

---

<div class="post-metadata">

**Author:** ![Mattias\_Hedberg](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mattias_hedberg/32/433_2.png) [@Mattias\_Hedberg](https://forum.defold.com/u/Mattias_Hedberg)\
**Post date:** [February 20, 2017, 2:47pm UTC](https://forum.defold.com/t/bring-me-cakes-red-riding-hood-puzzle/3164/39 "2017-02-20T14:47:48Z")

</div>

> [@AGulev](#):
>
> I am finished with performance optimisation. One more achievement is optimize main scene of first world from 160-170 drawcals to 10-12 drawcals. This was made possible by replacing software tint trees to tint and save textures of trees.

Great work @AGulev! Did you notice a performance gain?

Lovely game! Looking forward to some trickier levels 😃

---

<div class="post-metadata">

**Author:** ![AGulev](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/agulev/32/4541_2.png) [@AGulev](https://forum.defold.com/u/AGulev)\
**Post date:** [February 20, 2017, 2:57pm UTC](https://forum.defold.com/t/bring-me-cakes-red-riding-hood-puzzle/3164/40 "2017-02-20T14:57:36Z")

</div>

> [@Mattias\_Hedberg](#):
>
> Great work @AGulev! Did you notice a performance gain?

Thank you!  
Yes, especially in html5 and on old android devices.

> [@Mattias\_Hedberg](#):
>
> Lovely game! Looking forward to some trickier levels 😃

Nice to hear! Full version already has much trickier levels =)

[Previous page](https://forum.defold.com/t/bring-me-cakes-red-riding-hood-puzzle/3164.md?page=1)

[Next page](https://forum.defold.com/t/bring-me-cakes-red-riding-hood-puzzle/3164.md?page=3)
