Announcement

Collapse
No announcement yet.

Making your game moddable.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #76
    I also found this guide http://rokel.me/programming/2017/02/...oading-01.html somewhere on the forum.

    Edit: https://forums.unrealengine.com/show...ets-at-Runtime
    Last edited by masterneme; 03-27-2017, 10:03 AM.
    ProBoon, Old-School FPS, Open Source & Tutorials
    Support Project Boon on Patreon

    On Steam Soon, Click Below

    Comment


      #77
      I, too, have been hoping to let users create levels for my current project once it ships. It seems like if we could distribute an editor build that didn't allow exporting of assets (to protect our own assets, and the marketplace creators whose assets we're using) we'd be most of the way there. I guess also a way to restrict which editor elements modders could access would be good too - e.g. if I'm only allowing creation of levels there'd be no reason to give users access to blueprints (other than level blueprints). Different games would want to restrict differently, I guess.
      Impromptu Games|dev blog|twitter|itch.io store|Patreon
      Impromptu Procedural Ladders|Impromptu Procedural Handrails|Impromptu Procedural Stairs
      |Impromptu Fire Propagation|InFlux Example Game|Impromptu Vector Field Painter

      Comment


        #78
        Looks like the community stepped up to the plate on this.

        https://github.com/smogworks/ModSkeleton

        Comment


          #79
          Howdy folks, apologies for the longest of all waits on updates here... We've been working with partners and on our own games (Robo Recall, specifically) in order to take the right approach to building out a reusable framework for making UE4 games moddable, and I wanted to wait until we had more to share to follow up. I think we made some great progress for Robo Recall, and a lot of that code should be heading your way in future releases (thinking 4.17 right now). I know that's still a little ways out, however, I felt it important to point to a couple areas of Robo Recall in which you can have a look at to get an idea of what we did in the meantime:

          There are three core aspects to building a moddable game and editor - Editor changes, Engine changes, Gameplay changes. I'll point out how we approached each and where you can look to get reference.

          Editor Changes
          In the Robo Recall Mod Kit, the main things we did were add new buttons for creating and packaging mods, new menus that helped make subclasses of our moddable base classes, and built a set of subclasses (mod templates) that are referenced by those menus. You can find all about how we built the buttons and what packaging scripts we used, where the mod templates and everything live by checking in Engine\Plugins\OdinEditor. Mods are essentially content plugins that are packaged into .paks and mounted at runtime. We'll be able to cover this more extensively in a livestream in the future

          If you're using our approach here as reference, it is imperative that you force cook the Mod Templates folder when you package your game, as they probably won't be referenced by anything and will get culled from the list (something we ran into).

          Engine Changes
          Taking a page from the Unreal Tournament book, we leaned on the AssetRegistry as a pretty big crutch when working with asset look ups for mods. Since we're using .pak files for mods and each .pak has it's own AssetRegistry, we needed to automate the process of appending these manifests so they can be accessed easily without having to check each individual package (UT did this as well but manually, you can check their code here, look for AssetRegistry [GitHub login required]). This is something that will be coming in a later build of Unreal Engine, but the manual UT process works today.

          Gameplay Changes
          For the gameplay side of Robo Recall and making the game ready to consume new info, we moved some of the code that UT has in UTGameEngine into our GameInstance class to ensure it happens after the mods are mounted and the AssetRegistry files are combined. Basically, we look for all new mods found by their package path, check to see if they've got content that we care about (subclasses of our base classes, maps), and register them up when they're proven to be valid. OdinGameInstance.cpp and BP_OdinGameInstance.uasset have all the base code for the mod registry and handle most of the work here.

          Robo Recall mods work by registering two classes together and returning the other when one is requested. When a player selects a mod, OdinGameInstance does the following:
          • Checks each moddable type in that mod (players, enemies, etc)
            • Checks any valid assets that are in that type (Catgun, RocketLauncher, etc.)
              • Casts the assets to base class, checks value of Class Overrides (Which is set in the actor when making a mod) and registers that class with the class found in the list (assuming it's found).

          Once the pair has been registered, you can call GetOverrideForClass from Blueprints (or code) as we do in the Holsters (or maybe HolsterComponent?) and OdinCharacter (how we spawn enemy guns). If there are no overrides registered for the class, it just returns the same class so the game functions as usual. Maps are referenced by string and opened by name.

          A few other things we're still trying to sort out:
          • How to handle content that you can't redistribute in your own editor (like Marketplace content). We had to do some work-arounds for this for Robo Recall and our partners like Wildcard and Funcom have done similar, but we don't yet have a formalized process for making this smooth and easy. What we ended up doing was cooking the assets and then replacing the editor ones with the cooked versions (often to fun, new crashes ). A build server that can strip files or automate some of these things helps greatly here.
          • Engine content referenced by mods. We spent a lot of time tracking down what was going on with specific materials on some mods only to find that there were Material Functions being used that were referenced by the mods but not by the vanilla game due to them being in the Engine directory instead of Game directory. IIRC, we ended up just forcing those to cook as well.
          • Other things I'm sure I'm forgetting... but I'll add here as I "recall" them


          I hope that gives some of you some insight into our approach and a little bit as to what to expect next. Apologies again on the mega-delay in getting back with you all, I'll be checking back in more regularly and preparing to cover this in more detail in live form soon!
          Let's Connect [Twitter]

          Comment


            #81
            So how about allowing us to redistribute the editor with the game on Steam ? Because that's the one thing we really need.
            Helium Rain, a realistic space opera

            Comment


              #82
              Thank you Chance that's great, I'm especially excited about this:

              Originally posted by Chance Ivey View Post
              and a lot of that code should be heading your way in future releases (thinking 4.17 right now).
              Originally posted by Chance Ivey View Post
              We'll be able to cover this more extensively in a livestream in the future
              ProBoon, Old-School FPS, Open Source & Tutorials
              Support Project Boon on Patreon

              On Steam Soon, Click Below

              Comment


                #83
                Originally posted by Gwenn View Post
                So how about allowing us to redistribute the editor with the game on Steam ? Because that's the one thing we really need.
                We've discussed the explorations of other distribution options but have no plans at this time. Will update if that changes!
                Let's Connect [Twitter]

                Comment


                  #84
                  Thanks for the reply Chance!

                  I must say, that it's good to hear about the new upcoming modding support.

                  For my game Musical Range, I got Super, Super lucky. My mods only needs 4 files. A empty file extension for manifest, a text file for meta data, a jpg image for album covers, and a midi track to play the music track in the game. (Look at my game trailer if you wonder what my game is about).

                  Thanks to [MENTION=552]Rama[/MENTION], I managed to get a blueprint function that reads a raw jpg image in a folder. Thanks to Fpaths and FileManager I can read a txt file. Thanks to FileManager I can get a list of the names of files to read the manifest list of mod songs available. And it turns out the MIDI Plugin had a function already to read midi directly from file, without having to create a new uasset.

                  This means, in my game, I made a folder called CustomSongs.
                  Click image for larger version

Name:	f5a69d6bc8.png
Views:	1
Size:	7.7 KB
ID:	1126436

                  Inside of 0Manifest
                  Click image for larger version

Name:	51b59b14c0.png
Views:	1
Size:	8.4 KB
ID:	1126437

                  Inside of RickAndMorty-mainTheme and inside of the txt file.
                  Click image for larger version

Name:	98bfe1af50.png
Views:	1
Size:	16.2 KB
ID:	1126438

                  And you can see from Meta.txt I simply have a youtubeID string, that I use to load in game a youtube video that plays the music to the midi track.

                  It works, and is super user friendly! The players dont need to download ue4, dont need to packag,e create plugins, nothing! So direct.

                  What is amazing, is that I can use this same set up to upload items to the workshop. Which I literally just managed.
                  Click image for larger version

Name:	370e97d99f.jpg
Views:	1
Size:	169.4 KB
ID:	1126439

                  Now, I only have to check what files the user sis subscribed to, and have the game look at those directories!

                  What I am saying, is, if you want your modders to be able to replace or add files, look into adding support to read directly from a file folder. It makes the modders life much easier. This may not work with maps, but for example. Weapon skins or model reskins can work very easy. Models to replace weapons, or props, like hats, can also work. And also can be useful for custom sound effects, or adding song support. It takes some work to add this support to the game, but making the end user life easier is worthed IMO.

                  I bet many of us started moding, just by downloading skins to weapons, and later on started doing more and more modding. So the support to very basic mod is very valuable IMO.
                  Attached Files
                  Musical Range VR | Musical Range Trailer | Pausing Game On Steam Overlay | Aperture Tag

                  Comment


                    #85
                    Originally posted by Chance Ivey View Post
                    We've discussed the explorations of other distribution options but have no plans at this time. Will update if that changes!
                    I'm wondering what's so complex about this? I see no technical reason the editor has to be distributed using your launcher, it makes no difference whatsoever where people get it from.

                    Comment


                      #86
                      Originally posted by Motanum View Post
                      Thanks for the reply Chance!

                      I must say, that it's good to hear about the new upcoming modding support.

                      For my game Musical Range, I got Super, Super lucky. My mods only needs 4 files. A empty file extension for manifest, a text file for meta data, a jpg image for album covers, and a midi track to play the music track in the game. (Look at my game trailer if you wonder what my game is about).

                      Thanks to [MENTION=552]Rama[/MENTION], I managed to get a blueprint function that reads a raw jpg image in a folder. Thanks to Fpaths and FileManager I can read a txt file. Thanks to FileManager I can get a list of the names of files to read the manifest list of mod songs available. And it turns out the MIDI Plugin had a function already to read midi directly from file, without having to create a new uasset.

                      This means, in my game, I made a folder called CustomSongs.
                      [ATTACH=CONFIG]137181[/ATTACH]

                      Inside of 0Manifest
                      [ATTACH=CONFIG]137182[/ATTACH]

                      Inside of RickAndMorty-mainTheme and inside of the txt file.
                      [ATTACH=CONFIG]137183[/ATTACH]

                      And you can see from Meta.txt I simply have a youtubeID string, that I use to load in game a youtube video that plays the music to the midi track.

                      It works, and is super user friendly! The players dont need to download ue4, dont need to packag,e create plugins, nothing! So direct.

                      What is amazing, is that I can use this same set up to upload items to the workshop. Which I literally just managed.
                      [ATTACH=CONFIG]137184[/ATTACH]

                      Now, I only have to check what files the user sis subscribed to, and have the game look at those directories!

                      What I am saying, is, if you want your modders to be able to replace or add files, look into adding support to read directly from a file folder. It makes the modders life much easier. This may not work with maps, but for example. Weapon skins or model reskins can work very easy. Models to replace weapons, or props, like hats, can also work. And also can be useful for custom sound effects, or adding song support. It takes some work to add this support to the game, but making the end user life easier is worthed IMO.

                      I bet many of us started moding, just by downloading skins to weapons, and later on started doing more and more modding. So the support to very basic mod is very valuable IMO.
                      How did you do that? It's awesome! Do I need something else than the guides I posted before?

                      Originally posted by Zeblote View Post
                      I'm wondering what's so complex about this? I see no technical reason the editor has to be distributed using your launcher, it makes no difference whatsoever where people get it from.
                      I don't think it's technical but a business decision, they just want everything centralized on their Launcher.
                      ProBoon, Old-School FPS, Open Source & Tutorials
                      Support Project Boon on Patreon

                      On Steam Soon, Click Below

                      Comment


                        #87
                        Originally posted by masterneme View Post
                        How did you do that? It's awesome! Do I need something else than the guides I posted before?
                        Hey man, what do you need help with specifically?

                        For loading the images from disk, there is this code. https://forums.unrealengine.com/show...l=1#post210419

                        The reading of text file is also quite easy to do, lots of info on it on the answer hub and forums. If you want me to share my specific code, well, just let me know.

                        The reading of midi file is done by the LoadFile blueprint node of a MIDI component which is already included in the Midi UE4 Plugin by Scott.

                        The workshop is much more complicated, so that would take longer to explain, heh.
                        Musical Range VR | Musical Range Trailer | Pausing Game On Steam Overlay | Aperture Tag

                        Comment


                          #88
                          Originally posted by Motanum View Post
                          Hey man, what do you need help with specifically?

                          For loading the images from disk, there is this code. https://forums.unrealengine.com/show...l=1#post210419

                          The reading of text file is also quite easy to do, lots of info on it on the answer hub and forums. If you want me to share my specific code, well, just let me know.

                          The reading of midi file is done by the LoadFile blueprint node of a MIDI component which is already included in the Midi UE4 Plugin by Scott.

                          The workshop is much more complicated, so that would take longer to explain, heh.
                          I'm interested in the workshop but I don't want you to invest time explaining how to do it, I just need some directions exactly as you did with the other stuff which I really appreciate, thanks.
                          ProBoon, Old-School FPS, Open Source & Tutorials
                          Support Project Boon on Patreon

                          On Steam Soon, Click Below

                          Comment


                            #89
                            I found this for the workshop:

                            https://wiki.unrealengine.com/Steam_workshop
                            https://forums.unrealengine.com/show...e-via-Workshop
                            ProBoon, Old-School FPS, Open Source & Tutorials
                            Support Project Boon on Patreon

                            On Steam Soon, Click Below

                            Comment


                              #90
                              Originally posted by Chance Ivey View Post
                              Howdy folks, apologies for the longest of all waits on updates here... We've been working with partners and on our own games (Robo Recall, specifically) in order to take the right approach to building out a reusable framework for making UE4 games moddable, and I wanted to wait until we had more to share to follow up. I think we made some great progress for Robo Recall, and a lot of that code should be heading your way in future releases (thinking 4.17 right now).
                              At last, great news regarding modding!
                              Pandora Entertainment
                              github.com/PandoraEntertainment
                              [PLUGIN][FREE] AdColony, AppLovin, Chartboost, UnityAds, Vungle, Sharing, OneSignal, Facebook, Everyplay.

                              Comment

                              Working...
                              X