Hello! Between being out of town, getting sick when I got back, then a water heater related crisis, I've had precious little time to work on the game these past few weeks. However, that doesn't mean nothing exciting has happened! For quite some time now, I've been on and off investigating and working on how to expand mod support. I've been really excited to see modders pushing the boundaries of what I thought was possible, even up to creating their own tools and pipelines for importing new models. I originally came from a modding background (Battlefield and Freelancer mostly, but not exclusively) so I love to see it. [img]https://cdn.discordapp.com/attachments/945712988688633917/1154640997477781585/image.png?ex=651e40b9&is=651cef39&hm=358b1ccdfe533e4f87685bb969cd67eef5e16715bc3d1d3dfbff8c847dedb3c5&[/img] [img]https://cdn.discordapp.com/attachments/945712988688633917/1150514071637086218/image.png?ex=651e667a&is=651d14fa&hm=5c4abc34273b171873fa2fdfaee95138dc81921c8a8a3d252afbce95b642d8b9&[/img][i]Screenshots courtesy of nuclearstonk and giantenemycrab from the MPS and TCA Modding Discords[/i] Between being inspired by the work the modding community has been doing, and the work I happened to be doing at the time, things had lined up in such a way that I could do something about the most difficult part of modding TCA: importing new assets. [h2]The Problem of Loading Data Files[/h2] [img]https://i.imgur.com/mW6FLhE.png[/img] This is a very back-end problem, but it's important to mention because it gives context to the fun part. In the beginning of September I began work on expanding the mission scripting and trigger system to build out the first campaign, and remove the placeholder dev-test one currently in the game. This was going to require some edits and likely additional data files. The way in which the game loads data files (JSON files, to be exact) is bespoke and unique across basically every single object type that uses it. This was mostly a product of me learning as I went, since I was unfamiliar at the time with how best to structure this all. Since then, the process has solidified, and in game jam style side-projects, I'd come up with a generic solution worked best. In TCA's current system, whenever I needed to load a new set of data, it requires a bespoke loader. The past 4-5 of these (most recently weapon related) have basically been completely copy/pastes of each other, further strengthening the argument for the unifying them. Redoing the loaders probably wouldn't take that long, since most of the data is already pretty uniform, but I had other motives for this well, relating to improving mod support and future developments. For the record, rewriting and unifying all the loaders took only about a week. [h2]The Mod Loader[/h2] [img]https://i.imgur.com/tV7VMjp.png[/img] With all the game's loaders and data now conveniently consolidated, putting together a mod system in which the base game's content is now a "mod" for the game that is simply hardcoded to load by default was fairly straightforward. Additional mods, with their own content and data, can be loaded on top from a new Mods folder. This means that instead of player created mods requiring overwriting of the game's own data files (which will always be wiped on an update as well), mods can coexist in their own folders. [img]https://i.imgur.com/y88vM7v.png[/img] A mod for TCA uses the following: [list] [*]Mod.json used to define some metadata about the mod [*]Data folder with all of its JSON data in a directory structure matching the base game [*]Asset file(s) used to add new content (e.g. models and textures) to the game [/list] Any new data entries get added to the game on top of the Core data. If a conflicting entry is spotted, it will overwrite the Core's (or a previously loaded mod's) data, making it so that changes to base content are still possible. There not currently any UI for this mod loading process, but some will be added soon. [h2]The Bundle Exporter[/h2] [img]https://i.imgur.com/gP7yWAv.png[/img] While the data for the game has always been exposed, the "missing link" for being able to truly add content to the game has always been a method to add new assets: models, textures, and animations. This was always going to be the trickier part, since Unity's model importers are only available at edit-time, and even in the best of cases imports will usually involve some fiddling with the model to map materials and animations post-export regardless. The solution: asset bundles, a shockingly under-documented Unity feature that is critical for many games to deliver live content, that can similarly be used to pack content for mods. [url=https://nihilocrat.tumblr.com/post/157890290188/mod-support-in-unity]Sky Rogue's ancient post documents this method[/url] and it's been living in my head rent free for many years. Earlier this week I finished up a custom asset bundle tool designed specifically for Tiny Combat and the new mod system. This method of building models for the game has several big advantages: [list][*]Since this runs in Unity, with Tiny Combat's own shaders, you can preview exactly what the model will look in any lighting conditions. [*]Tiny Combat requires that that the axes for transforms and objects are aligned correctly such that Z is forward, X is right, and Y is up. Being able to preview the model natively allows you to be sure of their alignment and debug any issues in the import process. [*]Animations can be created using the same pipeline as the game, meaning support the game's built in animations (only landing gear at the moment, but this will be expanded in the future as needed) [/list] [img]https://i.imgur.com/eFUT1v8.png[/img] The project still needs to be cleaned up, but it will be uploaded to GitHub has a self-contained Unity project for 2019.3.30 LTS (the version the game is built on). I've been testing the workflow using the A-10 model that I've been sitting on. It still needs work before it's game ready, but that's exactly why it's been such a good guinea pig. [h2]The Next Patch[/h2] [img]https://cdn.discordapp.com/attachments/1070353410043420702/1154530119134740680/Arena-20230921-162609.png?ex=65286576&is=6515f076&hm=1ab29b8fb92b1241605deb0abfba591df7a5133e7fee4418d1ec3fe101cda10e&[/img] Very soon, a new patch to the game will be released on the tester's branch. While this will have the mod loaders, the main purpose is to make sure that the game still functions normally. The loader changes were pretty low level, and while it [i]should[/i] just work, you can never tell with these things, especially because Steam adds another layer of unknowns to this. I plan on writing a more detailed article (perhaps in the Guides section of the game) for how to create mods. It's a very straightforward thing to do, so it shouldn't be too complicated. The asset bundle tool however will be much more involved, and its own separate guide. As stated above, the bundle tool still needs some cleaning up before it's ready for public release, and may take some time to write up the documentation necessary.