SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Current crop of subsims & naval games > UBOAT > UBOAT Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 05-31-19, 05:10 PM   #1
R-T-B
Sparky
 
Join Date: Aug 2008
Posts: 150
Downloads: 324
Uploads: 5


gear How to mod a Unity Game like UBOAT AKA You guys are doing it all wrong

Hello all. I'm R-T-B. An old wannabe Silent Hunter 5 modder who grew frustrated with the game and has probably been forgotten. I also am a game dev, and have worked on modding some unity games in the past.


Some terminology. Unity is a game "engine." It's what makes our game run. A lot of games are made in it. So this likely applies beyond just UBOAT, but obviously as I sponsored this game on day 1, I'm interested in modding it!


Benefits of modding a unity game the "right" way:


1.) More resilient to updates of the game itself



2.) Can better coexist with other mods (this technique only replaces the assets in the binary archive that are used).



3.) No need to distribute huge binary archive files like we are doing now. We only distribute what is changed.


Drawbacks (vs JGSME on SH):


1.) No mod list tracking (you need to track what mods and what order they are installed in on your own! Scary, I know, but no way around this, and it's not like what we had before was better).



In short, do it this way, not how you have been doing it up until now, and I think we'll all reap the benefits!


You will need an open source tool to produce a mod this way. As an example, I'm going to botch up the 13th flotilla logo, and slap a generic clipart deer/buck/stag/whatever in the middle of it. And apply a cheap photoshop filter because my Photoshop skills suck and this helps hide that fact.


I won't go too into details of what we do to make the mod, modders know about how to replace textures already I assume. But I will glance over the basics. You need this tool, called UABE, to continue (you can think of this kind of as a "JSGME for Unity games"):



https://github.com/DerPopo/UABE/releases


Grab the latest 32/64-bit build (I went with 64-bit since our game assumes you have 64-bit anyways, but it doesn't matter).


Once you have it, you got a zip archive. Extract it and run the exe tool inside. Open Uboats directory and open ALL the *.assets files in UBOAT_DATA. Do whatever mod work you desire to the files now, and feel free to explore! Hint: Files you can easily work on usually have an export option under "plugins." In my case, for our lame emblem mod (I called it "IronStag" to compensate for... something) I edited the main texture files for the Conning towers and painted a new logo on (using plugins->export to png, edit the png, and then edit->load to replace it when done editing. I use normal multithreading quality).


You can see the work here. The changed files are marked at the end with an asterisk.





Now, it's time to make our mod!

You do that with the file menu. You can chose to distribute it as an innocent non-executable file (the client will need UABE installed to use the mod then), or as a complete do-it-all exe that handles everything (the client will probably need to trust you in that case.


I'm doing both. First an EXE, though. Select that option in our case:





Fill out some mod details. As you can see, I like my mod so much I even told you what it does. I suggest you do the same. You can also set a custom and icon and should set the default game directory:





As a result of your hard work, the installer will look kind of like this:


Mine is much technical, very detail, wow:





About the only thing your end user needs to know is where UBOAT is installed. It might even figure that out for them if you installed to the same default place, and filled it out for them:





As you can see, it "patches" the needed files, only replacing what is needed. This enabled mod coexistence and better handling of updates. It's all around a far better system.




Can I has sticky?






Demo mod downloads (exe and not-exe) will be posted soon to the mod workshop here at subsim, for you to see the wonder for yourself. Stand by.



EDIT: The emblem mods I just made:


EXE Version: http://www.subsim.com/radioroom/down...o=file&id=5483


Safe "who da heck is R-T-B" version. Requires UABE: http://www.subsim.com/radioroom/down...o=file&id=5484


They should work with any modstack that doesn't touch the uboat skin, and on any version for quite some time. That's the magic.

Last edited by R-T-B; 06-03-19 at 12:32 PM.
R-T-B is offline   Reply With Quote
Old 05-31-19, 05:26 PM   #2
Sailor Steve
Eternal Patrol
 
Sailor Steve's Avatar
 
Join Date: Nov 2002
Location: High in the mountains of Utah
Posts: 50,369
Downloads: 745
Uploads: 249


Default

Welcome back! While not a modder myself, I'll be curious to see where this goes.
__________________
“Never do anything you can't take back.”
—Rocky Russo
Sailor Steve is offline   Reply With Quote
Old 05-31-19, 05:35 PM   #3
R-T-B
Sparky
 
Join Date: Aug 2008
Posts: 150
Downloads: 324
Uploads: 5


Default

I'd like to take credit but this is really just public knowledge made available in a humorous format. Other unity modders would know this but I guess none were here! Anyhow, glad to be of service and thanks for the welcome!
R-T-B is offline   Reply With Quote
Old 06-01-19, 02:25 AM   #4
R-T-B
Sparky
 
Join Date: Aug 2008
Posts: 150
Downloads: 324
Uploads: 5


Default

I'd like to add, if anyone had a mod they'd like converted to this format, I have the tools to do so and can help, but will naturally need the authors permission. Any mod authors wishing to explicitly grant me the right to do this may post here so I know and can act accordingly.
R-T-B is offline   Reply With Quote
Old 06-03-19, 10:15 AM   #5
kapitan_zur_see
Commodore
 
Join Date: Mar 2005
Location: France
Posts: 614
Downloads: 60
Uploads: 0
Default

That's a very nice post! I was wondering how it worked myself not long ago, so it's spot on for me!

As you seems knowledgeable in Unity (I only knows UE4 myself, and that's more or less only for 3D works in the graphics department), is the structure of having large packed files is an absolute necessity, or even by-product, of working with unity?

Can't you have just every files that are packed not packed the old-school way and put into different folders? This would make navigating through the files and modding so much easier, and most of all, would make mods traceable by allowing JSGME!

I can foresee the inevitable CTDs, but it's going to work a la GTA5 I guess. Mind you, we don't know what will be in the SDK yet, so... I guess it's the good way to work in the meantime
__________________

kapitan_zur_see is offline   Reply With Quote
Old 06-03-19, 11:06 AM   #6
R-T-B
Sparky
 
Join Date: Aug 2008
Posts: 150
Downloads: 324
Uploads: 5


Default

Quote:
Originally Posted by kapitan_zur_see View Post
That's a very nice post! I was wondering how it worked myself not long ago, so it's spot on for me!

As you seems knowledgeable in Unity (I only knows UE4 myself, and that's more or less only for 3D works in the graphics department), is the structure of having large packed files is an absolute necessity, or even by-product, of working with unity?

Can't you have just every files that are packed not packed the old-school way and put into different folders? This would make navigating through the files and modding so much easier, and most of all, would make mods traceable by allowing JSGME!

I can foresee the inevitable CTDs, but it's going to work a la GTA5 I guess. Mind you, we don't know what will be in the SDK yet, so... I guess it's the good way to work in the meantime

The SDK appears already has traces of itself present in the .net dll files. It looks to be very powerful and allows loading external files. I'm not sure of anything of course being it is not finalized... but not allowing external file mods would be quite unusual IMO. So yes, while a basic unity game uses archives, both are possible.

Last edited by R-T-B; 06-03-19 at 12:32 PM.
R-T-B is offline   Reply With Quote
Old 06-04-19, 05:59 AM   #7
Ragtag
Seasoned Skipper
 
Join Date: Jan 2002
Location: Oslo, Norway
Posts: 654
Downloads: 163
Uploads: 0
Default

The SDK will most likely change everything. It's why we won't make larger projects. At least i won't. The mods i made were merely a test to check out textures and such. It's also why i won't pay that much attention to above post.
Saying we done it the wrong way is stretching it abit. It's just several ways to do it. Both ways has it's pro's and cons. Only way to make a mod really user friendly, when it comes to stacking, is that modders work together and share their assets which we already do.
Grey wolf texture pack is the only mod that doesn't crash with my insignia mods. Well, except for the removal of the smoker.

I also sendt over my U-96 textures over to the modder that made the cammo mod.

When it comes to the download size it's about the same size either way. I've tested this.
__________________
Intel I7-7800x CPU.
16Gb G.skill DDR4 3600MHz.
Asrock Taichi X299 mb
Palit RTX 2080Ti.
Fortron 1000W PSU.
BenQ XR3501R LCD.
Ragtag is offline   Reply With Quote
Old 06-04-19, 10:48 AM   #8
R-T-B
Sparky
 
Join Date: Aug 2008
Posts: 150
Downloads: 324
Uploads: 5


Default

I meant wrong as in "according to Unity standards and conventions." Both approaches certainly work, and you are right that the SDK will change everything.




[UOTE=Ragtag;2612764]When it comes to the download size it's about the same size either way. I've tested this.[/QUOTE]

That would rapidly change with larger mods, but yes, at the moment it seems the case.


At any rate: The only mods that I am aware of right now worth bringing up to speed are basically the GW one and the insignias... So perhaps not worth worrying about. Shall leave that to you. Until there are more options it's not worth worrying about really and seeing SDK code already present really makes me think we are closer to release of SDK than I initially thought. So perhaps this post may be best ignored, perhaps not. Time will tell, right?
R-T-B is offline   Reply With Quote
Old 06-04-19, 01:04 PM   #9
Ragtag
Seasoned Skipper
 
Join Date: Jan 2002
Location: Oslo, Norway
Posts: 654
Downloads: 163
Uploads: 0
Icon7

SDK is planned to be released sometime this summer so not that long to wait
__________________
Intel I7-7800x CPU.
16Gb G.skill DDR4 3600MHz.
Asrock Taichi X299 mb
Palit RTX 2080Ti.
Fortron 1000W PSU.
BenQ XR3501R LCD.
Ragtag is offline   Reply With Quote
Old 06-05-19, 12:42 AM   #10
R-T-B
Sparky
 
Join Date: Aug 2008
Posts: 150
Downloads: 324
Uploads: 5


Default

Quote:
Originally Posted by Ragtag View Post
SDK is planned to be released sometime this summer so not that long to wait

Indeed. I learned that only recently but it's certainly the route to aim for, given it is soon.


Still leaving this info up just in case someone wants to learn unity packaging, heh.
R-T-B is offline   Reply With Quote
Old 07-14-19, 09:17 AM   #11
YoYo
Ensign
 
Join Date: Aug 2005
Posts: 228
Downloads: 36
Uploads: 2
Default

Thank You!
__________________
Webmaster of yoyosims.pl


SH fan, btw. my U-boot Typ VII C41 Click!
YoYo is offline   Reply With Quote
Old 07-14-19, 12:45 PM   #12
JU_88
Silent Hunter
 
Join Date: Jan 2006
Location: UK
Posts: 3,727
Downloads: 10
Uploads: 0
Default

Thanks for your input RTB and for taking the time to write long tutorials
JU_88 is offline   Reply With Quote
Old 10-13-19, 10:06 PM   #13
Kipparikalle
Samurai Navy
 
Join Date: Aug 2007
Location: Finland
Posts: 579
Downloads: 2
Uploads: 0
Default

R-T-B have you found out if it's possible to modify the sounds? I'd be very keen on the possibility of replacing the awful weapon sounds.
Kipparikalle is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 09:54 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 1995- 2024 Subsim®
"Subsim" is a registered trademark, all rights reserved.