🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Expasions

Started by
4 comments, last by Calin 2 years, 3 months ago

Often video game companies that have a video game tile on market come up with an addon to their original game. My question is technically speaking how do they do it. Is the addon 'infringing' on the original executable by the means of a file editing sequence in the addon installer which modifies portions of the executable or a company would modify the original source files and recompile the entire executable project/solution instead and then deliver a brand new executable in the addon package.

My project`s facebook page is “DreamLand Page”

Advertisement

The most common is a plugin architecture.

On Windows, that is usually a DLL. When a new expansion is installed the dll is added to a list. The main executable goes through each dll, verifies it against whatever criteria it has (such as a digital signature from the publisher), ensures the DLL has the plugin functions, then calls them. There is a similar approach for other systems. Usually there's a family of a registration function, a data load/startup function, a data unload/stop function, and an deregistration function. During registration and data loading the modules in the plugin hook themselves up to all the interfaces in the main game, and during unload and deregistration they remove their hookups. Libraries can build more, as they see fit.

The code needs to be written to provide abstract interfaces, so SOLID design principles are useful. When I was working on The Sims 3 Store the key was to implement the core game interfaces in our downloadable objects and the features would automatically work. For example, in the fixer-upper car I implemented the interface to be a vehicle, the interface to be a reparable object, the interface to be a skill-gaining object, the interface to be a music/radio source, and more. Because everything in the game was designed around these interfaces, any expansion that implemented the interface worked seamlessly with the rest of the systems. If you had installed the Katy Perry expansion any radio source could play all their music, and new dances in that expansion could work seamlessly with any music object. But implementing the outdoor shower, a much simpler object, needed to implement the basic interface of being a shower and then required implementing some overrides, which were also enabled through those same SOLID principles where interfaces also check virtual functions to enable overriding behavior.

Some games will release entire SDKs for the plugin community. Anybody who wants to can create new, custom content. Other games keep it limited in house, and the game itself verifies digital signatures. Some do a mix, allowing both official digitally signed libraries and unofficial, insecure libraries.

frob said:
The most common is a plugin architecture.

That`s a rather complex approach, the game must be thought to receive expansions straight from the original version.

'dll' is the one word summary of the answer.

Thanks for you time frob.

My project`s facebook page is “DreamLand Page”

Calin said:
'dll' is the one word summary of the answer.

Right, but if I replied to “My question is technically speaking how do they do it” with the word “dll” it would be a near-useless response.

it would be a near-useless response.

That was just me thinking out loud. 'dll' is the chapter where everything you said belongs to. I need to prioritize/establish a hierarchy in all that presentation. Trying to assimilate everything at once without discrimination would result in a choke. I need a place to grab it from.

My project`s facebook page is “DreamLand Page”

This topic is closed to new replies.

Advertisement