Jump to content

Mod update for 1.1 - how long it will take after 1.1 came out?


omelaw

Recommended Posts

With the ability to load asset bundle we may be able to design our UI in the Unity editor and load them at run time. That would make the whole mod building a bit more complex however.

And it won't work for all of us (MJ and is editable windows means I ll most likely have to do it by hand).

Some kind of library shared by mods, or at least code we all share/contribute to, would also make it easier. Cities: Skylines had something like that AFAIK (but in the game code itself)

Link to comment
Share on other sites

1 hour ago, sarbian said:

The "new" mono UI was actually added in Unity 4.6 and is already available in KSP 1.0 but nearly no mods use it (only 1 AFAIK). Myself I was waiting since using the same UI system than the dev should hopefully make the transition a bit earlier (may be able to reuse some of their calls).

It's only 10 simple buttons, but it was a pain to create. I actually made a working version of portrait stats using the new UI too, but OnGUI gets drawn on top of everything and I could never find a way to force the new UI to go over the crew portraits.

 

Link to comment
Share on other sites

3 hours ago, NathanKell said:

@Padishar OnGui is slooooow, everybody should switch. :]

Yes, I did say the new API was better.  Yes, it would be great if every mod switched, however, they won't need to switch to work with 1.1 so it probably won't affect how long it takes for many (if any) mods to be updated (which is, after all, the subject of this thread).

2 hours ago, sarbian said:

The old UI allocate a lot of object each frame. So you have a bunch of memeory allocated x times per seconds. And when mono need to free that the game freeze shortly. It is the KSP stutter.

While it does create garbage each frame I don't believe it's as significant as you imply.  Especially considering that the garbage the UI creates per graphics frame is pretty constant but the amount created by other code in KSP increases rapidly as the part count increases.  When you've only got a simple vessel, the UI might be causing a considerable fraction of the garbage and CPU usage but when you get up to a few hundred parts or more and the game is rendering far fewer frames per second it is much less significant.

Link to comment
Share on other sites

11 hours ago, sarbian said:

With the ability to load asset bundle we may be able to design our UI in the Unity editor and load them at run time. That would make the whole mod building a bit more complex however.

And it won't work for all of us (MJ and is editable windows means I ll most likely have to do it by hand).

Some kind of library shared by mods, or at least code we all share/contribute to, would also make it easier. Cities: Skylines had something like that AFAIK (but in the game code itself)

Will this help? http://docs.unity3d.com/ScriptReference/UI.DefaultControls.html

It is not much, but at least it handles the creation of basic controls for you, all you need after is position and tweak them to your liking.

 

Also I do remember somebody at Squad mentioning that they will provide modders with access to some UI library they made for themselves, but it was a LONG time ago, back in September or something like that.

Edited by Ziw
Link to comment
Share on other sites

8 hours ago, Padishar said:

While it does create garbage each frame I don't believe it's as significant as you imply.  Especially considering that the garbage the UI creates per graphics frame is pretty constant but the amount created by other code in KSP increases rapidly as the part count increases.  When you've only got a simple vessel, the UI might be causing a considerable fraction of the garbage and CPU usage but when you get up to a few hundred parts or more and the game is rendering far fewer frames per second it is much less significant.

Sure, but it depends on the complexity of the UI. MJ is a real nightmare in memory use and the "complex" layout also eats a lot of CPU. Last time I did some profiling MJ used more than 20% of the CPU and whole MB of memory per frame for the UI only with half of MJ windows open. Most mods don't come near that and may not have to consider the new UI, at least until something make it way easier. I am not saying that everyone should convert, just that some mods could benefits from it. Mine more than most.

And we are yet to see how the part count impact the memory use in 1.1. I doubt the only improvement will come from the UI.

 

25 minutes ago, Ziw said:

Will this help? http://docs.unity3d.com/ScriptReference/UI.DefaultControls.html

It is not much, but at least it handles the creation of basic controls for you, all you need after is position and tweak them to your liking.

 

Also I do remember somebody at Squad mentioning that they will provide modders with access to some UI library they made for themselves, but it was a LONG time ago, back in September or something like that.

Those calls are heavily dependent on asset bundle loading. I would rather have something that does not require them.

And yes, they said that. But there was not much news since and they may had higher priority to handle.

Link to comment
Share on other sites

4 minutes ago, sarbian said:

Those calls are heavily dependent on asset bundle loading. I would rather have something that does not require them.

Hmm, are you sure? Here's the source code of DefaultControls:

https://bitbucket.org/Unity-Technologies/ui/src/b5f9aae6ff7c2c63a521a1cb8b3e3da6939b191b/UnityEngine.UI/UI/Core/DefaultControls.cs?at=5.3&fileviewer=file-view-default

There is nothing there about asset bundles at all.

Link to comment
Share on other sites

