About Store Forum Documentation Contact



Post Reply 
patching system
Author Message
yvanvds Offline
Member

Post: #1
patching system
I'm looking at the tutorials for patching paks and files from a server.

Some questions:

1. Basically you put the whole game on a server, so that it can be compared with the local game directory. New and newer files will be downloaded and put in the game directory. But are these files automatically compressed when sent over the network? 'Cause sending everything uncompressed seems like a big overhead.

2. What's the idea behind the separate path to the installer in the updater program? Can't I just put the installer in the same directory with the rest of the game?

3. The installer is dependant on the engine.pak. So if the installer gets updated, will the engine.pak get updated at the same time? Otherwise the installer won't work any more if there's an engine update, no?

Thanks,

yvan
09-15-2011 04:12 PM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #2
RE: patching system
1 they are always compressed
2 there is no such restriction
3 you can keep only few files from engine.pak and make smaller engine pak and then embed it as a PAK resource in the exe. the minimum required files are the shaders and the font
09-15-2011 05:23 PM
Find all posts by this user Quote this message in a reply
yvanvds Offline
Member

Post: #3
RE: patching system
Ok, thanks. About 2: So why do I have to tell your updater where my installer is?
09-15-2011 05:46 PM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #4
RE: patching system
So you can manually check for updating the installer before patching rest of the files
09-15-2011 05:53 PM
Find all posts by this user Quote this message in a reply
yvanvds Offline
Member

Post: #5
RE: patching system
Good!

Now in the tutorial, when downloading failed, you suggest to call downloadFile again.

But Patcher::Downloaded contains only information about the file, not the Int that was stored in Memc<Int> server_download (used for downloading this file with downloadFile).

So how do I know the correct ID for the file to download it again?
09-15-2011 09:38 PM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #6
RE: patching system
if downloading failed, it's recommended to restart patching from the start (download index first, then check files, then download them, etc)
09-15-2011 11:02 PM
Find all posts by this user Quote this message in a reply
yvanvds Offline
Member

Post: #7
RE: patching system
Sorry to bother you again. Now I have some questions about patching pak files. Normally I would try to figure out more myself, but in this case it's bloody annoying to work with trial & error since files get removed or replaced every time I run my build :-)

1. I understand that I don't have to replace pak files completely, but can add or remove files from them. But if I update normal files first, does it skip the pak files that need updating? Or do I have to add an exception myself?

2. In the tutorial, you start with multiple paks (data and patch). But when you perform the actual updating, everything goes to patch.pak. Is there a way to write the updates to the pak they belong to? I mean, short of doing updates for paks one by one.

3. Can engine.pak be updated in the same way?
09-18-2011 12:00 PM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #8
RE: patching system
1) what do you mean exactly?
please provide an example

2) 3) files don't "belong" anywhere, because:
pak file can be present on both "data" and "patch" paks
pak file can be present only on "data" pak
pak file can be present only on "patch" pak
pak file can be not present at all

please read more about pak files updates in c++ headers, EE::PakFileData::MODE, EE::PAK_FILE_FLAG (PF_REMOVED)

it is recommended to have one big "data.pak" (don't update it), and "patch.pak" for all patches.

unless your whole data size is small, then you can use only 1 "data.pak"

side note: Ineisis in company license has launcher sources that uses mixed patching (stdio files + pak files)
09-18-2011 12:31 PM
Find all posts by this user Quote this message in a reply
yvanvds Offline
Member

Post: #9
RE: patching system
(09-18-2011 12:31 PM)Esenthel Wrote:  1) what do you mean exactly?
please provide an example

Say I have 2 new files uploaded to the server: data.pak and program.exe

I start my program with the file updater. It will fetch program.exe from the server and replace the one I have (like in tutorial 'patching files.cpp'). But will it also download data.pak (as a regular file) and replace the one I had? Because if so, it doesn't make sense to use pak updating (like in 'patching paks.cpp') afterwards.

