Jump to content
Game-Labs Forum

Editing the UI and sounds through UABEA (WIP)


MDHansen

Recommended Posts

Hello

I am making this thread to spread my knowledge and findings regards the UI ingame. I will keep updating this as I find more information and ways to play with the UI

AS ALWAYS, MAKE BACKUP OF THE FILES YOU ARE EDITING

1. Get UABEA and understand how it works.
2. Open the resources.assets file located in "steamapps\common\Ultimate Admiral Dreadnoughts\Ultimate Admiral Dreadnoughts_Data"
3. Press F8 (scene hierarchy)
4. Instructions for individual areas follows below

FYI; You can find the asset in the resource file by right clicking the component in the right hand column and choose "Visit Asset". It will then jump to the correct object in Assets Info. Edit the object(s) and you can then extract them out, so you can add them back in after a game update. Skips the process of doing it all over again every patch.
gjgYWhV.png

--------------------------------------------

First off is the annoying damage floatups. This has been a thorn in my side, along with the bad resolution/scaling ingame. @brothermunro has somehow disabled some of the floatups ingame, through means only known to the Man himself (no, not Munro, he doesn't know how he did it).
1. Scroll all the way down and find "FloatUpCont"
2. In the right hand column look for "Canvas Base", right click it and choose "Edit Asset"
3. Find "1 UInt8 m_Enabled = 1", and change it to = 0
4. Hit ok and ok to the message popping up.
5. Close the Scene Hierarchy window and save the fileFvjujSk.png

--------------------------------------------

Remove individual sounds (aka remove the annoying effects in the shipbuilder, ui click sounds, end turn, etc etc)
1. Find music_world_peace. About 1/7 down the page
2. Everything below(with no expanding triangle) is sounds/effects (music_world_peace -> con_generate_ship)
3. Right click+Edit Asset "MonoBehaviour Base (soundpack)" in the right column, counts for all
4. Find  
"0 float volumeMin = "
"0 float volumeMax = "
and change to = 0 (or something to your choosing between 0 and 1)

--------------------------------------------

Box and Font Size campaign map popup messages (typcal "confirm" and "information" messages)
1. Find MessageBox (all the way down)
TBC

Edited by MDHansen
addons
  • Like 1
Link to comment
Share on other sites

Yeah I pressed some button combo and it now doesn’t show blocked or ricochets, and doesn’t show ‘penetration’ or ‘partial pen’ in words below the damage number. No idea how I did it 😅 do you know how to change the game’s font? 

  • Like 1
Link to comment
Share on other sites

  • MDHansen changed the title to Editing the UI and sounds through UABEA (WIP)

So I am able to change font sizes. I do fear that font type needs a .dll input, as a mod through MelonLoader. Since you'd have to add a new font to the game (ive seen it in other Unity based games). Doable, definately doable

Link to comment
Share on other sites

  • 3 weeks later...

If you're trying to figure out what gameobject to toggle, run the game with UnityExplorer, pause with the UI element you don't like up, hit F7 and go fishing through DoNotDestroy->Global->UI, toggling off suspected targets until you find it. Then you can disable it by editing the prefab with UABEA, I'd assume.

  • Like 1
Link to comment
Share on other sites

Posted (edited)

yup, this is what I've been doing :D along with just finding it in the resource file through UABEA. Some things are actually named, while most hides behind f.ex. as you sa "gameobject" or similar

Edited by MDHansen
  • Like 1
Link to comment
Share on other sites

Posted (edited)

what I want most of all, and is what I do ingame by using UE through MelonLoader, is to change the UI resolution. The game says it runs at 3840x2160, but it really isn't. Infact UE says its running at a native 1024x768. On a 60" gaming screen running at full 4k, then blown back again to 1990 era resolution... Minecraft comes to mind😝

So I change the resolution, and then all the information popups on the campaign map. tedious, takes a few minutes, but worth it. Sadly have to do it each time I load the game. I am not fluent enough in this unity/c++ language to do anything about it sadly

Edited by MDHansen
Link to comment
Share on other sites

On 5/12/2024 at 7:13 AM, MDHansen said:

what I want most of all, and is what I do ingame by using UE through MelonLoader, is to change the UI resolution. The game says it runs at 3840x2160, but it really isn't. Infact UE says its running at a native 1024x768. On a 60" gaming screen running at full 4k, then blown back again to 1990 era resolution... Minecraft comes to mind😝

So I change the resolution, and then all the information popups on the campaign map. tedious, takes a few minutes, but worth it. Sadly have to do it each time I load the game. I am not fluent enough in this unity/c++ language to do anything about it sadly

If you tell me what you change and when, I can probably whip you up a modlet to do that without too much trouble. (And you'd be writing C#, not C++ -- the game uses IL2CPP but modding is done in C# and the loader translates it into native at runtime for injection.) Once the sln exists, you should be able to just run MSBuild on the command line to rebuild it against the latest DLL without having to open it in an IDE or make any changes.

Same for the flag stuff--I meant to do one for that and then got busy again with real life stuff so it slipped my mind.

  • Like 1
Link to comment
Share on other sites

I did mean C# ofc :D

That woud be awesome, thank you. I have to come back to you after work with a detailed description.

Real life is why this is taking me so long to learn aswell. Also that I'm starting completely on scratch doesn't help either

Link to comment
Share on other sites

Also, I would very much appreciate it if you would give me a rundown on the tools you are using for this. I still need to learn it, but reverse engineering it would help a lot for me

 

MDH

Link to comment
Share on other sites

19 hours ago, MDHansen said:

Also, I would very much appreciate it if you would give me a rundown on the tools you are using for this. I still need to learn it, but reverse engineering it would help a lot for me

 

MDH

I use https://github.com/SamboyCoding/Cpp2IL which gets me bits of the C++ back into IL. (Load that in your IL decompiler of choice, I use ILSpy.) It has only a bit of coverage (and you need to run it with the unsafe argument), but it's helpful in combination with native decompiling.

For that, I use https://github.com/Perfare/Il2CppDumper which spits out the metadata which is most of the leg-up you need. You then use either IDA or Ghidra and run the script that Il2CppDumper generates to apply the metadata (function names, data types, etc) to make decompiling easier.

At that point it just takes a bunch of practice to try to read the pseudocode decompile and ignore all the weird IL2Cpp gunk.

 

If you google for Il2CppDumper you should find a bunch of guides on how to get going with this; that's what I did and it worked...eventually. :D

 

  • Thanks 1
Link to comment
Share on other sites

the dumper I've used. But I've always kind of stagnated there lol 

Right, thank you very much, this is indeed helpfull!

I'll write a little something about what I want done later. Forgot yesterday

  • Like 1
Link to comment
Share on other sites

It's worth pointing out that IL2Cpp has a bunch of quirks that look weird in C++ if you're used to C#. For example, you don't get implicit operators like [], everything is a function (e.g. to set an element of an array, Sub328AEEF or something random like that is run, taking the array, the index, the value, and a method pointer. Also, if you're familiar with IL, you'll know that instead of pointers objects get int64 IDs. So if you see int64s getting passed around, those are actually IL pointers.

Also IDA at least is very bad about figuring out what constructor is actually run, for me it usually claims it's some JSON Lexer. This is because type detection coming from assembly is...more art than science, and sometimes there's just not enough info. But right before the constructor runs, an instantiate call with a class intptr is run, so you do actually know the object type.

Same deal with generic methods--you'll often see something like a Ship.Section dictionary method, but the actually method ptr is for a different kind of dictionary, and that's the actual type of object returned (or taken).

And both those also apply when lambdas get passed (lambdas get compiled as extra classes called DispalyClass_SomeNumbers to store the captures, with methods in them that are the code. But often the lambda that gets used is the same, so you won't find the listed function (i.e. multiple method pointers point to the same actual function). You can read the offset from the method pointer, subtract it from a known function's method pointer, and that'll give you the location of the function actually run. If in doubt, put a breakpoint before the lambda's invoked and just step into it to see where you go.

 

Game Labs makes _super_ heavy use of Linq and lambdas, which make it kind of a pain to decompile--it'd be bad even if it were managed code. So you have to work a bit harder than you otherwise might.

  • Thanks 1
Link to comment
Share on other sites

Posted (edited)

christ allmighty smite me! I finally got the time (gf is away for the weekend) and sat down to get this started. I got the programs, ive run them... and im so lost LOL

now. it took me a minute to figure the SamboyCoding out, but I did it, running it from the cmd. the il2cppDumper is all ok and good. ILSpy is up and running (ive used dnspy before, but not really actually used it. 
Regards to ILSpy, do you actually do anything there, or is it for perusing only?

Ghidra... completely lost. :D it's installed and running, but.. yeh

Well, I got the time to make sense out of this. I can see the files in Samboy directory. I recognize most of it

 

I've been getting really good at rumagging around using UABEA through the resource.assets and sharedassets files, knowing what to look for (for the most part), but oh man is it tedious. I've replaced fonts, resized different windows and popups ingame, information windows, replace/resize flags, etc etc etc.. 

 

Would you be able to hop on to BrotherMunros discord one day for a chat ? @NathanKell

 

MDH

Edited by MDHansen
  • Like 1
Link to comment
Share on other sites

1 hour ago, MDHansen said:

christ allmighty smite me! I finally got the time (gf is away for the weekend) and sat down to get this started. I got the programs, ive run them... and im so lost LOL

now. it took me a minute to figure the SamboyCoding out, but I did it, running it from the cmd. the il2cppDumper is all ok and good. ILSpy is up and running (ive used dnspy before, but not really actually used it. 
Regards to ILSpy, do you actually do anything there, or is it for perusing only?

Ghidra... completely lost. :D it's installed and running, but.. yeh

Well, I got the time to make sense out of this. I can see the files in Samboy directory. I recognize most of it

 

I've been getting really good at rumagging around using UABEA through the resource.assets and sharedassets files, knowing what to look for (for the most part), but oh man is it tedious. I've replaced fonts, resized different windows and popups ingame, information windows, replace/resize flags, etc etc etc.. 

 

Would you be able to hop on to BrotherMunros discord one day for a chat ? @NathanKell

 

MDH

You'll want to run cpp2il with something like this: `cpp2il --game-path "c:\Games\Steam\steamapps\common\Ultimate Admiral Dreadnoughts" --just-give-me-dlls-asap-dammit`

ILSpy (or dnSpy or whatever your prefer) is just for looking at the assembly. While in an IL game you could use Cecil to rewrite the dll, with IL2Cpp your only hope is Harmony, I believe. (I don't think any of the other runtime-injection things will help here since they rely on transpiling, but I could be wrong.)

Discord hopped. :)

And yeah trying to make sense of disassembly, even with all the metadata we get from a Unity game, is a right pain.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...