Jump to content

Dungeon Defenders Development Kit Basic Overview


Recommended Posts

[IMPORTANT NOTE / EDIT FROM THE MODERATORS: This guide is partially outdated. The DDDK is no longer listed under DLC for the game, and instead is downloaded separately. For more information, click here.

Hey all you intrepid creative designers,

So until we get more long-form tutorials going, I'm going to be putting basic initial information about how to use the Dungeon Defenders Development Kit (DDDK) here. Feel free to copy this information to any other place of interest, such as the DunDef Nexus etc.

First thing, I want to describe what you can do with the DDDK and get some terminology out of the way:

The Dungeon Defenders Development Kit allows you to make Mods and Total Conversions for Dungeon Defenders. I want to point out right away that Dungeon Defenders and its Editor are based on (a customized version of) Unreal Engine 3, so if you really want to dig deeply into what you can do with the Editor tools or gameplay code, you should read up on the Unreal Developer Network about the Unreal Engine 3 tools. Dungeon Defenders is based on a pretty recent version of Unreal Engine 3, so 95% of the information on Epic's robust wiki are entirely applicable to editing Dungeon Defenders.

Now I'll explain what the two major categorizations of game content are that you can create with Dungeon Defenders, "Mods" and "Total Conversions":

Mods

Mods are essentially new levels that work with the base game: when installed, they are listed at the bottom of the "Challenges" section on "Open" mode only, not available on TrendyNet/Ranked. They are also automatically downloaded to new players if they join a session that's playing a Mod, and when doing online game searches you can filter by any Mods you have installed.

Making Mods doesn't actually require any coding background if you don't want to write new code: simply by working through the Dungeon Defenders Editor (more on that later), you can make new levels, import new artwork or duplicate and modify existing assets, and even use Unreal Engine 3's visual scripting language "Kismet" to change much in-mission behavior without ever touching a line of code ("mission scripting"). Furthermore, all Dungeon Defenders enemies, weapons, bosses, pets, etc are setup as "Archetypes", whcih are visually-editable objects inside of the Editor, and can be modified or new ones created for a Mod -- so new types of all those are possible without coding as well!

Mods can be much more than just a simple new level however, they can actually contain NEW script gameplay code too, so you can easily make new game types with mods, whether it's a 16-player PvP fragfest, or a 2-player story driven experience.


Total Conversions

What Mods don't allow you to do, however, is change the base core game functionality, such as rewriting how the essential player mechanics or UI's work. If you want to get down to the level where you can actually create an entirely new game from the DDDK with complete code changes, rewriting anything about Dungeon Defenders, you can do that with Total Conversions! Want to make a First Person Story-Oriented Role Playing Game ala Deus Ex? Go ahead with Total Conversions. Or the next DotA? Total Conversion. The advantage to using the Dungeon Defenders Development Kit, of course, is that you get a HUGE library of awesome existing code, art assets, and automatic online matchmaking with those who have your Total Conversions installed.

Total Conversions do NOT automatically download however, and thus you'll need to post your Total Conversionf iles somewhere (info further down on what to post) if you want to distribute them. We have included a sample Total Conversion, called First Person Defenders, which we created in less than 30 minutes, to help demonstrate what's possible. (Total Conversions, by the way, can also make use of all the existing "shipped" maps if you just want to make something which uniquely alters behavior across all existing levels, in the way that First Person Defenders does).

Installation and Files Overview

Now that we understand what Mods and Total Conversions are, let's get started! To get the DDDK, download it from Steam as a DLC at http://store.steampowered.com/app/202522 (this link will become active once Valve posts the DLC).

Once it's all downloaded (2.5 GB includes all the source artwork & animations for the game, along with the code and editable maps), you'll get the following new folders inside your Steam DunDef installation directory (by default, C:\Program Files (x86)\Steam\steamapps\common\dungeon defenders). I will describe what they all are for when listing them:

\Binaries\DunDefTool.exe: This is your launcher hub application for all of the modding and Total Conversion tools. You'll want to make a shortcut to it if Steam doesn't do so automatically. Launch it and you'll be presented with a UI that has various options for Modding and Total Conversions that I'll describe below. You not allowed to ship this with your Mod or Total Conversion.

\Binaries\DunDefDevelopment.exe: This is the actual Editor application and can also be run directly to just launch the game without the Editor. You not allowed to ship this with your Mod or Total Conversion.

\Development\Src\: This contains all the gameplay source code for Dungeon Defenders (in UnrealScript, which you can learn through the Unreal Developer Network). It's located here for Mod coding & reference purposes in particular -- Total Conversions get their own copy of this code in their own directory. But most importantly, Mod-makers who wish to add new code to their Mods can add new code "Packages" to this directory, which I'll describe later.

\DunDefAnimations\: This contains all the animations and animated meshes ("Skeletal Meshes") we used in the core game, converted to Maya ASCII format. You can base off these to make new animations for the game's characters.

\TotalConversions\Template\: This folder contains template files that are copied when you create a "New" Total Conversion using the DunDefTool. You shouldn't modify any of these files, since they're intended to be pristine each time you create a new Total Conversion with the DunDefTool.

\TotalConversions\FirstPersonDefenders\: This is an example Total Conversion, which changes the game perspective (when in chase camera) and control into an FPS.

\UDKGame\Config\DefaultDunDef.ini: This new file is used to build the Dungeon Defenders INI hierarchy for Total Conversions and the Editor. It's only really necessary to edit this if you are making a Total Conversion and wish to add more maps to the built-in maps list. In which case, you shouldn't actually edit this, but rather edit the DefaultDunDef.ini that's located in your Total Conversion directory to override or add any INI keys of interest.

\UDKGame\Config\DefaultGame.ini: This new file is used to build the Unreal Game INI hierarchy for Total Conversions and the Editor. It's only really necessary to edit this if you are making a Total Conversion and wish to edit the tech GameInfo values. In which case, you shouldn't actually edit this, but rather edit the DefaulGame.ini that's located in your Total Conversion directory to override or add any INI keys of interest.

Creating, Testing, & Shipping your First Mod

So now that we have a basic idea of what the new installed files are all about, let's go through the process of making a simple Mod level.

First, run the the DunDefTool.exe that I told you about earlier (remember, make a shortcut to it, you'll be using it a LOT!). On the Tool, click "Launch Mod Editor". Click "Yes" when it says "Scripts are outdated. do you want to rebuild scripts?" (always click yes :) ). Once that is done (you'll see a green "Success" line at the bottom when it's finished), close that window and click "Launch Mod Editor" again (you only have to do this Script rebuild once). Then you'll see the Editor splash screen appear and it'll start loading up. Eventually when it's finished, it'll ask you to accept our DDDK EULA, please do so and the Editor will finally open up (when it asks to update the asset database, you might as well click "Run Now", and when that's finished the Editor will appear).

Now to make this example quick, we're going to simply open an existing level, change a few things, and save that as a mod level. Obviously you will probably want to change many more things and create your own layouts and content, but for that, please read up on how to use the Unreal Editor from the Unreal Development Network Level Editing Home. Any terminology I use that may be specific to the Editor, please refer to the Unreal Development Network's Editor page, since there's no need for me to reprint all that info here.

So let's go ahead and Open one of the original Dungeon Defenders maps, goto File->Open and navigate to this file (or where-ever your Steam install directory is):

C:\Program Files (x86)\Steam\steamapps\common\dungeon defenders\UDKGame\Content\Maps\ServantsQuarerts.udk

Once that's finished opening, let's change a few basic things and save it as a Mod map. Select View -> World Properties from the Menu Bar. Type "Tower Units" into the search panel in the new popup, and rather than 85 Tower Units, let's make it 30 (less towers == more difficult!). Also, let's allow more enemies at once, so search for "maximum number of enemies", and change each of those "80" values to 120.

There's one last thing we have to do to set this up as a proper Mod map: search for "Custom Level", and click the "Use Custom Level Entry?" checkbox. And let's fill out a few important additional properties here for a Mod map. The two critically important values are the "Entry Identifier Tag", and the "Level File Name". For the Entry Identifier Tag, it has to be a 6 (SIX) character string (no more and no less!), when you ship your Mod you'll want this to be entirely unique since it will differentiate your map from others in online searches, no one else should have yours. So come up with something distinctive, such as MYMODS1, but not that since I'm using it! If someone else steals yours, it's not the end of the world, but both maps will then be listed in the same online search. Also, Level File Name needs to be whatever we're going to save this new map as... and critically, it must be in the following format: MYMODS1_WhateverFilename (where MYMODS1 is whatever you actually used for your Entry Identifier Tag). If it's not in that format, the game won't list it in the Challenges section at the bottom, which is where you'll find your installed mods.

You can also set "Level Description" property there to whatever you want, such as "A more difficult version of Servant's Quarters". Level Friendly Name could be "Servants Quarters Mod", or whatever you want.

So I set my Entry Identifier Tag to MYMODS1, the Level File Name to MYMODS1_ServantsQuartersMod, and then I saved the level (File->Save As) as MYMODS1_ServantsQuartersMod


Bonus Points: if you want a real challenge for your players, click on the "K" button on the main toolbar to open the Kismet, and look for the "EnemyDifficultyIncreasePerWave" variable in the Kismet (a little to the left of the default position, click and drag the mouse to scroll the Kismet). Select that variable bubble, and change the 0.3 value to 2.0 (now enemies will get much more difficult each Wave).

If you want to quickly try out your map for iteration, you can do so easily without leaving the Editor, by clicking the "Play In Editor" joystick button on the Toolbar of the Unreal Editor. A window will open, your default hero will spawn, and you can start seeing your changes at work!

Now we're all done with the Editor, and ready to cook the map for release! Go ahead and shut down the Editor, and back in the DunDefTool, enter your Mod Map filename in the "Mod Map Name" box, and click the "Cook Mod Map" button. Another "do you want to compile scripts?" popup will appear (only once), click Yes, let the script compiler do its work -- you'll get some "warnings" in yellow as the scripts are being compiled for final-release shipping, but ignore those. Close the window when it's finished at the end.

Then another window will appear called "Conforming", that will quickly check all your content to make it compatible with the shipping version of Dungeon Defenders. Once that's finished at the end (it'll say "Success" in green), close that Window down too.

