About Store Forum Documentation Contact



Post Reply 
Another patcher question
Author Message
ralphthebear Offline
Member

Post: #1
Another patcher question
I'm trying to figure out patching system

1. Upload all the files in 'gamedata' folder to patch server's patch directory (unpakced)
2. I've pack 'gamedata' file as Project.pak for distribution
3. When I need a update, modified or newly created file existed in 'gamedata' folder, upload whole 'gamedata' directory to server using Uploader tool again. Uploader tool will upload the modified or created files only
4. When user to download the patched files, Patcher class will download only modified or created files and archive (pack) it into the existed Project.pak automatically

Is my understading about your patch system correct?

If so, there is some questions

1. When using uploader tool, in my case, let's say whole 700MB data and lots of files and directroies, uploader never end to upload. After almost 90% upload, it just repeat 'Upload failed, trying again'. I'm using 4 Ftp connections

2. My project (Android) has almost 700MB, after packing, it's 300MB. I wanna upload just an installer to Android Play Store and let users download the remaining big data files from my download server. Is there any effective way? For a reference, currently, I'm compiling it from Visual Studio and port it to android by NDK not using your Esenthel Editor directly. I've made apk (including Project.apk) and tested it already.
08-14-2017 02:00 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Another patcher question
Hi,

1) When using uploader, make sure when you "publish" your project from EE, that in Application Properties "Publish Data as PAK's" is disabled.
So the Editor will not generate 1 big PAK, but several small files.
Did you have this already?

Uploader will work best if it can upload several small files, and not 1 pak.

I'm using Uploader to upload all updates to Esenthel Engine, since few years.
Sometimes if there's failure (got disconnected) then it will resume within a few seconds, and from the last position, and not from the beginning.

Is it always failing on the same file? what file is it?
Do you have enough free disk space on the server?

2) There are tutorials for downloading and patching data from the server :
-Apps\08 - Net\Patcher (Files)
-Apps\08 - Net\Patcher (Pak)

Also remember to specify correct path where to store your files, on Android/iOS this should be within:
SystemPath(SP_APP_DATA)
08-16-2017 12:28 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #3
RE: Another patcher question
However on Android you don't need to upload data to your own server, you can just use Android Expansion Files.

Just select "Android Expansion Files" in EE Editor Application Properties, and upload the Project Data PAK together with APK file to Google Play Store.

With "Android Expansion Files" enabled, the app will automatically download the expansion file, and load it, even before your app starts.
08-17-2017 03:57 AM
Find all posts by this user Quote this message in a reply
ralphthebear Offline
Member

Post: #4
RE: Another patcher question
FTP uploading fail problem was euc-kr encoded file name. One of files was it, so this was cleared.

But, there is another problem.

My APK configure is

Engine.apk
GameData.apk (this is a just dummy 1kb for downloading actual game data from my download server)
compiled some execution file stuffs

When install and executing on Android, it's downloading all files from my download server but on pak update, GameData.apk remains just same as before. Download was success but patching didn't happens.

I've tried SystemPath(SP_APP_DATA) also, but not works. PC version works well with same code.

Code:
bool PatchInit() {
   paks.addTry(paks_dir.tailSlash(true) + L"GameData.pak", null, false);
   .....
}

bool PatchUpdate() {
   ....
   if (update_files.elms())
   {
      Str pak_name = paks_dir.tailSlash(true) + L"GameData.pak";
      Pak pak; pak.load(pak_name, null);
      PakUpdate(pak, update_files, pak_name, null, EE::COMPRESS_LZ4, 9, null);
      update_files.del();
   }
   ....
(This post was last modified: 08-19-2017 06:46 PM by ralphthebear.)
08-19-2017 06:44 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #5
RE: Another patcher question
You can't modify files that are inside the APK. So I don't see the point of including the GameData.pak which is an empty dummy.
Don't include any file like that. And always try to load and update from SystemPath(SP_APP_DATA).
If PakUpdate fails, it has a 'Str *error_message=null' parameter which you can use to get info about what failed.
08-20-2017 01:46 AM
Find all posts by this user Quote this message in a reply
ralphthebear Offline
Member

Post: #6
RE: Another patcher question
At first, I thought that pathcer's target was paks inside apk.

Ok, different scenario,

If I have 2 paks inside apk - Engine.pak, GameData.pak(not dummy, essential data files), so, for GameData.pak patch,

1. I have to copy GameData.pak to SP_APP_DATA?
or
2. Download patch files to SP_APP_DATA as Patch.pak and Paks.add("GameData.pak") , Paks.add("Patch.pak")?

And patcher's downloaded files where to located? SP_APP_DATA?
08-20-2017 09:03 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #7
RE: Another patcher question
Quote:And patcher's downloaded files where to located? SP_APP_DATA?
Yes.

The choice how to perform patching is up to you, as the engine is flexible enough to allow any sensible implementation, it can work with any number of PAK's loaded, 1, 2, 3, ...
I think you should focus on approach that would use the least amount of disk space.

I recommend using APK Expansion Files.
08-21-2017 12:18 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #8
RE: Another patcher question
Quote:FTP uploading fail problem was euc-kr encoded file name. One of files was it, so this was cleared.
Thank you for letting me know, next release will support UTF8 file names for Ftp and Uploader.
08-23-2017 04:45 AM
Find all posts by this user Quote this message in a reply
Post Reply