Continuing on the Live Update suggestions streak, a mechanism for identifying and deleting unused resources left over by a previous version of the game would be nice. As it is now, with often enough patches and content updates it seems like resources stored with store_resource() would just pile up and use disk space on the player’s device indefinitely.
I’m really unsure how this would work. I don’t know if live update content is included in the manifest or not (I assume so), but maybe something like:
local table_of_resource_hashes = resource.list_resources_in_manifest(manifest_ref)
local table_of_resource_hashes = resource.list_stored_resources()
resource.delete_stored_resource(resource_hash_or_table_of_resource_hashes)
We should be able to detect this when updating the manifest. Any downloaded and stored resource that isn’t part of the new manifest should automatically be deleted. Created a ticket to add this functionality.
As a temporary workaround, whenever I make big updates to the game, I delete liveupdate.arcd, liveupdate.arci and liveupdate.arci.tmp, then call sys.reboot():
local function delete_previous_resources()
if not env.apkx_main_version or not misc then return false end
local game_name = sys.get_config("project.title")
local liveupdate_version_filename = sys.get_save_file(game_name, "liveupdate_version")
local config = sys.load(liveupdate_version_filename)
local liveupdate_version = config.liveupdate_version
if liveupdate_version ~= env.apkx_main_version then
local deleted_file1 = misc.delete_file(sys.get_save_file(game_name, "liveupdate.arcd"))
local deleted_file2 = misc.delete_file(sys.get_save_file(game_name, "liveupdate.arci"))
local deleted_file3 = misc.delete_file(sys.get_save_file(game_name, "liveupdate.arci.tmp"))
config.liveupdate_version = env.apkx_main_version
sys.save(liveupdate_version_filename, config)
if deleted_file1 or deleted_file2 or deleted_file3 then
sys.reboot()
return true
end
end
return false
end
where misc.delete_file(file_name) is a NE function that returns true if unlink(file_name) == 0
But it has not been assigned to a release yet. And I can’t say when. Not in any of the versions currently planned (1.2.172 and 1.2.173 but maybe 1.2.174)
Regarding the original feature request, and the workaround, it seems like a first good step would be to remove any (all) liveupdate data.
Is this correct?
Removing individual files is much more involved, so finding a MVP would be good.
Sorry for the slow reply. We intend to come back to Live Update features once the Rive integration is launched. I can’t say for sure when this will be, but perhaps 6 to 8 weeks from now.