After a brief delay, a third and final window will appear that will actually cook your map for public shipping, once that says "Sucess" you can close it and you're all finished! The cooker places the map file in your newly-created UDKGame\CookedMods folder, and you can take the file from there to distribute online as you see fit (in my case, it was UDKGame\CookedMods\MYMODS1_ServantsQuartersMod.upk -- notice the extension is .UPK, which distinguishes it from the uncooked .udk map).

That "CookedMods" folder is also where any maps you download in-game will be placed, and if you install any .upk Mod maps from the web, you should place them there as well (and direct your users to do so if you're distributing your Mod map yourself).

Now to finally test our Mod Map in the shipping version of Dungeon Defenders, go ahead and launch it as normal through Steam (not using the DunDefTool, but launch the real game by clicking "Play" in the Steam Client.) Go to "Open" mode in Online, or Local game, and in your Tavern Mission Selection menu go to Challenges, scroll to the bottom, and you'll see your Mod map listed (in my case, "ServantsQuartersMod"). Click "GO" and enjoy playing your new map! If you host a game online and palyers join you, they'll get this map transferred to them automatically (though at a low bandwidth rate to avoid hurting your network performance -- so having your users download your Mod first from the web or your distribution channel of choice is preferable where possible).

Note: the Mission name for our Mod map which was initially displayed on the Mission Setup wasn't the "Friendly Name" we set in the Map Info in the Editor (instead it was the filename minus the Entry Identifier Tag), nor was our Level Description showing. If you go back to your Mission Setup screen in the Tavern after playing the map, however, it'll update with the correct Friendly name and Description. If you want your Friendly Name to immediately display, simply change your Filename to match your friendly name, and you can use "_" characters in your filename to create spaces.

Anyhow, that's the basics of creating a Mod Map -- how to Edit and Cook! Beyond this, creating new Items, Enemies, Mission Scripting, Kismet, Waves, artwork assets, and an infinite number of other things can be described in detail, but I'll leave that to other tutorials at other times, and here's hoping the modding community takes up the charge with its own tutorials about those topics to help foster community creativity.

We'll be around to help you every step of the way, so go nuts and make some awesome new stuff!

IMPORTANT NOTE: if you are making a new level from scratch rather than modifying an existing one, you can start with our "DD_LevelTemplate.udk" to build on which has some initial values setup in its WorldInfo (but remember to setup the Custom Level Entry as described above!), and pre-placed Enemy Spawner Kismet. Otherwise, if you are building from scratch and don't want to use the Template Level, you MUST set up a DunDefMapInfo on it in order to be playable (all existing maps have this setup). In the Editor, goto Menu Bar "View"->"World Info", search for the "My Map Info" property, and click on the arrow button to the right of that property, and select "DunDefMapInfo" from the popup list which will appear. Then you're good to go!

Creating, Testing, & Shipping your First Total Conversion

Total Conversions provide you the ability to change essential Dungeon Defenders code functionality, all the way down to the lowest level of UnrealScript, enabling you to modify, rewrite, or redesign essentially any aspect of the game to make something entirely new. Total Conversions are preferable to Mods only if you wish to change BASE game functionality -- if you just want to make a new map or gametype, you might be better off creating a Mod.

That said, Total Conversions can change as little as they want, so as an example of how even a small change can make an interesting new experience, we provided the "First Person Defenders" Total Conversion example.

First off, there are two ways to launch Total Conversions: For the end-user, they should go to the "Configure" option in the Dungeon Defenders splash screen, and then click on "Conversions" in the configuration tool, and select any installed Total Conversion from that list, then click Launch. If they wish, they can click "Save Conversion" to use that Total Conversion again afterwards without having to go through the Configure tool each time. Try out with "First Person Defenders" and you'll see what I mean.

Note that Total Conversions only matchmake among their particular Total Conversion, so when you're running a Total Conversion, you won't see any games online that aren't playing that specific Total Conversion.

Anyhow, Total Conversions allow you to override any package file contained in the UDKGame\Content by putting it within your Total Conversion's Content folder, and of course you can add new files to your Total Conversion's Content folder as well. Also, Total Conversions have their own copy of the game code that you compile, located in their "Src" folder.

Let's go ahead and create a simple new Total Conversion really quickly that will make all the characters run much, much faster. In the DunDefTool, enter SuperSpeedTC in the "New TC Name" box, and click "Create New TC". The Tool will freeze for a moment while it creates the new folder and copies the template files over (including a full copy of the base game code), but once it unfreezes, you'll see SuperSpeedTC immediately listed in the "Available Total Conversions" list. Select it and click "Launch TC Editor". It'll ask you to compile scripts (this compiles your Total Conversion's scripts, NOT the regular game scripts), click Yes. When that's done, click "Launch TC Editor" again. You'll now be in the Editor for your specific TC, and any packages you save will automatically go into your TC's own Content folder to act as an override. Anyway, the change we're going to make for our Super Speed TC is in code, not in Content, so we can shut down the Editor for this.

