Sign in to follow this  
dave

Unity IMGUI

Recommended Posts

I post here because the forums at Molly Rocket seem more dead than tank tops.

I'm looking into this for a second time and i really can't decide whether:

a) Everything i want to do with it is possible.
b) It's actually any more simple than a well written RMGUI.


To those of you here that have written a decent IMGUI, or have atleast attempted one, i'd like to know how you:

a) Implemented modal dialogs.
b) Implemented draggable windows.
c) How did you identify a control between frames? I don't think the user passing an ID in to each Do*() method is an acceptable solution.
d) Do you have a designer for it or is it all hand coded? In most cases not having a designer is not acceptable.
e) Did you notice any performance issues when doing multiple passes over the UI code. It has been suggested that to solve the modal problem you need to do an examination pass before the input pass in order to detect ahead of time that something is modal.
f) Did you find any performance issues with alot of widgets?
g) How did you persist state between frames?

It also appears that the Unity 3D Editor is written entirely in an IMGUI and it's certainly pretty complex and this is encouraging however im not sure i believe it to be true yet as running fraps gives a framerate only for the game window. Not sure why the rest of the Unity Editor ui doesnt have a framerate if it is indeed immediate.

IMGUI or RMGUI guys, i don't see the answer yet, what's your take?

Share this post


Link to post
Share on other sites
Personally I think the immediate mode gui is not sufficiently simpler to implement over a retained mode gui. Their implementations are mostly identical, except that with an immediate mode gui you define your gui with more implementation. Why not take the additional small step to store the parameters of the gui in some structure? It's not that much additional work. From that point it's only another small step to be able to define your gui outside of code. Edited by smr

Share this post


Link to post
Share on other sites

To my own surprise, it has been more than two years since I asked something about designing a GUI.
My efforts on IMGUI resulted in a total loss. At the end, I ran out of time and I had to go back to the legacy GUI system.
It appears to me that IMGUI hasn't delivered. Many people would object that IMGUI is just GUI as it has always have been on consoles. That might be the case but a generic system is a different thing from a specific system.
I am very worried about the fact unity is still noted as example two years later. I would expect something more.

My main concern is that IMGUI proponents appear to be selling on

  • IMGUI is easier
  • IMGUI is implicit
  • IMGUI can do everything RMGUI can

It appears to me that those, taken alone, are true statements. But I'm not really sold they are true at the same time.
Take for example "can do everything RMGUI can". No, it cannot. Examples in the thread I've linked. It can do so only if IDs are generated and this is non-trivial. Once you generate IDs, say goodbye to the "implicit" part of the discussion.
And, to be honest, after trying to implement it, even for a barebone system, I'm unsure it's really "easier".
Sure it's not going to plug with the usual workflow without some effort.

Personally, when I first read CEGUI documentation, there was so much emphasis on Lua at the time I had the impression in was a very important requirement. It isn't the case, and I'm now looking at a complete CEGUI integration. So everything about that is now irrelevant to me.

Share this post


Link to post
Share on other sites
Thanks for replying guys.

@smr - Yes i agree

@Krohm - Your thread there was one that i came across while researching this. As you say it's kinda surprising that for a technique that is supposedly so much better that there are still only very few (if not only one) commercial examples of it in use. I suffer the same problems as you did in that thread and i think it is clear that an RMGUI is the most suitable solution for me in my project.

I was actually scripting my IMGUI with Lua and to be honest that was quite powerful in itself, but it wasn't scalable.

Thanks,

Share this post


Link to post
Share on other sites
I think Zipster hit it spot on.

RMGUI's cater towards artists/designers at the front of the pipleline and programmers at the end. IMGUI is the exact opposite - programmers will implement the logical components of the gui and then can expose the data (layout, color, theme, etc) for artists/designers to tweak.

I suppose it really depends on the project/team you are working with. If your engineers are nothing more than code monkeys, and need specific requirements for everything they write, then RMGUI may be best suited. However, if the engineers are making more of the design decisions, and you just want to outsource your art, then IMGUI may be best suited.

To answer some of the OP questions:
a) I would implement modal dialogs as part of a layered screen system, and use multiple IMGUI objects. You can push and pop "screens" onto the stack and trap input to the top level. Typically though, IMGUI does not support overlapping widgets.

b) Draggable windows are implemented by returning the (x, y) position of the window out of the function, and using them as inputs for the next frame. The IMGUI will store the mouse drag information in it's internal state.

c) I don't think you can identify controls throughout a frame. All widgets are independent of eachother. I'm having trouble coming up with reasons why you need to identify a control with IMGUI.

