2 Questions about Live Update

Hi,

Still learning a lot about Defold. Liking what I’m seeing here.

Coming over from Unity where I have the following system:

  1. I split the game into core C# and Hotfixable (GameLogic) C# (with bindings created at compile time, so it’ll work with iOS). At game start, we’ll download Hotfixable C# if necessary.

When reading the “Live Update” docs, it says:

When bundling a game, Defold packs all the game resources into the resulting platform specific package.

It is unclear if a .script file is a game resource.

i.e. if a CollectionFactory points to Player.Collection which has Player.script

is “Player.script” part of the Live Update?

  1. We mostly make 2D games, so our live update system packs a bunch of low res version assets for the .ipa / .abb
    Whenever a hi-res asset is missing, we’ll use the low-res version first before streaming in the hi-res asset as needed.

I’m guessing the way to do this, is to have a
Unit.collection (packed) which has

  1. lowResSprite.CollectionFactory (packed)
  2. hiResSprite.CollectionFactory (remote)
  3. Unit.script (ideally packed, but can live update if out of date)

What’s the correct setup to do this?

2 Likes

Yes, it is one of the game resources.
Think of the archive as a custom zip file (it’s more like the old .PAK files, you can read about the format itself here).

When packaging for LiveUpdate, we look at what resources are referred from the excluded collection proxies, and package those into a separate archive (e.g. a .zip file).

However, if the resource (e.g. your script file) is referenced from a collection that is not excluded, then we package the resource file in the default package, since you might need the it when booting the game.

I think your way of doing it should work. Ideally, you should be able to set a different (hi-res) texture to any already created sprites

i.e. if a CollectionFactory points to Player.Collection which has Player.script
is “Player.script” part of the Live Update?

It can only be part of the LiveUpdate archive if it is only referenced from a .collectionproxy that has the “Excluded” property set. If it is referenced from anything used in the base archive, then it will be included in the base archive.

Whenever a hi-res asset is missing, we’ll use the low-res version first before streaming in the hi-res asset as needed.

I think this is a good approach. When spawning new objects, you can then use urls to the high-res sprites instead.

I hope this helps a bit! Don’t hesitate to ask more questions :slight_smile:

3 Likes

2 more questions, there’s still a lot I don’t know about Defold. Thanks for your assistance!

  1. Is there anyway to Live Update a packed gameobject / collection?
    (In Unity, we’d have to download it to a different location)

  2. Is there a way to Live Update lua modules?

2 Likes

You can live update any content that is references from the .collection (i.e. from the .collectionproxy): textures, collections, gameobjects, scripts and lua modules.

My suggestion is that you create a small test project, with an excluded collection proxy.
In the collection being excluded, add a game object and a script, then bundle for liveupdate (using .zip prublishing).
THen you can inspect the .zip file yourself to get an understanding of how it works.

3 Likes