# C++ as DLC?

**URL:** <https://forums.unrealengine.com/t/c-as-dlc/1272960>\
**Category:** C++\
**Tags:** dlc, pak, unreal-engine, content, CPP, question\
**Created:** [August 26, 2023, 4:46am UTC](https://forums.unrealengine.com/t/c-as-dlc/1272960 "2023-08-26T04:46:10Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![DELGOODIE](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/delgoodie/32/1103781_2.png) [@DELGOODIE](https://forums.unrealengine.com/u/DELGOODIE)\
**Post date:** [August 26, 2023, 4:46am UTC](https://forums.unrealengine.com/t/c-as-dlc/1272960/1 "2023-08-26T04:46:10Z")

</div>

So I like to do 99% of my project in C++ and I was starting to think about how I would add new guns, abilities, etc as DLC content where I could publish a new gun at runtime without the user having to restart their game.

Is it possible to ship c++ classes as dlc, say through the chunk downloader in a pak file?  
Are there other ways to ship c++ as dlc?

I really just don’t want to have to use blueprints and make all my dlc be spaghetti.

---

<div class="post-metadata">

**Author:** ![Hexavx](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Hexavx](https://forums.unrealengine.com/u/Hexavx)\
**Post date:** [August 26, 2023, 7:01am UTC](https://forums.unrealengine.com/t/c-as-dlc/1272960/2 "2023-08-26T07:01:01Z")

</div>

u can load a dll file, but I don’t think it will work properly, since the game must recognize the additional functions.  
Why don’t just lock the ability behind the DLC?

---

<div class="post-metadata">

**Author:** ![MagForceSeven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/magforceseven/32/906563_2.png) [@MagForceSeven](https://forums.unrealengine.com/u/MagForceSeven)\
**Post date:** [August 26, 2023, 12:59pm UTC](https://forums.unrealengine.com/t/c-as-dlc/1272960/3 "2023-08-26T12:59:49Z")

</div>

No, most/all platforms expect your code to be a monolith. This means that any code changes require you to actually patch your game instead of just downloading a new dll. You can get around this with blueprint logic (as you pointed out) or by integrating another asset based scripting language like lua into your build and workflows.

But all’s that really means is that you have to patch in support for new types/features but the content itself (blueprints and other assets) could be in a separate pak files that are downloaded and loaded up by your game.

There’s also the new-ish (4.27+) Game Features system that lets you build plugins that are dependent on your game which allows you to write dlc/update code _as if_ it were a separate dll without it actually being shipped as one. You can each enable and disable them at runtime! The code is still a monolith, but the plugin structure allows you to prevent the types of references you’d want to avoid. Features are still a work in progress so there are some gotcha’s like the fact that subsystems from Features still get instanced even if the feature is disabled.

---

<div class="post-metadata">

**Author:** ![DELGOODIE](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/delgoodie/32/1103781_2.png) [@DELGOODIE](https://forums.unrealengine.com/u/DELGOODIE)\
**Post date:** [September 19, 2023, 9:36pm UTC](https://forums.unrealengine.com/t/c-as-dlc/1272960/4 "2023-09-19T21:36:06Z")

</div>

Interesting I’m kinda doing the opposite approach of making plugins that my game depends on, so a lot of systems in my game are split out into plugins and don’t know about the content of the game

---

<div class="post-metadata">

**Author:** ![MagForceSeven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/magforceseven/32/906563_2.png) [@MagForceSeven](https://forums.unrealengine.com/u/MagForceSeven)\
**Post date:** [September 20, 2023, 12:56am UTC](https://forums.unrealengine.com/t/c-as-dlc/1272960/5 "2023-09-20T00:56:24Z")

</div>

Yeah, you’re describing “standard” plugins and they absolutely have a place in organizing your code and project. But they do have limitations that the Game Feature plugins are trying to fill. And for content, Feature plugins seem to be the better fit right now.

One of those limitations involves how easy or difficult it is to make pak files for a plugin that you could ship independently as DLC. In the most recent 5.3 update I’ve seen some movement on support to make that easier for Feature plugins (it was already possible before if you hand rolled it). I’ve never heard of anyone making plugin pakfiles and shipping those. But it doesn’t mean it hasn’t happened.

---

<div class="post-metadata">

**Author:** ![DELGOODIE](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/delgoodie/32/1103781_2.png) [@DELGOODIE](https://forums.unrealengine.com/u/DELGOODIE)\
**Post date:** [September 20, 2023, 3:32am UTC](https://forums.unrealengine.com/t/c-as-dlc/1272960/6 "2023-09-20T03:32:50Z")

</div>

Im a little bit confused if you could explain further, so a Game Feature plugin means that it depends on your PRIMARY\_GAME\_MODULE, while normal plugins cant, but its still in the same dll? Is this purely an organizational benefit or are there any unique features of a Game Feature plugin?  
Right now I have two modules inside my project: GameCore and GameContent where core has all the base classes and under the hood stuff and GameContent has my derived weapons, abilities, etc. Is my GameContent module sort of what the Game Feature plugin does? and is there any benefit to moving this to the Game Feature plugin?  
Thank you for your responses, super helpful!

---

<div class="post-metadata">

**Author:** ![MagForceSeven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/magforceseven/32/906563_2.png) [@MagForceSeven](https://forums.unrealengine.com/u/MagForceSeven)\
**Post date:** [September 20, 2023, 1:24pm UTC](https://forums.unrealengine.com/t/c-as-dlc/1272960/7 "2023-09-20T13:24:33Z")

</div>

It depends on what you’re building.  
When you’re building the Editor, all the modules build their own dll’s. It doesn’t matter if the module is from a plugin, the engine, your game or game features.  
When you’re building a non-editor version of your game everything is statically linked together into a single exe. There are no dlls (at least not from Unreal, but that’s not important).

> [@DELGOODIE](#):
>
> so a Game Feature plugin means that it depends on your PRIMARY\_GAME\_MODULE, while normal plugins cant

Correct.

> [@DELGOODIE](#):
>
> Is my GameContent module sort of what the Game Feature plugin does?

More or less. The only difference is that the GameCore module would probably be your PRIMARY\_GAME\_MODULE.

> [@DELGOODIE](#):
>
> is there any benefit to moving this to the Game Feature plugin?

As mentioned before they allow for some easier ways to package your game in smaller chunks. It wasn’t impossible before but it could be less obvious what those smaller chunks were supposed to be or to manage references that crossed chunks.  
There multiple systems dedicated to allowing you to turn these game features on & off at runtime and have that interact with the asset system in ways that are really useful.  
But mostly it allows you to build things that are game specific and wouldn’t be transferred to another game (they’re not trying to import Mario Kart features directly into a Mario platformer) in a way similar to plugins for similar reasons.

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [October 20, 2023, 1:25pm UTC](https://forums.unrealengine.com/t/c-as-dlc/1272960/8 "2023-10-20T13:25:10Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
