This guide is intended for game developers or mod tool creators who are familiar with the Steamworks UGC, and are interested to learn how to migrate and/or support the mod.io SDK. We'll compare some full working examples showing the core mod CRUD functionality (Create, Read, Update, Delete) for both Steamworks and mod.io. Developers commonly use mod.io to distribute mods outside of Steam, in their DRM free builds sold on other platforms and stores. mod.io aims to be 100% transparent and open, allowing you to control the modding ecosystem and community inside your game.
- Member functions vs std::functional: Probably the first difference that pops up is the GameManager class Steamworks uses in contrast to the lambda function on the mod.io example. This is because Steamworks uses CCallResult pairs binded to member functions, this means you have to declare a class (GameManager in the example) and bind the callback to a member of that class. On the other hand, mod.io uses std::functional introduced since C++11 so you can register a callback to a standalone function, a member function like Steamworks or even a lambda call like the example.
- Modern C++: The callbacks are not the only difference in terms of modern C++ usage. mod.io receives and returns standard C++ parameters, for example std::strings and std::vector instead of char* or pointer arrays that demands extra care. Also, if you are developing in a language other than C++ you can use the mod.io low level C interface.
- Legal Agreement: Steamworks Workshop Agreegment is handled by the developers. Before creating or updating an item, you should check the m_bUserNeedsToAcceptWorkshopLegalAgreement parameter returned from the callback and redirect players to to the agreement page in case they haven't accepted it. mod.io handles all that in the website when the users sign up so there is no extra steps required.
- Creation process: The mod creation process is very similar. In Steamworks you customize the UGCUpdateHandle_t returned by StartItemUpdate and in mod.io you setup the ModCreator object to setup the fields that will be updated. However, Modfiles are handled a bit differently. Steamworks Modfiles are part of the Mod profiles so they are uploaded by updating an already existing Mod profile. This means you first create a Mod profile by calling CreateItem and then you upload a Modfile by updating that Mod using StartItemUpdate. mod.io's Mods and Modfiles are separate objects, this allows more flexibility in terms of versioning (e.g. going back and forth between versions). So you are provided with a set of Mods and Modfiles functions to browse, create, update and delete them.
- Pagination: Steamworks fixes all the requests to 50 results and you can browse each page by using the unPage prameter. In mod.io you can handle the limit and offset via the FilterCreator object.
- Filtering: Mod browsing can be achieved with the following methods:
- CreateQueryUserUGCRequest: Retreives all the mods that the user has interacted with sorted by EUserUGCListSortOrder and filtered by EUserUGCList and EUGCMatchingUGCType.
- CreateQueryAllUGCRequest: Retreives all the public mods sorted by EUGCQuery and filtered by EUGCMatchingUGCType.
- CreateQueryUGCDetailsRequest: Retreives a list of mods by providing an array of ids.
- Update process: In Steamworks you customize the UGCUpdateHandle_t and then call StartItemUpdate. As explained above, mod.io's Mods and Modfiles are separate objects so first you setup the ModEditor or the ModfileEditor object and then call the editMod or editModfile functions depending what you're updating.
- Deletion process: Both deletion processes are very straight forward: You provide a mod id and the mod gets deleted. However, Steamworks deletes permanently that mod so as far as I know, there is no way to retrieve the mod data afterwards. mod.io soft deletes, so it keeps all the data in case you decide to restore it later.
- Authentication: Steam client handles all the authentication so you don't have to worry about it. mod.io doesn't requires a client which means it's lightweight and flexible. It provides a simple email authentication process.
- Downloads and events user preferences: Players can setup their downloads preferences using the steam client, mod.io game developers can give their users the same experience by integrating the downloads methods.
mod.io offers a variety of interfaces: a modern C++ SDK, a low level C multilanguage SDK, direct API calls and specific engine plugins. Just keep in mind you don't depend on a game client so extra coding is needed (authentication and events) but it opens the door to new possibilities such as unifying your modding community or building games and tools that interact directly with the API, allowing much greater flexibility and control. You can start integrating mod.io into your game right away, take a look at the SDK, API and our getting started guide to begin.