1
\$\begingroup\$

I am currently in school studying game design and programming and I am wondering, simply: How are games updated?

Whenever I create simple, little programs, if I change anything, essentially the entire program is recreated. Obviously, game with sizes of 5, 10, even 20 Gb are much too large to recreate the whole thing if there are only a few small changes, so what is the process of updating the game's code?

Specifically PC if anything, but knowledge on other systems would be nice too, if they are different.

\$\endgroup\$
  • \$\begingroup\$ with a 20 Gb game, the majority of it will usually be assets (textures, models, audio etc.), not code. But even code rarely needs to be completely recompiled. Most modern programming languages allow to just recompile those modules which were actually changed. \$\endgroup\$ – Philipp Oct 1 '16 at 19:31
  • \$\begingroup\$ @Philipp Okay, so when the objects changed are recompiled, are they then just downloaded and replace the old ones? \$\endgroup\$ – Dr Negative Oct 1 '16 at 19:35
  • \$\begingroup\$ Essentially, yes. There are also tools which allow incremental updates of a file (only exchange those parts of a file which actually changed) but in the age of internet connections with multiple Mbit/s fewer and fewer people bother with them. \$\endgroup\$ – Philipp Oct 1 '16 at 19:40
  • \$\begingroup\$ If GTA did it with 60 gigs, then it should be possible \$\endgroup\$ – Bálint Oct 1 '16 at 20:49
  • \$\begingroup\$ Possible duplicate of How do patches in games work? \$\endgroup\$ – Vaillancourt Oct 8 '16 at 14:49
1
\$\begingroup\$

Here's a general primer, and I'd recommend searching StackOverflow for different specifics. There isn't a lot of game specific information beyond a discussion of game specific asset types or game specific operating systems (consoles, steam, etc.).

Just Assets:

So your images, sounds, models, animations, etc. are probably loaded as needed.

They may exist as separate files, in which case you can build a mechanism to update these files and possibly even force the assets to be reloaded while the game is running.

They may also exist as part of a package. A single file where the asset data is just part of the file as a whole. If this is the case, you need to be able to rewrite the specific data or accept updating the whole package file.

Code Updates:

Biggest issues here are permissions. If any application was allowed to download new code and run it there are a host of security issues. Normally in Windows there are some folders that you are allowed to place code updates for this reason.

Shared libraries, .dll files in windows. Break the code apart into smaller parts that are loaded as needed. Then you can replace those smaller .dll files.

Scripting engines allow you to essentially turn code into an asset. Instead of having to be compiled and loaded by the operating system, script just becomes text that can be easily changed.

This is a trade off of performance for ease of updates.

Conclusion:

It comes down to breaking the game into pieces, having a core set of code that handles updating those pieces and then loads and executes them.

There are way too many specifics to consider here, as well as a lot of existing solutions that could be leveraged, but I hope this gets you started.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.