Now let's edit some code!

Dungeon Defenders' code is UnrealScript, and if you want to master it and make some really impressive stuff, I'd highly recommend reading the UnrealScript references on the Unreal Development Network, including the Mastering UnrealScript series of tutorials.

If you have Visual Studio and nFringe (highly recommended, and it's free for editing), you can use that to Edit code with Intellisense, we've included the Visual Studio nFringe project here: TotalConversions\SuperSpeedTC\Src\DungeonDefenders_Scripts.sln

If you don't, you can use NotePad or NotePad++ to open this file, or you can use or any other Unreal Script Editor (UDE etc).

So with whatever application you use as a code editor, open "C:\Program Files (x86)\Steam\steamapps\common\dungeon defenders\TotalConversions\SuperSpeedTC\Src\UDKGame\Classes\DunDefPlayer.uc"

Goto line 1748, and instead of this current code:

return DunDefGameReplicationInfo(WorldInfo.GRI).ModifyPlayerGroundSpeed(self,PlayerGroundSpeed * MovementSpeedMultiplier * GetPlayerGroundSpeedModifier());

Replace that line with this:

return 2000;

So this very simple TC makes us always run fast :)

I usually like to also add a custom string to the main menu of my TC to make it obvious that it's a TC, for that open this file:

C:\Program Files (x86)\Steam\steamapps\common\dungeon defenders\TotalConversions\SuperSpeedTC\Config\DefaultDunDef.ini

