Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Patching files?

I'm making an mmorpg in rmxp, and I need to know how to patch files?

Like, people download the game, and when we add somethin' else they can downlaod the file to add the maps and stuff automatically (we already have a patcher).

Is there a way to do this that doesn't start th user's game over? Or would they need to download the entire thing over again?
 
There are serveral ways to do that. One is a program wrapper, that checks for updates on startup, downloads them if any, and restarting the rporgam if new come availeble.
Another way is too check for new mapdata on map change, and download if needed.

I both ways, I would go with an 'versions' file, where the versions of the files are listed. This file, or its contents is sended to the server, and it will be compared to entries of a versions file there, or an database like mysql. If there are missmatches, just get the versions form the server side, and send those files down.

To make sure people do NOT need to download the whole RGSSAD again, you could go by having encrypted files, in a map where the game looks on startup. It loads the file, decrypts it, and saves it in the right spot with the save_data method (Which can save into encrypted archives...). For scripts, save them in a special map in the archive (make sure this map is in the data map before you pack your game) and get loaded somehow, example with trial and error, or with another filke that listed the to import script files...

lots of options, pick one!
 
Thanks, Meâ„¢ (finally got that TM working lol)

I'm using the Nitro concept patcher, and what it does is every time yous start the game up it patches files form the server and puts them into the directory of the NP+ file.

I was confused on how to do it, but that helped big time, thanks.

Now, with the one that check the Mysql database, how would I go about doing that exactly? I still want to keep the RGSS encrypted.
 
I thought up how to do it Khengi but then I realized, we need to keep it encrypted so I totally lost my idea xD.

We could just have it re-download the whole entire RGASSD when prompted to. Have the game start with a patcher that checks a server, and we set a variable on the server to a certain version, and if there's a miss-match in server it downloads the whole RGASSD over again, but that's about 20 MB ?

I'm sure I could do it that way, but if there's an easier way I'd be glad to hear how to do it =o

We'd manually change the "variable" which would probably just be in a notepad document and could be changed through FTP and just have the Patcher check the notepad document

The notepad document would be called version.txt:
Version: 2

And then in your game's folder there would be a notepad document called version.txt
Version: 1

And the Patcher would pretty much be programmed....

Code:
$FTPversion = ftp://username:password@domain.net/version.txt;
$LNOversion = c:/program Files/Last Ninja Online/version.txt;
If LNOversion is not equal to FTPversion then;
download game.RGASSD or w/e.;
Change LNOversion to 2
Re-runs the Patcher.exe;
else;
Allow you to click "Start Game";

I'll have to get the exact commands but that's about how it would look like programmed out, probably pretty simple. I could probably get my friend, Chiko, to make us one.
 
I made a set of programs a while back that might work, I haven't made an encrypted game yet so i'm not sure:

The first one is run by the admin, actions:
Scans a particular directory and records the file structure
Stores hash data and path of every file into a version.ini

The second one is run by the "player", actions:
Downloads version.ini from server
Compares version files
Downloads files with different version info
Downloads newly added files
Re-downloads any deleted files
Runs actual game .exe
*Can also check registry for installation location
*Can be run silently when opening the game

--------------
This requires some sort of web server or a web host of some kind. Although that shouldn't be a problem. The programs are compiled NSIS Scripts, I can provide them to anyone that wants to use them. Although it will require NSIS to customize.

The updater itself also has an updater that is run when needed, so if you ever change the update program, they never have to manually download a new version.

All of the programs are VERY small sizes: ~30 kb
 
You more or less repeated my post, but whatever.

Now, with the one that check the Mysql database, how would I go about doing that exactly? I still want to keep the RGSS encrypted.

Let's say we have an background file, map1, map2 nad mmapinfos that are 'updatabe'. Now, we can do two things. 1. let these be organized by a mysql database or 2. let these be organized by an textfile.

We start with number 2. First make a file in the server directory called: Versions.txt (any other extension is fine). Now you place in the folowing text:

Code:
MapInfos.rxdata Data\\ 3
Map001.rxdata Data\\ 1 
Map002.rxdata Data\\ 2
Background.png Graphics\\Titles\\ 2

This is just an example, I choose to separate the Filename, Destination and Version with a space, but you could use any other character, or format. This is just the idea. Now, have the same file be placed in the games Directory. Now I have a ruby server, so I would download the versions file from the client, and then:

Code:
files = {}
update = []
# Load Server Versions
  # Open file
  file = File.open("Updater\Versions.txt", "r");
  # Get lines
  data = newest.readlines;
  # Close File
  file.close;
  # Get Files that can be updated
  data.split("\n").each { |part| part = file.split(" "); files[file[0]] << [file[1],file[2]]  }

# Load Client Versions (Array)
  # Get current File versions
  current = get_client_versions();

# Check Similarities
  # Get to update
  current.each { |file| next if not files.has_key?(file);
    update << file if file[2] < files[file][2] }
  # Update
  send_client_update();

I hope you get my point. It simply checks for each file the evrsions, compares them, and if they do not match, send down, whether its trough and UPD or TCP, HTTP or FTP socket layer is, the files and update them accordingly. With save_data(file[1] + file[2]). You could hide the versions file in the rgssad with exemplia gratia load_data("Data\Versions.rxdata") or something similar, so you can load the file from the archive.

For the mysql, I used a table with these rows:
Code:
ID, Version, Files
I simply connected to the database, and got the table, where version is higher then the clients version. Then for each version, add the FILES to an array. This measn that in that version, those FILES where updated, and in the end, you have all the files. Then use array.unique to filter doubles, and use the same emothd as above with the file version.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top