I think Celestia needs some serious UI help
-
- Developer
- Posts: 944
- Joined: 18.07.2002
- With us: 22 years 3 months
- Location: Lyon (France)
-
- Site Admin
- Posts: 4211
- Joined: 28.01.2002
- With us: 22 years 9 months
- Location: Seattle, Washington, USA
Paolo wrote:In fact I haven't seen any reference in the roadmap before the 2.0 release: ... "major UI updates"
But you and Chris in the past didn't get very high priority to this task?
Developing a new cross-platform user interface is a high priority. There are features that Celestia needs that are UI intensive, such as some sort of add-on manager. I fear that this would be a very inefficient use of developers' time to implement such a feature on all supported platforms. I'm doing my own investigations into Qt, but I won't actually start writing code without coordinating with Christophe and the other devs (and of course, not before finishing 1.5.0.)
--Chris
chris wrote:I'm doing my own investigations into Qt, but I won't actually start writing code without coordinating with Christophe and the other devs (and of course, not before finishing 1.5.0.)
Has anybody looked at wxWidgets?
- Hank
Paolo wrote:I still would like to see some sort of simple and effective GL UI in pure videogames style. E.g. the Stellarium one.
Vincent's Lua Edu Tools uses a cross-platform GUI based on Lua and OpenGL (which are already built into Celestia). The toolkit is fairly primitive, but nicely demonstrates the possibilities of the approach. One problem is that it uses the Lua hook mechanism, which is rather cumbersome. I've done some experiments with a more direct approach for a Lua-based GUI, and the results seemed promising. Here's a brief exaplantion of what I did:
First, I modified the Celestia application's main program to look for a new command line option specifying a Lua source file. If the new option is not present, Celestia simply proceeds as usual using the current platform-specific GUI. If the new command line option is present, Celestia loads the specified Lua source file and executes it as the Celestia main program. In the latter case, the platform-specific GUI is simply ignored.
A nice thing about this approach is that it allows a Lua GUI to coexist as a single executable with the current platform-specific GUI. It also allows multiple different Lua GUIs to be used with the same executable for GUI experimentation and customization. Since the complete application interface is defined via Lua, this approach can be used to implement fully customized Celestia-related applications.
To provide basic OpenGL window and event-handling support, I used a light-weight open-source framework called glfw (http://glfw.sourceforge.net). I wrote a simple Lua wrapper for glfw so it could be used from the Lua main program via a dynamically-loaded module. I built a similar Lua wrapper for the Celestia core, so that the Lua main program could create and initialize the Celestia core and drive the main event/rendering loop in much the same way this is currently done by the platform-specific versions of Celestia.
In the Lua main program I installed the Lua Edu Tools code, and in the event handler I forwarded events to the Lua Edu Tools hook handler using the exisiting hook protocol. This allowed the existing Lua Edu Tools GUI to run directly from the Celestia main event loop. In addition to the Lua Edu Tools GUI, it was fairly trivial to implement the standard key commands and mouse actions via calls to the Celestia core. Much of the basic Celestia functionality is accessible in this way.
A more robust toolkit would obviously be needed for a serious implementation with this approach, but conceivably something based on the Stellarium code (or CELUI?) or a Lua wrapper for Qt or wxWidgets would be possible.
- Hank
-
- Developer
- Posts: 3776
- Joined: 04.02.2005
- With us: 19 years 9 months
-
- Developer
- Posts: 1356
- Joined: 07.01.2005
- With us: 19 years 10 months
- Location: Nancy, France
Hank,
One thing I'd like to have is the ability from Lua to get the coordinates of the cursor on the viewport. This would add some interesting features to the Lua Edu Tools, like displaying the RA/Dec coordinates while user moves the cursor when in planetarium mode, or bringing up the toolbox when the cursor reaches the right hand side of the viewport, etc. This can be done by adding a new Lua Hook in the mouseMove method of Celestiacore. But as you pointed out, this would be quite heavy since tracking the mouse movement is far more costly than tracking a mouse-click event.
Would your new approach allow this kind of feature without being too costly for the Celestia main engine ?
One thing I'd like to have is the ability from Lua to get the coordinates of the cursor on the viewport. This would add some interesting features to the Lua Edu Tools, like displaying the RA/Dec coordinates while user moves the cursor when in planetarium mode, or bringing up the toolbox when the cursor reaches the right hand side of the viewport, etc. This can be done by adding a new Lua Hook in the mouseMove method of Celestiacore. But as you pointed out, this would be quite heavy since tracking the mouse movement is far more costly than tracking a mouse-click event.
Would your new approach allow this kind of feature without being too costly for the Celestia main engine ?
Last edited by Vincent on 04.11.2007, 21:47, edited 1 time in total.
@+
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
-
- Developer
- Posts: 3776
- Joined: 04.02.2005
- With us: 19 years 9 months
hank wrote:Have you tried Vincent's Lua Edu Tools? My test looks essentially the same (as it uses the Lua Edu Tools code).ElChristou wrote:hank wrote:...I've done some experiments with a more direct approach for a Lua-based GUI, and the results seemed promising...
No way to have a look to this test?
- Hank
But without the platform specific GUI, right?
-
- Developer
- Posts: 3776
- Joined: 04.02.2005
- With us: 19 years 9 months
-
- Developer
- Posts: 3776
- Joined: 04.02.2005
- With us: 19 years 9 months
hank wrote:I don't believe the Lua Edu Tools have had any substantial performance optimization. I ignored performance entirely in my test.ElChristou wrote:As the Edu tool do have a light impact on the FPS, I was wondering if it was the same under your test...
- Hank
Hummm... you are saying that the actual Edu Tool could be optimized? Vincent, any idea about this?
The performance is an important issue.
I am obsessed by performance in all my projects. I know that is wrong in principle because a software first of all has to work.
In my vision I would like that celestiacore should expose functionality through a very well structured interface usable by LUA scripts and by a cross platform UI interface.
But this interface has to be clean and complete.
On the other side IMHO an integrated GL UI should solve partially the problem because should be integraded as part of the celestiacore interface and so extremely performant and exposed to LUA for further customization.
I am obsessed by performance in all my projects. I know that is wrong in principle because a software first of all has to work.
In my vision I would like that celestiacore should expose functionality through a very well structured interface usable by LUA scripts and by a cross platform UI interface.
But this interface has to be clean and complete.
On the other side IMHO an integrated GL UI should solve partially the problem because should be integraded as part of the celestiacore interface and so extremely performant and exposed to LUA for further customization.
Of course performance is important, but it's usually a mistake to focus on performance prematurely.Paolo wrote:The performance is an important issue. I am obsessed by performance in all my projects. I know that is wrong in principle because a software first of all has to work.
I think Celestia is already very close to this.Paolo wrote:In my vision I would like that celestiacore should expose functionality through a very well structured interface usable by LUA scripts and by a cross platform UI interface. But this interface has to be clean and complete.
Paolo wrote:On the other side IMHO an integrated GL UI should solve partially the problem because should be integraded as part of the celestiacore interface and so extremely performant and exposed to LUA for further customization.
By definition I wouldn't consider the GUI itself as a part of the "core". However, a standard C++ GUI could be used in the Celestia application if it makes sense to do so. A C++ GUI toolkit could be used with either a C++ or a Lua GUI.
- Hank
dirkpitt wrote:Hank, which parts of the Celestia UI are you considering suitable for "Lua Hookification"? Which parts are you thinking would make more sense as a C++ GUI? (Qt?)
As described above, my recent experiment doesn't use the Lua Hook mechanism in Celestia as such, but rather implements the main event loop directy in Lua. I used the hook protocol to drive the Lua Edu Tools GUI for demonstration purposes because that code was readily available. A simple Lua/OpenGL toolkit such as used by the Lua Edu Tools is only one possible approach to a Lua-based GUI. It should also be possible to write Lua wrappers for the Qt or wxWidget (or CELUI or Stellarium) toolkits so they could be used from Lua. The Lua wrappers could expose the toolkit APIs directly, or they might provide a simplified API that could in principle be layered on top of different underlying toolkits. Regardless of what toolkit might be used, I would personally like to see the entire application GUI implemented via Lua, so that it can be modified without platform-dependent recompilation.
- Hank