d) As in the paragraph above, IMGUI is probably better suited for programmers at the beginning of the pipeline (i.e. hand coded), and then expose whatever data you need tweaked to the artists. Using a generic designer to be later implemented into the game by programmers doesn't really make sense to me with IMGUI. The IMGUI is tightly coupled to the code flow.

e) I don't have an answer.
f) I don't have an answer.

g) An IMGUI can store whatever data it needs between frames. Typically it stores a variety of IDs that reference to what widget is 'hot' or 'active'. The key point about IMGUI is that typically only one widget can be interacted with at a time, so storing state in every individual widget is a waste.

Share this post


Link to post
Share on other sites
[quote name='web383' timestamp='1354641986' post='5007136']
c) I don't think you can identify controls throughout a frame. All widgets are independent of eachother. I'm having trouble coming up with reasons why you need to identify a control with IMGUI.[/quote]Because you might need to associate a specific state with it. If the state is part of the model, that's no trouble (except the code needs to cater with this possibility). If the state is part of some external setting (such as skinning) the code has no way to deal with this. When scripting enters the picture the need for robust state association becomes a priority (as mis-guessing a control state association might violate some invariant).

Personally, after IMGUI, I looked at cocoa bindings and I found them quite more promising. Unfortunately, the amount of machinery required to make them work is scary.

Share this post


Link to post
Share on other sites
Thanks for the replies guys, i think given that there is still so much doubt over how some of the issues i mentioned might be solved im just going to revert back to a retained GUI. I know however is solved in there.

Share this post


Link to post
Share on other sites

Hello,

I stumbled on this topic while searching for the keyword. Recently released my ImGui implementation here fyi https://github.com/ocornut/imgui

On your questions,

 

" a) Implemented modal dialogs. "

 

That's not a really a problem for the low-level ImGui. My implementation allows to create any number of window - ImGui::Begin("window 1"): ImGui::End()

 

" b) Implemented draggable windows. "

 

The library context knows on which "window" you are adding widgets to and they are created relative to a window position. It draws windows sorted, allow you to move/resize them.

 

" c) How did you identify a control between frames? I don't think the user passing an ID in to each Do*() method is an acceptable solution. "

 

Controls typically have a string so you are already passing an ID.

Add an identifier stack (per-window+explicit push/pop) to resolve collisions in case of looping or recursing or opening node, it works really easily you rarely have to worry about identifiers.

 

" d) Do you have a designer for it or is it all hand coded? In most cases not having a designer is not acceptable. "

 

Mine is hand coded, a designer would defeat its purpose. Frankly I think UI designers are backward at least for the kind of things I am using it for. I can create a new tools in a matter of minutes, without even restarting my application (using modern C++ compiler with Edit&Continue or calling via a scripting language).

 

" e) Did you notice any performance issues when doing multiple passes over the UI code. It has been suggested that to solve the modal problem you need to do an examination pass before the input pass in order to detect ahead of time that something is modal. "

 

I am not doing multiple passes.

 

" f) Did you find any performance issues with alot of widgets? "

 

Performance are alright, we have pretty complex UI (data browsing, debugger) that gets created/updated/render in less than a millisecond - that include traversing source data.

" g) How did you persist state between frames? "

 

Via implicit ID. The library just track what it needs but that's very little.

 

To be clear, I agree it is harder to implement automatic layout in ImGui types of library. I just don't think automatic layout are actually that useful, it's very easy to achieve layout programatically. So my stance is to keep the ImGui very simple to use rather than clutter it with things liek half assed multi-pass attempt.

 

Been using it and team shipped games with it (PixelJunk Shooter 1/2, PixelJunk 4am, Tearaway). Still usiang it for subsequent pro and homebrew projects.

Edited by ocornut

Share this post


Link to post
Share on other sites

This is a pretty old topic, it's pretty unlikely that the original poster is still looking for answers to this -- thanks for adding the information for any future searchers who land on this though -- I'm closing this one, but if anyone stumbles upon this and has related questions please feel free to start a new topic.

 

//EDIT:  This is a topic that isn't discussed particularly frequently, and it seems this particular topic ranks pretty well on search engines, so I've changed my mind -- I'm going to leave it open for now in case anyone else wants to contribute.  An old topic being brought back from the dead really isn't harmful if new information is added, especially if it's one that is likely to be found in searches. smile.png

Edited by jbadams
Re-opening topic.

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