And to that config, add these lines:

[UDKGame.DunDefViewportClient]
VersionString="Super Speed Conversion!"

Now to test our super speed!

Before we cook it for shipping to our users, let's test it locally uncooked to iterate quickly. In the DunDefTool, click "Launch UnCooked TC", which will then ask you to compile scripts (every time you make a code change it will do this). Click yes, and when the script compilation is finished with Success, close it and click "Launch UnCooked TC" one more time. You'll notice the "Super Speed Conversion!" text in the botto-right of the main menu, because we added that to our TC's ini. Now load any map (notice that Ranked play is disabled because it's a TC), and you'll run super fast!

Very simple TC obviously, but of course with the code you can do anything you want, whether it's a complete game rewrite or a simple modification like this (the First Person Defenders TC, for example, simply changes the DunDefPlayerCamera position to be at eye level in chase-camera mode and hides the character model).

Remember also, you'll only see online games that are running YOUR TC (automatically determined by your script signature), so you won't see any online sessions out there until you start distributing your cool TC to the public.

Now about that, we need to Cook the TC in order for end-users to run it. Shut down the running game and click "Cook TC" in the DunDefTool. It'll proceed to compile scripts in "final release" mode, you'll get a few warnings that are harmless. Once that's finished close that window and it'll proceed to conform your data to be compatible with the shipping game content. When that conforming process is finished (should say "Success" in green), close it and the cooker window will open and proceed to cook your TC AND all of its maps (any maps that you have in your TC Content\Maps directory). You'll get 3 harmless warnings about UI_Event_Initialized and EngineDebugMaterials, ignore them. Once that's done, your TC is ready to ship!