(09-18-2011 12:31 PM)Esenthel Wrote:  it is recommended to have one big "data.pak" (don't update it), and "patch.pak" for all patches.

That might be good for small updates. But I intend to work on this project for a few years, providing regular updates and changing the files I have (the world directory is constantly changing, for example). Just storing everything in patch.pak seems a bit messy.


(09-18-2011 12:31 PM)Esenthel Wrote:  side note: Ineisis in company license has launcher sources that uses mixed patching (stdio files + pak files)

wink I know, and it is tempting. But my game idea has no commercial value, it's just an original idea I really want to realize. So spending an extra 600 dollars just to have a better launcher example is a bit much.
09-18-2011 01:04 PM
Find all posts by this user Quote this message in a reply
Dwight Offline
Member

Post: #10
RE: patching system
(09-18-2011 01:04 PM)yvanvds Wrote:  That might be good for small updates. But I intend to work on this project for a few years, providing regular updates and changing the files I have (the world directory is constantly changing, for example). Just storing everything in patch.pak seems a bit messy.

What about a number of patch.pak's? Update01.pak, Update02.pak, ... , where you store your worlds in just a single pak, whereas other files can go in other paks?

Meaning that if you change the world, you just have to re-upload/update 1 pak file and leave the rest untouched.

SnowCloud Entertainment - We are recruiting!
http://www.sc-entertainment.com
09-18-2011 01:34 PM
Find all posts by this user Quote this message in a reply
yvanvds Offline
Member

Post: #11
RE: patching system
Hello Dwight. That's what I have now: world.pak, materials.pak, gui.pak, etc. The issue is about these options:

1. Just replace each pak completely when something changes in there. This works only if the 'file mode' patcher also replaces pak files completely. If pak files are a special case which should be handled by the pak updater, it won't work.

2. Adding all paks to the the 'pak mode' patcher, search for new or changed files and store them in patch.pak. This is the approach that I'm afraid will become messy over time. (But it will certainly work.)

3. Adding only one pak a time to the 'pak mode' patcher, look for updates and add them to that pak. But I don't think the patcher compare function knows what file goes with what pak. And the index you download just contains every file in every pak. So it won't work either.
09-18-2011 01:53 PM
Find all posts by this user Quote this message in a reply
Zervox Offline
Member

Post: #12
RE: patching system
If it is about patch sizes you could include
wyBuild - wyday

SevenUpdate - OpenSource

Dispatcher - Puchisoft

in which you will only get a binary merge patch which updates only the changes.
09-18-2011 02:22 PM
Find all posts by this user Quote this message in a reply
yvanvds Offline
Member

Post: #13
RE: patching system
Thanks, Zervox. I didn't know about those programs.

But now that I've almost got this right and already made a nice interface with rotating images and update logs in berkelium, I'm gonna give it a few more tries before switching to something else :-)
09-18-2011 02:48 PM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #14
RE: patching system
Quote:1) But will it also download data.pak (as a regular file)
if you request it to be downloaded, then yes, it will get downloaded as a regular file, but it's not recommended to upload files as paks (read below)

Quote:1. Just replace each pak completely when something changes in there. This works only if the 'file mode' patcher also replaces pak files completely. If pak files are a special case which should be handled by the pak updater, it won't work.

2. Adding all paks to the the 'pak mode' patcher, search for new or changed files and store them in patch.pak. This is the approach that I'm afraid will become messy over time. (But it will certainly work.)

3. Adding only one pak a time to the 'pak mode' patcher, look for updates and add them to that pak. But I don't think the patcher compare function knows what file goes with what pak. And the index you download just contains every file in every pak. So it won't work either.
no

storage of data:
on your (developer computer) keep all files unpacked (don't use packs at all)

uploading files:
upload all separate files using uploader to the server

(read ineisis documentation for file hierarchy, uploading files)

downloading files:
-use patcher class, obtain info about which files you have (by looking in data pak, patch1, patch2), just like tutorial
-download modified files
-store modified files in latest patch pak
(read documentation about paks, it mentions that you need to load paks in order, because loading newer paks will overwrite existing pak files if they were listed in previous paks)

there is no need to use 3rd party programs, uploader/patcher can handle what you want with minimum required patch sizes.
09-18-2011 02:51 PM
Find all posts by this user Quote this message in a reply
yvanvds Offline
Member

Post: #15
RE: patching system
Ah. It's uploading game data as packs that got me on the wrong track :-) If you upload them as normal files it all makes perfect sense.

Thanks!
09-18-2011 06:18 PM
Find all posts by this user Quote this message in a reply
Post Reply