Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Best way to create a game updater.  (Read 2435 times)

0 Members and 1 Guest are viewing this topic.

killerloader

  • Newbie
  • *
  • Posts: 28
    • View Profile
Best way to create a game updater.
« on: August 28, 2016, 11:21:53 am »
This is mainly for an mmorpg style game (one that will probably never be complete like many of my personal projects :P)

I'm wondering what the best way to create an in-game update is.
Should i use FTP, or HTTP, or just create my own file transfer server and send the data manually?
Without spending money, http seems like the best method, i could just shove my updates onto a random free website from 000webhost and have the client download updates from that link if the server says that an update is required.

What would be the best option? What is most commonly used for this?

Mr_Blame

  • Full Member
  • ***
  • Posts: 192
    • View Profile
    • Email
Re: Best way to create a game updater.
« Reply #1 on: August 28, 2016, 02:39:22 pm »
HTTP and FTP are just protocols not servers, I think that FTP is better for files

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 878
    • View Profile
Re: Best way to create a game updater.
« Reply #2 on: August 29, 2016, 09:19:08 am »
Use a premade solution. ;)

I don't think using FTP is such a good idea. It was specifically made for transfering files, but then again it's pretty much always a direct connection.

Using HTTP isn't that more complex, plus it allows you to use the network infrastructure to your advantage (e.g. proxies, caching, easy load-balancing etc.).

A basic auto-updater isn't that hard to write:

  • Download a list of files and their sizes/dates/checksum.
  • Compare that with your local files.
  • Download anything that doesn't match.

The tricky part here is to update the updater itself, in case that's required. This is typically done with some small helper:

  • Download the new updater and save it to a temporary file.
  • Launch the helper and close the updater.
  • The helper waits for the updater to close.
  • The helper replaces the updater with the new version and starts it again

Potential problems pretty much always involve the current user's permissions/access rights. For example, you might require elevation to properly replace files or mark a file as executable.

Overall, I think it's something you shouldn't worry about just yet. Get some game running, then worry about the best possible update strategy. :)

Mr_Blame

  • Full Member
  • ***
  • Posts: 192
    • View Profile
    • Email
Re: Best way to create a game updater.
« Reply #3 on: August 29, 2016, 02:47:20 pm »
Okay, but where can you host the server.

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 878
    • View Profile
Re: Best way to create a game updater.
« Reply #4 on: August 29, 2016, 02:51:28 pm »
Game server:
You'd typically get some kind of shared host or root server for that. But it's also possible to write a multiplayer backend purely based on some existing protocol (e.g. IRC) or using some existing scripting technology (like PHP or Perl).

Update/patch server:
Basically any file storage would work, depending on the project even GitHub might suffice. More professional solutions would be content delivery networks as they're provided by Amazon and co.

Mr_Blame

  • Full Member
  • ***
  • Posts: 192
    • View Profile
    • Email
Re: Best way to create a game updater.
« Reply #5 on: August 30, 2016, 01:51:25 pm »
Thanks :)

 

anything