Each of those need a Resources. A resource is an Unity asset that is present in the game asset folder or loaded at runtime from an AssetBundle.

I looked at all this when 1.0 got out and the new UI was available. It's not exactly a new subject for me :)

 

Edit : of course the source of those is a great start point for a lib. As the Unity UI extension  repo

Edited by sarbian
Link to comment
Share on other sites

6 minutes ago, sarbian said:

Each of those need a Resources. A resource is an Unity asset that is present in the game asset folder or loaded at runtime from an AssetBundle.

I looked at all this when 1.0 got out and the new UI was available. It's not exactly a new subject for me :)

There is a bug in documentation, it actually uses this Resources (you can check the source code for proof)

http://docs.unity3d.com/ScriptReference/UI.DefaultControls.Resources.html

 

public struct Resources
{
  public Sprite standard;
  public Sprite background;
  public Sprite inputField;
  public Sprite knob;
  public Sprite checkmark;
  public Sprite dropdown;
  public Sprite mask;
}

 

Edited by Ziw
Link to comment
Share on other sites

Better but those calls are still a fraction if what is needed. And after you used those you still need to provide all the layout info and this uses a lot of lines. Look at DMagic code for 1 simple button or text component.

And we/I needs a canvas framework, drag-able windows, combo box, accordion dialog, editable number fields, the list goes on. Some are readily available but other need to be created. And I guess that no everyone will want his UI look the same so that's more boilerplate code.

Link to comment
Share on other sites

25 minutes ago, sarbian said:

Better but those calls are still a fraction if what is needed. And after you used those you still need to provide all the layout info and this uses a lot of lines. Look at DMagic code for 1 simple button or text component.

And we/I needs a canvas framework, drag-able windows, combo box, accordion dialog, editable number fields, the list goes on. Some are readily available but other need to be created. And I guess that no everyone will want his UI look the same so that's more boilerplate code.

Well, I hope someone (like TriggerAu) starts the library. I'll try to contribute as much as I could, and these DefaultControls could be the building blocks for this library. Our mods (IR, Sequencer) involve a lot of UI elements, so need that as well, although we might use the AssetBundle solution to load some UI prefabs.

As for Layout (like the analogue of the old GuiLayout) - I'm going to try creating new http://docs.unity3d.com/Manual/UIAutoLayout.html from code, as far as I understand you need to add some components to your UI elements (like http://docs.unity3d.com/ScriptReference/UI.LayoutElement.html and http://docs.unity3d.com/ScriptReference/UI.HorizontalLayoutGroup.html) and let Unity arrange the items for you.

Link to comment
Share on other sites

So, if I am reading this correctly, the blasted little freeze every few seconds while Mono cleans up its trash needlessly frees memory might be mitigated or go away if everyone switched to the new UI system?!

I have something new to pester modders about! :>

Link to comment
Share on other sites

14 hours ago, Nertea said:

My policy is that mod update time ~ x + (time factor) * (number of people who ask), where time factor is proportional to frequency of being asked and x is unknown.

So I'm not the only one that delays things the more people ask for them? I'm not even planning on doing Apollo and Saturn at this point anymore.

Link to comment
Share on other sites

4 hours ago, CobaltWolf said:

So I'm not the only one that delays things the more people ask for them? I'm not even planning on doing Apollo and Saturn at this point anymore.

So we can expect an update that includes Apollo & Saturn, very Soon™, correct?

.

.

.

.

JUST KIDDING!!!... LOL :D

Link to comment
Share on other sites

6 hours ago, DuoDex said:

So, if I am reading this correctly, the blasted little freeze every few seconds while Mono cleans up its trash needlessly frees memory might be mitigated or go away if everyone switched to the new UI system?!

While it would improve some, there is a lot of other core KSP code (and non-UI code in mods) that creates excessive garbage so it certainly won't go away...

Link to comment
Share on other sites

On 25-2-2016 at 2:29 PM, omelaw said:

Well, I expect mods made by squad dev will be updated earlier then others (because they saw code and already know what exactly changed in 1.1)

maybe a week later after update?

It depend on both the complexity of the mod itself and the willingness of SQUAD to cooperate with the Mod developers. From past experience, support for the modding community is very limmited to  horrible. It would realy help if there was some decent documentation. Now we have to learn everything by trail and error, which is not very efficient. If only there would have been some decent documentation and we would have been able to accomplish so much more.

Edited by FreeThinker
Link to comment
Share on other sites

9 hours ago, DuoDex said:

So, if I am reading this correctly, the blasted little freeze every few seconds while Mono cleans up its trash needlessly frees memory might be mitigated or go away if everyone switched to the new UI system?!

I have something new to pester modders about! :>

Go away is unlikely. More spaced maybe. Padishar is perfectly right, the UI is only part of the problem and using memory is more or less required. The bad thing is wasting it.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...