Sign in to follow this  

  • Forum Statistics

    • Total Topics
      627778
    • Total Posts
      2979026
  • Similar Content

    • By Ahrakeen
      Hello our team aare making the game Neo arcana a logical crisis. and w are presently searching for some graphics people to help with the models for the game.
      we are using the setting of urban arcana and the game will be a strategic roleplaying game. in so we are in need of help with the graphics.
      if you interested to aiding us with your skills let us know. we are presently working on the prologue with the aim of finishing the story of some of the things that happened back then.
      to set up the story for the main game itself where tim is now trying to regainw hat he has lost back then. And manuever in the strange world that is hidden beneath the surface of the city.
       
      We aim with the prologue done turning it into a demo to get funding . so i hope to get more help with this.
    • By Hacktion Architects
      Hey guys me and my team have made our first game! Would be awesome if you guys could download, play it and let us know what you think!

      3. 2. 1. GO! Fly through the local school grounds with three other drones vying for the fastest time. Racing past the football fields, weaving in between pillars and squeezing through tight corridors, in Drozone speed is everything.
      Race through checkpoints while keeping your eyes out for power ups that give you a big short burst of speed, but be careful not to lose control!
      And if you're having problems completing the course you will want to grab the shield power up to double your health.
      Pick your drone and start racing, will you be able to beat our fastest lap time?
      Trailer here:
      https://www.youtube.com/watch?v=tekETULy2Qk&feature=youtu.be
      Link to download:
      https://gamejolt.com/games/drozone/292176
      A game developed by a group of seven young indie devs, from Brisbane Australia, Drozone is focused on delivering the exhilaration of flying a drone in first person.
      The experience is built up around competition between players and seeing who can get the fastest time. Let us know what you’re fastest time is!
    • By Polycanic Studios

      Everybody's favorite hard hitting reality blood sport is back and is better than ever. Join your host Miss Midnight and enter the Graviators arena for a new and thrilling style of combat.
      Graviators is a 3rd person arena based brawler in which you can play online multiplayer and LAN multiplayer with up to 4 friends or test your skills in our single player mode. Choose your fighter, control your gravity and fight using each characters unique ranged and melee attacks. 

      Download now at: www.graviators.com or watch the Trailer
      Graviators is currently released but will be receiving updates to make improvements and fix any issues so please bear with us! If you want to know more about what we are up to, follow us here for regular devlogs or check out our Facebook or Twitter for updates. 
      If you want to get in contact with us, please feel free to comment here, polycanicstudios@gmail.com or send us a message on Facebook!
    • By INTwindwolf
      COMPANY AND THE PROJECT

      We are an indie game studio consisted of professional and friendly people. Additionally, we are a team of skilled artists and dedicated indie enthusiasts. Our current project is INT, developed on Unity Engine 5 for platforms Windows, Linux, and Mac.

      INT is a 3D Sci-fi RPG with a strong emphasis on story, role playing, and innovative RPG features such as randomized companions. The focus is on the journey through a war-torn world with fast-paced combat against hordes of enemies. The player must accomplish quests like a traditional RPG, complete objectives, and meet lively crew members who will aid in the player's survival. Throughout the game you can side and complete missions through criminal cartels, and the two major combatants, the UCE and ACP, of the Interstellar Civil War.
      Please note that all of our current positions are remote work. You will not be required to travel.
      For more information about us, follow the links listed below.
      INT Official website
      Steam Greenlight
      IndieDB page
      Also follow social media platforms for the latest news regarding our projects.
      Facebook
      Twitter
       
      TALENT NEEDED
      We are looking for an Animator to join the Art team to create and polish animations for the game. You will be collaborating with fellow members of the team, and follow instructions from the Project Lead and the Animation team Lead in crafting smooth, flowing animations.
      As an Animator for this project, your duties would include:
      Create rigs to be used for animations. Skin 3D models to rigs. Contribute to constructive team discussions. Attend regular team meetings.  
      REQUIREMENTS
      To be successful in this position, following requirements apply:
       
      Have working knowledge of 3D animation suites. Understand import/export requirements for Unity Engine integration. Excellent self-management skills. Excellent attention to detail. Excellent communication skills. Preferred requirement:
      Knowledge of the Unity Engine UMA character creation system would be an advantage.  
      REVENUE - SHARE
      This is the perfect opportunity to get into the game development industry. Being an Indie team we do not have the creative restrictions often imposed by publishers or other third parties. We are extremely conscientious of our work and continuously uphold a high level of quality throughout our project.
      We are unable to offer wages or per-item payments at this time. However revenue-sharing from crowd-funding is offered to team members who contribute 15-20 hours per week to company projects, as well as maintain constant communication and adhere to deadlines. Currently the crowd-funding campaign is scheduled for the year 2018. Your understanding is dearly appreciated.
       
      TO APPLY
      Please send your Cover Letter, CV, Portfolio (if applicable), and other relevant documents/information to this email: JohnHR@int-game.net
      Thank you for your time! We look forward to hearing from you!
      John Shen
      HR Lead
      Starboard Games LLC
    • By KARTHI
      Now I am making 2d game in my home. I am so confused with the resolution.
      Please anyone help me to choose the resolution
  • Popular Now