Ipsquiggle

ONI Is Upgrading to Harmony 2.0!

Recommended Posts

Cairath    1010

Better late than never on this one ;) Thanks! We've really wanted this for a long time :)

  • Big Ups 2

Share this post


Link to post
Share on other sites
Peter Han    63

Thank you for putting in the effort to update Harmony! I am curious about the timing of your "mergedown", however, will June 10th also feature code base changes to unify Vanilla and the Spaced Out! DLC?

  • Like 3

Share this post


Link to post
Share on other sites
SharraShimada    1058

i guess i have to get into active modding myself... because i fear, there will be many (for me) essential mods that will not be updated ever after this change.

 

  • Like 2

Share this post


Link to post
Share on other sites
babba    1933
35 minutes ago, SharraShimada said:

i guess i have to get into active modding myself... because i fear, there will be many (for me) essential mods that will not be updated ever after this change.

:encouragement:

A multiplayer mod would be great, I can provide oxygen for 1000 player dupe visitors in 1 cycle in my big map - If every player sends 1 dupe and then leaves before the oxygen runs one, we should be ok. Everybody can lag as clients below 1 fps :lol: Arrival is via rockets ( premium ) or drop pods ( saves space ) and everyone gets a pedestal pressi for their own colony to collect in babba`s base. Having such an working mp mod would be an achievement like playing Battlefield with a thousand. :rolleyes::hopelessness: Even if someone works 3 years on it, it could be wortwhile, as long the big chat window for everyone gets updated in "real time" - That is the most important hihi :cool-new:

Edited by babba
  • GL Happy 1

Share this post


Link to post
Share on other sites
Ipsquiggle    8237

To be clear, the timing looks like this:
 

June 10th -- next Spaced Out public testing -- Mergedown (and Harmony2.0) is available on Spaced Out Public Testing

June 24th -- next Spaced Out release -- Mergedown goes live to all Spaced Out players

... some weeks later -- Mergedown is available on Oxygen Not Included Public Testing

... some weeks later -- Mergedown is Live for all players.

 

  • Like 2
  • Thanks 1
  • Big Ups 1

Share this post


Link to post
Share on other sites
SharraShimada    1058

So, do i get this right? Public test for the DLC will get the update today and will break mods? (for safety reasons i unsubbed to test versions), and DLC will get in inevitably at june 24th?

Share this post


Link to post
Share on other sites
gabberworld    222
1 hour ago, SharraShimada said:

So, do i get this right? Public test for the DLC will get the update today and will break mods?

it break the all mods yes when that happens, but you can already update because Harmony dll can be downloaded from they webpage 

there no big difference as far i remember expect the

  • Change all using Harmony; to using HarmonyLib; in your code
  • If you use OnLoad(HarmonyInstance harmony), change it to OnLoad(Harmony harmony)

 

Edited by gabberworld
  • Like 1

Share this post


Link to post
Share on other sites
Duck986    1373
10 hours ago, Ipsquiggle said:

It is also the case that the major code changes we're doing right now are going to break a significant number of mods, and later when the Vanilla and DLC codebases are finally fully merged, all the existing Vanilla .dll mods will have broken anyways

This is a bruh moment indeed.

Share this post


Link to post
Share on other sites
Cairath    1010

It shows you guys haven't been around for any previous major changes :P The world is not ending, if anything it'll be a good cutoff for old unsupported mods.

  • Like 1

Share this post


Link to post
Share on other sites
pether    1008
17 minutes ago, Cairath said:

The world is not ending, if anything it'll be a good cutoff for old unsupported mods.

I don't think it will be cutoff for them. Judging by what was happening with mods without DLC support, old mods without Harmony 2.0 support will be claimed by random people and "fixed", often without mod or even C# understanding. If game code changed later causing mod to break, such people may lack skills to fix it properly and there will be even more mess in the workshop.

If mod is forgotten by the author and no longer supported it could be understood, but I'm pretty sure there will be attempts to claim mods done by authors who are still around but wait until things are stable and explicitly forbiding stealing their mods... @Ipsquiggle, do you have any power to remove stolen mods from steam when author of the original is still around but wasn't fast enough to update their mods? It would help to clean the inevitable mess and hopefully prevent such bad habbits in the future

About the change - I fear the mess it will bring, but I guess it is nessesary and I'm happy it happens when I am around and aware of changes to update my mods. Also, I am super excited about code merge, it will make life so much easier in the future! Great news, thanks!

  • Like 3

Share this post


Link to post
Share on other sites
gabberworld    222

thing is some mods dont need update that often, it allot depends how mod is made, but with that update now those mods will not work either  who not need active updates

Share this post


Link to post
Share on other sites

Im not a modder, but if the modders like this, than I like this.  Im all for better modding APIs for our creative individuals.

But I also agree with Pether, there will most likely be a lot of stolen mods follow these "events", because of modders being too busy.  These should most likely be stamped out once those mods have updated.

  • Like 1

Share this post


Link to post
Share on other sites
crazy_xyr    1
On 6/10/2021 at 5:55 AM, Ipsquiggle said:

lastWorkingVersion: 466655

lastWorkingBuild  has been changed to lastWorkingVersion ?

  • Like 1

Share this post


Link to post
Share on other sites
Cairath    1010
5 hours ago, crazy_xyr said:

lastWorkingBuild  has been changed to lastWorkingVersion ?

It has not. Typo :P 

@Ipsquiggle, you might want to correct that in the first post

Share this post


Link to post
Share on other sites
Ipsquiggle    8237

Today's patch, r467601, changes the target framework of the 0Harmony.dll to 4.7.1. The top post has been updated. It's recommended you retarget your mod projects to that version.

I also fixed the mod_info typo, thank you!

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
Brrainz    8

Hello ONI community. I am happy that my Harmony library is now an official part of the product. We had the 1.x -> 2.x switch a while ago in the RimWorld community where I first created Harmony to make my first mod. The switch went fine and I am pretty sure it will be for you guys too.

I am still working on Harmony 2.1 but we have commited to making only API compatible changes to it and that will allow ONI to just upgrade to it without mods need to change.

Again,
congrats and keep it up!

Andreas "Brrainz" Pardeike

  • Like 2
  • Thanks 1
  • Big Ups 1

Share this post


Link to post
Share on other sites
Ipsquiggle    8237

Hello, today's patch contains a significant change to the mod API. The upgrade should be fairly simple, but mods will have to make it in order to continue loading. I'll make up a full post for it and update the top-post here in a day or two when it's solid, but please give it a review and let me know if you encounter any problems with it.

The new API works like this:

  • There is a new class, KMod.UserMod2 which becomes the entry point to the mod. Make a new class that inherits from UserMod2 to access the entry point hooks and data.
  • Any mod which doesn't have an implementation of UserMod2 will simply have harmony.PatchAll() called for each assembly.
  • For any assembly which does have an implementation of UserMod2:
    • The mod system will instantiate an instance of that class.
    • It will fill in some properties, and then call a virtual OnLoad(Harmony harmony) method on that instance. (The base implementation simply calls PatchAll(). )
    • After all mods assemblies have been loaded/patched, the mod system will call virtual OnAllModsLoaded(Harmony harmony, IReadOnlyList<Mod> mods) on that instance. The base implementation of this function does nothing.

This process will require upgrading your mods (full instructions will come soon), but the simple version is:

  • Do nothing if you want auto-patching
  • Make a class that inherits from KMod.UserMod2 and override the virtual methods as you see fit.

The overall effect of this change is that modders can optionally handle the patching process entirely themselves, as well as perform actions reliably once all mods are loaded but while still in the mod loading part of the startup sequence. As well, this prevents spurious/magic "OnLoad" calls from being triggered. Additionally, this instance may be used to provide additional data to the mod in the future.

Please give it a peek once the update is live and leave your feedback in this thread. Thanks!

  • Thanks 3
  • Big Ups 1

Share this post


Link to post
Share on other sites
Cairath    1010

Yay!

But.. what did the poor UserMod do to you that you already replaced it with UserMod2? :P

  • Sad Dupe 1

Share this post


Link to post
Share on other sites
pether    1008
15 hours ago, Ipsquiggle said:

Any mod which doesn't have an implementation of UserMod2 will simply have harmony.PatchAll() called for each assembly.

Do I understand correctly that if I don't make any changes to my mods (except from ofc updating them to use Harmony 2.0 and .Net 4.7.1 from the previous message), and I ignore UserMod2, my mods will work exactly the same as before this patch? I try to estimate how many issues I will encounter during my updates ;)

@Cairath, never ask:

  • a man his salary
  • a woman her age
  • Ipsquiggle what happened to UserMod1
  • Haha 1

Share this post


Link to post
Share on other sites
Cairath    1010

Well, I'd trade my age for the story about UserMod ;)

 

Regarding your question @pether, if you didn't use any hooks like onload and just relied on the auto patch then skipping UserMod wont hurt you

  • Haha 1

Share this post


Link to post
Share on other sites
Ronivan    16

So, the Harmony 2.0 will also be updated for the vanilla version? I mean, I know it will eventually, but I want to know if it will be updated right on next week.

Edited by Ronivan

Share this post


Link to post
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