NathanKell Posted September 29, 2024 Author Posted September 29, 2024 As the stack shows, there was a Harmony (the thing that patches code) exception trying to patch a method (a code function on a class). Once the exception was hit, patching of methods stopped. That meant that the code was in a broken state. The method that failed to be patched was a ship generation coroutine method. My guess is that due to code changes, the internal name the compiler chose for that coroutine changed. That is not specifically linked to any change in code per se, just that code changed enough that the compiler made different decisions. This is the problem with how UAD does so much with LINQ delegates and coroutines, delegates/lambdas and coroutines all lead to anonymous methods that have non-deterministic names, which means that when things change enough the names change, so TAF has to get changed to match the new names (which I have to find first, fun). tl;dr I'm back from vacation and fixing things. In other news, MelonLoader 0.6.5 released; it is not compatible with UAD. I've talked with the ML devs and they're going to look into it, but for now you need to use 0.6.4 (see the OP install instructions). If you haven't updated ML to 0.6.5, or you haven't installed in the last few days, you're safe. 2
NathanKell Posted September 29, 2024 Author Posted September 29, 2024 Updated TAF for 1.6.0.6 Optx5. 2
NathanKell Posted September 30, 2024 Author Posted September 30, 2024 Ok, I did a deeper dive into the new premade design system in 1.6.0.7. TAF will support replacing these designs. I'll get this ready this week, assuming I have time. The process will be as follows, for a mod maker: Backup your shared designs Launch UAD Go to Shared Designs Delete any shared designs you don't want to have count as premade designs Press a key and all shared designs will be saved out to the Mods folder as the new set of premade ships in a packedShips.bin file. TAF will replace the vanilla premade ships with any supplied packedShips.bin file. I'll also add a button to the file converter to convert all shared designs from binDesign to json (or, at worst, a key to do so, UI is annoying.) These will be converted back to binDesign on game launch, like how saves are. This way if folks want to hand-edit their premade ships, they can. Note that there are a LOT of premade ships in 1.6.0.7 - there are 20 of each type for each nation in the campaign start years, and 10 of each type in a bunch of other years (1902, 1914, 1936, etc). @o Barão @brothermunro that work? Any changes you want done to that workflow? 2
MDHansen Posted September 30, 2024 Posted September 30, 2024 Just got this message. UAD 1.6.0.6 opt5 & TaF 3.11.2 [21:57:28.488] [TweaksAndFixes] During invoking native->managed trampoline Il2CppInterop.Runtime.Il2CppException: System.NullReferenceException: Object reference not set to an instance of an object. --- BEGIN IL2CPP STACK TRACE --- System.NullReferenceException: Object reference not set to an instance of an object. --- END IL2CPP STACK TRACE --- at Il2CppInterop.Runtime.Il2CppException.RaiseExceptionIfNecessary(IntPtr returnedException) in /home/runner/work/Il2CppInterop/Il2CppInterop/Il2CppInterop.Runtime/Il2CppException.cs:line 36 at UnityEngine.Component.get_gameObject() at TweaksAndFixes.TAFShipDataAccessor.TAFData(Ship ship) at DMD<Il2Cpp.Ship::TechGunGrade>(Ship this, PartData gun, Boolean requireValid) at (il2cpp -> managed) TechGunGrade(IntPtr , IntPtr , Byte , Il2CppMethodInfo* )
NathanKell Posted September 30, 2024 Author Posted September 30, 2024 52 minutes ago, MDHansen said: Just got this message. UAD 1.6.0.6 opt5 & TaF 3.11.2 [21:57:28.488] [TweaksAndFixes] During invoking native->managed trampoline Il2CppInterop.Runtime.Il2CppException: System.NullReferenceException: Object reference not set to an instance of an object. --- BEGIN IL2CPP STACK TRACE --- System.NullReferenceException: Object reference not set to an instance of an object. --- END IL2CPP STACK TRACE --- at Il2CppInterop.Runtime.Il2CppException.RaiseExceptionIfNecessary(IntPtr returnedException) in /home/runner/work/Il2CppInterop/Il2CppInterop/Il2CppInterop.Runtime/Il2CppException.cs:line 36 at UnityEngine.Component.get_gameObject() at TweaksAndFixes.TAFShipDataAccessor.TAFData(Ship ship) at DMD<Il2Cpp.Ship::TechGunGrade>(Ship this, PartData gun, Boolean requireValid) at (il2cpp -> managed) TechGunGrade(IntPtr , IntPtr , Byte , Il2CppMethodInfo* ) What were you doing at the time? Can you reproduce it? This would occur if that TAFData accessor is being called on a null ship. 1
flaviohc16 Posted October 1, 2024 Posted October 1, 2024 (edited) is the latest V3.11 compatible with 1.6.0.6 opt 4? (so i can play with NAR) Edited October 1, 2024 by flaviohc16
MDHansen Posted October 1, 2024 Posted October 1, 2024 17 hours ago, NathanKell said: What were you doing at the time? Can you reproduce it? This would occur if that TAFData accessor is being called on a null ship. Haven't been getting it since I wrote the message log. At that particular time, I had hit next turn, and it froze on "Update Research", just after updating a few of the AI nations actions. I'll report further if I get it again.
flaviohc16 Posted October 1, 2024 Posted October 1, 2024 @NathanKell Could you please give a look on why my install it's not working? Thanks
NathanKell Posted October 1, 2024 Author Posted October 1, 2024 4 hours ago, flaviohc16 said: is the latest V3.11 compatible with 1.6.0.6 opt 4? (so i can play with NAR) Either use Opt5 with the latest (3.11.2) TAF and NAR (which should be fine--it's not like anything in NAR will care whether it's Opt4 or Opt5, only TAF will) or go back to TAF 3.11.1 3 hours ago, MDHansen said: Haven't been getting it since I wrote the message log. At that particular time, I had hit next turn, and it froze on "Update Research", just after updating a few of the AI nations actions. I'll report further if I get it again. Yeah my guess is somehow one of the places that tries to get/add TAF data was called on a null ship. But there's a ton of places I call that funciton, so it's hard to say where. If you have a ML console log from that session (check MelonLoader\logs) upload that, it might have extra info. 1
NathanKell Posted October 2, 2024 Author Posted October 2, 2024 (edited) I've uploaded an experimental version of TAF that works with the beta branch and lets you Convert shared designs to JSON. They will be written as .desgin files, sitting next to the .bindesign files. On next load of UAD they will be converted back to .bindesign Create an override premade designs package. This will take all shared designs and output them as premade designs in a file called premadeDesgins.bin in the Mods folder. Whenever UAD will try to load the premade designs package, TAF will substitute the override package. NOTE: for now, you must replicate vanilla behavior and include at least 1 design of each type for each nation for each campaign start year, otherwise campaigns will not start when AI design is set to Mixed or Fast. It's worth pointing out vanilla has a LOT of ships: 20 of each type for each nation in campaign start years, and 10 for each type for multiple nations in a bunch of other years. This is done in the File Converter window, I've added two new buttons there. They are self-explanatory. Anyway, here's the DLL. It will not work with 1.6.0.6 obviously. https://github.com/NathanKell/UADRealism/raw/1607/TweaksAndFixes/bin/Release/net6.0/TweaksAndFixes.dll @o Barão @brothermunro Edited October 2, 2024 by NathanKell 4
o Barão Posted October 2, 2024 Posted October 2, 2024 "NOTE: for now, you must replicate vanilla behavior and include at least 1 design of each type for each nation for each campaign start year, otherwise campaigns will not start when AI design is set to Mixed or Fast. It's worth pointing out vanilla has a LOT of ships: 20 of each type for each nation in campaign start years, and 10 for each type for multiple nations in a bunch of other years. " Damn😒 1
NathanKell Posted October 4, 2024 Author Posted October 4, 2024 On 10/2/2024 at 6:31 AM, o Barão said: "NOTE: for now, you must replicate vanilla behavior and include at least 1 design of each type for each nation for each campaign start year, otherwise campaigns will not start when AI design is set to Mixed or Fast. It's worth pointing out vanilla has a LOT of ships: 20 of each type for each nation in campaign start years, and 10 for each type for multiple nations in a bunch of other years. " Damn😒 Vanilla also has a Batch Ship Generator that will generate all these designs (the vanilla feature is of course just "pregenerate ships" not "hand-create sane ships for the AI"). I will hook that up when I have time so that modders can batch-generate premade ships for their mods. In other news, the released version of 1.6.0.7 has sufficiently different code from the last betas that the 1607 branch of TAF does not work with it. I will fix it when I get home and release 3.12 with 1.6.0.7 compatibility. 1
NathanKell Posted October 5, 2024 Author Posted October 5, 2024 Updated for 1.6.0.7 with a bunch of new stuff. 2
MDHansen Posted October 5, 2024 Posted October 5, 2024 What actually changed between the last beta opt and release?
brothermunro Posted October 5, 2024 Posted October 5, 2024 17 hours ago, NathanKell said: Vanilla also has a Batch Ship Generator that will generate all these designs (the vanilla feature is of course just "pregenerate ships" not "hand-create sane ships for the AI"). I will hook that up when I have time so that modders can batch-generate premade ships for their mods. That would certainly save me a lot of time!! 1
NathanKell Posted October 5, 2024 Author Posted October 5, 2024 6 hours ago, MDHansen said: What actually changed between the last beta opt and release? Turns out nothing in terms of code, the report that I got that the 1607 branch was incompatible was wrong. 1
Bill_Falsename Posted October 6, 2024 Posted October 6, 2024 [05:09:54.653] [Il2CppAssemblyGenerator] Error Generating Interop Assemblies! System.Collections.Generic.KeyNotFoundException: The given key 'System.IntPtr' was not present in the dictionary. at System.Collections.Generic.Dictionary`2.get_Item(TKey key) at Il2CppInterop.Generator.Utils.UnstripTranslator.TranslateMethod(MethodDefinition original, MethodDefinition target, TypeRewriteContext typeRewriteContext, RuntimeAssemblyReferences imports) in /home/runner/work/Il2CppInterop/Il2CppInterop/Il2CppInterop.Generator/Utils/UnstripTranslator.cs:line 112 at Il2CppInterop.Generator.Passes.Pass81FillUnstrippedMethodBodies.DoPass(RewriteGlobalContext context) in /home/runner/work/Il2CppInterop/Il2CppInterop/Il2CppInterop.Generator/Passes/Pass81FillUnstrippedMethodBodies.cs:line 23 at Il2CppInterop.Generator.Runners.InteropAssemblyGeneratorRunner.Run(GeneratorOptions options) in /home/runner/work/Il2CppInterop/Il2CppInterop/Il2CppInterop.Generator/Runners/InteropAssemblyGenerator.cs:line 175 at Il2CppInterop.Generator.Il2CppInteropGenerator.Start() in /home/runner/work/Il2CppInterop/Il2CppInterop/Il2CppInterop.Generator/Il2CppInteropGenerator.cs:line 32 at Il2CppInterop.Generator.Il2CppInteropGenerator.Run() in /home/runner/work/Il2CppInterop/Il2CppInterop/Il2CppInterop.Generator/Il2CppInteropGenerator.cs:line 49 at MelonLoader.Il2CppAssemblyGenerator.Packages.Il2CppInterop.ExecuteInterop() in D:\a\MelonLoader\MelonLoader\Dependencies\Il2CppAssemblyGenerator\Packages\Il2CppInterop.cs:line 97 Had this error when trying to install on a fresh install of the base game
NathanKell Posted October 6, 2024 Author Posted October 6, 2024 1 hour ago, Bill_Falsename said: [05:09:54.653] [Il2CppAssemblyGenerator] Error Generating Interop Assemblies! System.Collections.Generic.KeyNotFoundException: The given key 'System.IntPtr' was not present in the dictionary. at System.Collections.Generic.Dictionary`2.get_Item(TKey key) at Il2CppInterop.Generator.Utils.UnstripTranslator.TranslateMethod(MethodDefinition original, MethodDefinition target, TypeRewriteContext typeRewriteContext, RuntimeAssemblyReferences imports) in /home/runner/work/Il2CppInterop/Il2CppInterop/Il2CppInterop.Generator/Utils/UnstripTranslator.cs:line 112 at Il2CppInterop.Generator.Passes.Pass81FillUnstrippedMethodBodies.DoPass(RewriteGlobalContext context) in /home/runner/work/Il2CppInterop/Il2CppInterop/Il2CppInterop.Generator/Passes/Pass81FillUnstrippedMethodBodies.cs:line 23 at Il2CppInterop.Generator.Runners.InteropAssemblyGeneratorRunner.Run(GeneratorOptions options) in /home/runner/work/Il2CppInterop/Il2CppInterop/Il2CppInterop.Generator/Runners/InteropAssemblyGenerator.cs:line 175 at Il2CppInterop.Generator.Il2CppInteropGenerator.Start() in /home/runner/work/Il2CppInterop/Il2CppInterop/Il2CppInterop.Generator/Il2CppInteropGenerator.cs:line 32 at Il2CppInterop.Generator.Il2CppInteropGenerator.Run() in /home/runner/work/Il2CppInterop/Il2CppInterop/Il2CppInterop.Generator/Il2CppInteropGenerator.cs:line 49 at MelonLoader.Il2CppAssemblyGenerator.Packages.Il2CppInterop.ExecuteInterop() in D:\a\MelonLoader\MelonLoader\Dependencies\Il2CppAssemblyGenerator\Packages\Il2CppInterop.cs:line 97 Had this error when trying to install on a fresh install of the base game You didn't follow the OP. You need MelonLoader 0.6.4.
NathanKell Posted October 6, 2024 Author Posted October 6, 2024 I have now reimplemented UI for the Batch Ship Generator. Modders can now generate predefined designs easily. @o Barão @brothermunro once you do this (I suggest a minimum of 10-count for "All" nations for "All" shiptypes in the campaign start years of 1890-1940, and if you want to support Fast mode, 5-counts every time major new tech unlocks, about once every 3-5 years), you can then open the File Converter and convert all your shared designs into predefinedShips.bin and you'll be all set! In other news, while trying to fall asleep last night, I came up with an enhancement for the predefined designs system. My idea is the following: multiple sets of predefined designs. The highest-priority set would have human-designed (and much better) ships, and only after they are used would the game fall back to the predefined designs made with the batch generator. If players desire variety, the game could switch to the batch ships on a random chance, not just when the manually-created designs were used up. I say this because even with the work we've put into making the ship generator smarter, a human will still be better (and regardless, is likely to make a prettier ship). So it would be nice to prioritize those ships, without requiring players to have them all sitting in their Shared Designs collection. That said, because the number of these ships will always be small, as above I would support a random chance to ignore these designs, for those players who want variety in their campaigns. Thoughts? 2
brothermunro Posted October 6, 2024 Posted October 6, 2024 It would be very helpful to have a second tier set of pre designed ships! Sounds like an excellent feature to me! 2
Peksern Posted October 6, 2024 Posted October 6, 2024 (edited) 1 hour ago, NathanKell said: (and regardless, is likely to make a prettier ship) most important point. always choose nations for the most prettiest design models. Btw, did you find the reason for the upgraded Guns in battle, while they shouldn't be upgraded? (If not, it's fine. I can imagine you currently have different priorities. Then it might be just a humble reminder. 😊) Edited October 6, 2024 by Peksern
flaviohc16 Posted October 6, 2024 Posted October 6, 2024 @NathanKell I'm playing with NAR, but i think this is your bug reader than OBarao's one: When I check the "add crew" box, it doesn't work with mothballed ships like it works on vanilla, so i need to add manually the crew of all my mothballed ships, and it's a pain in late years with big fleets.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now