But first, let's test the TC in its shipping form. Click "Launch Cooked TC" from the DunDefTool and it'll run the TC on the shipping game, and you should see everything work the same. You can also now launch the TC from the Configuration menu, just like your end-user would.

Let's talk about how you package up your TC for shipping to the end-user (since TC's don't automatically download within the game):

You'll want to zip up and send them (or post somewhere for distribution, ModDB etc) the following folders:

YourModName was SuperSpeedTC in our case

\TotalConversions\YourModName\Config (these are your INI's, they are necessary since they don't cook)
\TotalConversions\YourModName\CookedPCConsole (these are your cooked shipping files)
\TotalConversions\YourModName\Movies (you can add your own Bink movies and/or change the loading movie)
\TotalConversions\YourModName\Splash (so you can customize the startup splashes!)

Also, you can delete Cooked.pmap from your distribution's CookedPCConsole folder, and if you didn't change any Materials, you can delete RefShaderCache-PC-D3D-SM3.upk from the CookedPCConsole folder as well. That will save you about 100 MB.

One final note: Total Conversions load and store their save files into their local folder, to avoid messing up people's save data, and TC's also can store anything they want in the save data.

If end-users wish to use their existing save data in a TC, then they must manually copy over their save data from "C:\Program Files (x86)\Steam\steamapps\common\dungeon defenders\Binaries\Win32\DunDefHeroes.dun" into your TC folder. In the near future, we may add an option for TC's to load data from the regular application save directory (but not save it back there). But that's how it is currently.

So I finished my mod, now what do I do?
You should create a post in the completed mod section detailing your mod, what it does, and where it's hosted. If you need a place to host the files, please feel free to use Dungeon Nexus: http://dungeondefendersnexus.com/ and then link to that mod page on our forums. If you'd like you can always include in the post (or check the appropriate box), enabling us to incorporate your mod into the main game/ranked mode. If there's a demand on behalf of the community and we like it, we'll incorporate it and give you credit in the main game!

Exciting Times!

So that's a basic overview of creating Mods and Total Conversions! We didn't really get into the infinite number of things you could do or create with this capability, but rather just the essential process of getting into the tools and packaging the stuff up for release. We hope that community-oriented power-users will create Tutorials for the DunDef community that will go into greater detail about how to create items archetypes, enemy archetypes, code areas of interest, and more. We'll certainly be here to help you out, and the entire Trendy team is incredibly excited to see what the creative and intrepid designers among out there can come up with :) Go forth, and have fun!!!
  • Thanks 1

Share this post


Link to post
Share on other sites
  • 2 years later...
Guest
This topic is now closed to further replies.
×
×
  • Create New...