I think Celestia needs some serious UI help

General discussion about Celestia that doesn't fit into other forums.
Paolo
Posts: 502
Joined: 23.09.2002
With us: 22 years
Location: Pordenone/Italy

Post #21by Paolo » 03.11.2007, 18:53

Any news about the QT porting?? :oops:
Remember: Time always flows, it is the most precious thing that we have.
My Celestia - Celui

Christophe
Developer
Posts: 944
Joined: 18.07.2002
With us: 22 years 2 months
Location: Lyon (France)

Post #22by Christophe » 04.11.2007, 10:06

It's still on my agenda, although I've put it back a bit. I'm waiting for the KDE4 libs to stabilies, for the time being it's too much work keeping up with the svn.
Christophe

Paolo
Posts: 502
Joined: 23.09.2002
With us: 22 years
Location: Pordenone/Italy

Post #23by Paolo » 04.11.2007, 12:33

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?
Remember: Time always flows, it is the most precious thing that we have.

My Celestia - Celui

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 8 months
Location: Seattle, Washington, USA

Post #24by chris » 04.11.2007, 13:03

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

Paolo
Posts: 502
Joined: 23.09.2002
With us: 22 years
Location: Pordenone/Italy

Post #25by Paolo » 04.11.2007, 13:11

If requested I think that I can give some support in this implementation. So if it is a high priority task I suggest to rise it in the development roadmap.
Remember: Time always flows, it is the most precious thing that we have.

My Celestia - Celui

hank
Developer
Posts: 645
Joined: 03.02.2002
With us: 22 years 7 months
Location: Seattle, WA USA

Post #26by hank » 04.11.2007, 18:57

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
Posts: 502
Joined: 23.09.2002
With us: 22 years
Location: Pordenone/Italy

Post #27by Paolo » 04.11.2007, 19:27

I still would like to see some sort of simple and effective GL UI in pure videogames style. E.g. the Stellarium one.

But... QT rulez
Remember: Time always flows, it is the most precious thing that we have.

My Celestia - Celui

hank
Developer
Posts: 645
Joined: 03.02.2002
With us: 22 years 7 months
Location: Seattle, WA USA

Post #28by hank » 04.11.2007, 20:28

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

ElChristou
Developer
Posts: 3776
Joined: 04.02.2005
With us: 19 years 7 months

Post #29by ElChristou » 04.11.2007, 20:38

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? :P
Image

hank
Developer
Posts: 645
Joined: 03.02.2002
With us: 22 years 7 months
Location: Seattle, WA USA

Post #30by hank » 04.11.2007, 20:47

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? :P

Have you tried Vincent's Lua Edu Tools? My test looks essentially the same (as it uses the Lua Edu Tools code).

- Hank

Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 8 months
Location: Nancy, France

Post #31by Vincent » 04.11.2007, 21:35

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 ?
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

ElChristou
Developer
Posts: 3776
Joined: 04.02.2005
With us: 19 years 7 months

Post #32by ElChristou » 04.11.2007, 21:44

hank wrote:
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? :P
Have you tried Vincent's Lua Edu Tools? My test looks essentially the same (as it uses the Lua Edu Tools code).

- Hank


But without the platform specific GUI, right?
Image

hank
Developer
Posts: 645
Joined: 03.02.2002
With us: 22 years 7 months
Location: Seattle, WA USA

Post #33by hank » 04.11.2007, 22:26

ElChristou wrote:But without the platform specific GUI, right?

Right.

- Hank

ElChristou
Developer
Posts: 3776
Joined: 04.02.2005
With us: 19 years 7 months

Post #34by ElChristou » 04.11.2007, 22:52

hank wrote:
ElChristou wrote:But without the platform specific GUI, right?
Right.

- Hank


As the Edu tool do have a light impact on the FPS, I was wondering if it was the same under your test...
Image

hank
Developer
Posts: 645
Joined: 03.02.2002
With us: 22 years 7 months
Location: Seattle, WA USA

Post #35by hank » 04.11.2007, 23:26

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...

I don't believe the Lua Edu Tools have had any substantial performance optimization. I ignored performance entirely in my test.

- Hank

ElChristou
Developer
Posts: 3776
Joined: 04.02.2005
With us: 19 years 7 months

Post #36by ElChristou » 04.11.2007, 23:48

hank wrote:
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...
I don't believe the Lua Edu Tools have had any substantial performance optimization. I ignored performance entirely in my test.

- Hank


Hummm... you are saying that the actual Edu Tool could be optimized? Vincent, any idea about this?
Image

Paolo
Posts: 502
Joined: 23.09.2002
With us: 22 years
Location: Pordenone/Italy

Post #37by Paolo » 04.11.2007, 23:48

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.
Remember: Time always flows, it is the most precious thing that we have.

My Celestia - Celui

hank
Developer
Posts: 645
Joined: 03.02.2002
With us: 22 years 7 months
Location: Seattle, WA USA

Post #38by hank » 05.11.2007, 00:34

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.
Of course performance is important, but it's usually a mistake to focus on performance prematurely.

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.
I think Celestia is already very close to this.

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

Avatar
dirkpitt
Developer
Posts: 674
Joined: 24.10.2004
With us: 19 years 11 months

Post #39by dirkpitt » 05.11.2007, 00:59

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?)

hank
Developer
Posts: 645
Joined: 03.02.2002
With us: 22 years 7 months
Location: Seattle, WA USA

Post #40by hank » 05.11.2007, 03:04

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


Return to “Celestia Users”