Another GUI for Unity? SQUID is coming to the asset store

Squid.Unity Open Beta announced: http://forum.unity3d.com/threads/159306-SQUID-Beta-GUI-System

Hello fellow Unity nerds,

i’m Chris, the developer of SQUID (http://www.ionstar.org/?p=111).

Squid is an engine agnostic GUI library for realtime 2D/3D applications with a truckload of features.
Squid is blazingly fast: it draws the whole GUI in a single draw call, if you merged your textures the right way.

We have just successfully tested Squid running in Unity, on several platforms (Windows, Mac, IOS)
and are now contemplating the idea to put it on the Asset store.

Since Unity 3.5 is supposed to bring a completely new built-in GUI, but there is no more information about it since, i’m wondering how much interest there is in the community for another (really feature rich, fast and stable) GUI solution.

Screenshot of Squid example skin and layout:

A little feature overview:

  • Fully skinnable (you can even switch between different skins at runtime)
  • Scale9 texture slicing. (yes you can have pixel perfect round corners without distortion)
  • Retained mode (Unity GUI is immediate. Squid is retained. Think Windows.Forms)
  • Docking, Anchoring with Margin and Padding
  • Hierarchical opacity, Z-Ordering, Scissoring (no hardware scissor, no render state changes)
  • Custom mouse cursors (can be animated too)
  • Tooltips, Dropdowns, Modality Queue (modal dialogs and dropdowns)
  • Full control over rendering. Full control over scissoring and batching.
  • BBCode markup support including clickable links (Squid.Label)
  • Supports arbitrary control shapes via texture masking (8bit collision mask)
  • Fully interactable in 3D (slap a GUI on any mesh and interact with it)
  • Easily extendable. Squid was specifically designed to be an SDK. That means you can easily create your own custom controls.
  • built-in animation system using coroutines/fibers. same pattern as in unity. see code example below.

What does retained mode mean?

I noticed some confusion about the term “retained mode” on these forums and i think it’s helpful to make this a bit clearer.
Retained mode does not mean there is only 1 draw call. It also does not mean the GUI uses a “dirty rect” pattern to only draw recently changed parts of your GUI.

Ok, so what is retained mode?

The terms immediate and retained do NOT describe how the GUI is drawn, but how you interact with it in code. In an immediate system, you get immediate response from a button (bool result = GUI.Button). In a retained system, the button is created once and remains in the object model until chose to remove it. Interaction is handled via events and delegates.

Even in an immediate system the actual drawing is deferred until the very end of your GUI instructions. This makes a lot of sense, because you still want to be able to batch, use software or hardware scissor and possibly crank everything into a single draw call.

Restrictions:

It is not possible to rotate GUI elements. In Squid, each and every GUI element is a rectangle, but don’t fret, they can still have any shape you like. Defined by your textures and collision masking.

Things to come:

I’m happy to announce that Squid will come with a full WYSIWYG editor inside Unity!
No external tools! You select your GameObject and start designing your GUI right in the scene view. More about this later - i’ll provide some screenshots and maybe a video asap.

A simplified code example:

private Desktop MyDesktop;
private Button MyButton;

void Start()
{
    MyButton  = new Button();
    MyButton.Size = new Point(100, 20);
    MyButton.Position = new Point (100, 100);
    // MyButton.OnMouseClick += delegate(Control sender) { do something };

    MyDesktop  = new Desktop();
    MyDesktop.Size = new Size(800, 600);
    MyDesktop.Controls.Add(MyButton);

    // use animation (milliseconds)
    MyButton.Animation.Size(new Point(100, 100), 500);

    // use custom animation routines
    MyButton.Animation.Animate(IEnumerator myRoutine);
}

void OnPostRender()
{
    MyDesktop.Update(); 
    MyDesktop.Render();
    // all rendering will now be routed through GuiRenderer.cs
    // you dont have to touch a single line of code to integrate it.
}

I would appreciate any type of feedback and be happy to answer all questions.
Thanks for your time and opinions,
Chris

P.S.: My apologies to the iGUI folks. The poll should say “iGUI”, not “oGUI”.

Looks interesting. Would love to see some more info on your site.

Looks pretty awesome. I’m curious to know how does this integrate into Unity?

It seems like you guys have written your own rendering system, that is cross-engine compatible. So I assume a Unity integration of this wouldn’t be like your standard 3rd party Unity GUI plugin, where they typically create the UI elements as 3D Objects in the actual scene. But I assume something else? Would your plugin draw the UI elements to the framebuffer itself? Would it do this through the Graphics class in unity or something else?

First off, thanks for your interest.

"It seems like you guys have written your own rendering system, that is cross-engine compatible. "

Squid doesn’t render anything at all, it just notifies your engine to do so. The integration is done by implementing a single interface (ISquidRenderer). That renderer class then takes care of drawing things, scissoring, batching.

“a Unity integration of this wouldn’t be like your standard 3rd party Unity GUI plugin, where they typically create the UI elements as 3D Objects in the actual scene.”

That’s correct. The GUI elements are not Components, but live outside the typical Unity code paradigm. If you’ve ever used something like WindowsForms, GTK or QT you will immediately feel comfortable with Squid.

“Would your plugin draw the UI elements to the framebuffer itself? Would it do this through the Graphics class in unity or something else?”

The current Unity renderer implementation uses GL quads, but it can be done via DrawMeshNow too. We’ll probably offer both variations. Drawing to frame buffer AND to render surface both works the same way. You attach a very simple component to any camera and have it render.

In practical terms:
Squid.Unity consists of 4 files: GuiBatch.cs, GuiRenderer.cs, BitmapFont.cs and Squid.dll (107kb)

Looks very promising. A couple of questions though.

What kind of license would you distribute it with?
What would it cost?
Would there be an option to obtain the source (for a higher price)?
Is there a way to map input manually to Squid or is that hidden from the programmer?

At first glance it seems really awesome, but Im always a bit skeptical about third party closed source software.

“What kind of license would you distribute it with?”
Usually Squid requires a license per seat and product. However, we are considering a lighter license for Unity. Squid is already available free for non-commercial use, outside of Unity Asset Store. (http://www.ionstar.org/?page_id=10)

“What would it cost?”
Somewhere between 99$ and 199$ for the closed source license.

“Would there be an option to obtain the source (for a higher price)?”
Yes, this is possible. There is no standard source license, instead we talk to you and find the best deal for both sides.

“Is there a way to map input manually to Squid or is that hidden from the programmer?”
Absolutely yes. All input is transparently fed to Squid by you.

How efficient is it in terms of garbage generation?

There are no memory leaks in Squid.
I’m not sure how else to answer this. :slight_smile: - Can you elaborate or is this the answer you were looking for?

Well, “memory leaks” are pretty difficult to pull off in a managed environment. I’m sorry I wasn’t clear, but I’m talking about memory allocation. Once the engine hits steady-state, how many bytes (if any) are allocated per frame. Lots of allocations lead to GC collections which cause pretty noticeable spikes on low-end hardware. The native unity ‘OnGUI’ implementation is absolutely horrific in this regard.

Heya,

Squid creates UI’s from code? Really? I keep thinking we’re past the days of building UI’s by hand. Sure, I want to manipulate, control, and edit via code, but I don’t want to build the whole UI by hand!

“But, wait!” You say, 'We’re building a WYSIWYG editor!"

And what does it do under the covers? It builds code for you! Egads! That is so 90’s - like, crank up some Nirvana and we can all design Grunge UI’s. I want your editor to work directly in Unity - create real Unity objects that I can see and interact with. Don’t play make-believe to my face and then spit out a bunch of C# classes behind my back.

Gigi.

Have you read the Unity license? Most Unity plugins are 1 seat = whole organization. You are crazy if you think you can charge per developer. Might want to learn more about your audience.

You are hoping to charge extra for source code? LULZ. Good luck with that.

Gigi.

WTF are you talking about? Pretty much every WYSISWYG editor spits out “code,” including the ones built in Unity.

And whats wrong with charging for source code? There are plenty of Unity plugins that are closed source. LULZ.

Thanks for your response Gigi, i take all of that into consideration.

“In Squid you create UI with code.”
I agree that it’s more convenient to build a GUI visually and still be able to manipulate it from code.
However, since coding is what you do in Unity all the time i think “UI from code” is still a very viable approach, with or without a visual editor.

"And what does it do under the covers? It builds code for you! "
The editor uses XML - code generation is an optional feature.
You can chose to use either of them.

" You are crazy if you think you can charge per developer."
Sorry if it came across like we planned to apply the same license as stated on our webpage.
We haven’t decided anything license wise yet.
So thanks for the feedback, it’s much appreciated.

“You are hoping to charge extra for source code?”
I’m hoping that the API itself it totally sufficient and you won’t need access to the source code.
Yes, if it is absolutely necessary for you to have it, we do charge extra.
And frankly, there is nothing weird about it.

you should just not post if you don’t read the license and break law.
the licenses sold on Asset Store are per developer as a matter of facts, there is no asset licensed ‘per site’ as you describe it unless illegally spread within the organization and I wish any dev a slow painfull going out of business who thinks piracy is fine if it is for him but not when it is against him, cause thats lame, broken ethics.

A very valid concern, and i see where you’re coming from with the OnGUI comment.
There are only a handful of structs (Point, Rectangle, Margin, UVCoords) allocated per-control-per-frame.
Not a single reference type is allocated per-frame, so there’s nothing to worry about for the GC.
Squid is very lightweight, a GUI will spend the most frametime in the renderer implementation (and that’s where you decide what to allocate)

I hope this answers your question.

P.S.: In fact i’ll be testing this and get back to you with numbers, possibly a blog. Thanks!

This could be very interesting, but in reality I think most people may wait until 3.5 is released to see what the UT offering is. If for some reason the new 3.5 GUI lacks something, is inflexible, or buggy, then there is a market for what you are doing.

I noticed you have Squid.dll. How does this fit with say the Mac deployment? Does this also mean you’ve implemented custom hardware cursor support (praying)? If you have, and 3.5 doesn’t implement this, you’ve got a sale waiting right here. Or is it still frame-rate bound, and therefore prone to lag?

Personally I prefer to code my GUI.

Have you considered offering a functionally limited trial download so we can evaluate it before purchasing? I’m always nervous about using other people’s code because quite often it sucks balls when you start using it seriously and realise its not been properly tested. Not only would this encourage me to evaluate, I’d probably pay more for it knowing it met our requirements.

As other people have said, the biggest hold up for me is, what is coming from UT themselves?

They have stated the new GUI system will be a retained mode system as well. There will be a visual editor, and it will all be easily animatable.

Your offering seems to be one of the best I’ve seen but, it may not offer much over Unity’s new builtin GUI system.

As a fellow dev i completely understand what you’re saying right there and getting feedback like this was the sole reason i opened this thread. Yes, we will offer a trial of some sort. I totally hear you.

Squid.dll only uses System/System.Xml and is embedded as a Unity Asset - Mac and iOS deployment “just works”.

Hardware cursor - we cannot support it since Squid is only a black box.
Squid doesn’t know about any hardware or engine, so there’s nothing to grab a cursor from.
Instead you feed all input to Squid, so a laggy mouse position is something you’d have to address on the engine end, outside of Squid.

Hm, that was a weird answer. Let me explain this further.
Squid draws a cursor for you. You can use it or disable it. You also feed the position of the cursor to Squid. So no, Squid does not change the hardware cursor. (edit: everything i could explain form here is probably clear as day to you)

Thanks again and keep the questions coming!

I would be interested if:

  1. It had a designer that was integrated into Unity, allowing easy editing of event code (like winforms, etc)
  2. Unity did not ship their GUI framework in 3.5, or if their new framework is worse than the old one.

They’ve been making noise like the new GUI framework might not ship in 3.5… So who knows.

See, theres a potential problem right there. By referencing System.Xml you include a part of the dot net framework that you don’t want when you are making an iOS build. Although it only adds a couple of megabytes to do so, those megabytes might be extremely important when you are targeting iOS because you usually want to get below the 20 meg limit for apps that can be downloaded via the mobile network.

By having access to the source code we could (Im guessing) easily replace the system xml with a more compact solution. Some people use TinyXml for example, I use my own code.
And this is why I always want a complete source when I get a external plugin, because there will almost always be something, albeit small, that I want to change/improve myself.

Now, I know how hard it can be to release the full source to something you’ve spent a lot of hard work on, but it’s the most useful option for many of us. You did mention that it might be available for an extra fee, I just hope that it wouldn’t be out of reach for us poor indie devs :stuck_out_tongue:

But other then that I will definitely try it once there is a Unity demo available! Looking forward to it :slight_smile: