Qt

The place to discuss creating, porting and modifying Celestia's source code.
Christophe
Developer
Posts: 944
Joined: 18.07.2002
With us: 22 years 2 months
Location: Lyon (France)

Post #21by Christophe » 26.02.2004, 16:59

t00fri wrote:Cygwin is using the latest Linux applications and is very stable. Compiling works well, including OpenGL. Still, this part is not yet entirely up-to-date and the performance is indeed slower. Also the compilation speed is definitely slower. It's quite fine for everyday work.


Yes OpenGL is supported under Cygwin but the QGLWidget from Qt may not be available yet.

I think one of the slowest thing in Cygwin is fork() since there is no native equivalent in Win32, a compilation with its many forks is heavily impacted. Running a uni-process application like Celestia may not be that bad.
Christophe

Topic author
marc
Posts: 426
Joined: 13.03.2002
With us: 22 years 6 months
Location: Outback Australia

Post #22by marc » 29.02.2004, 10:37

Thanks for the comments everyone, it has been really helpful. I will probably try a basic gui using both plib and Qt (also under cygwin), then let everyone know how I go in a few months or so.

Marc.

maxim
Posts: 1036
Joined: 13.11.2003
With us: 20 years 10 months
Location: N?rnberg, Germany

Post #23by maxim » 29.02.2004, 15:18

marc,
have you ever thought of including an (existing?) lean and fast browsers core into celestia, and then using it's capability for HTML, XML, CSS, Javascript, Flash, Plugins ... to build your GUI and action pages. I can think of several benefits for that view onto the problem.

maxim :)

Topic author
marc
Posts: 426
Joined: 13.03.2002
With us: 22 years 6 months
Location: Outback Australia

Post #24by marc » 29.02.2004, 23:10

This might be useful if I was using XML, but all data is stored in the database, or in human readable files that the database can read.
The gui will be interacting directly with the database.

What are the benefits you are thinking of?

maxim
Posts: 1036
Joined: 13.11.2003
With us: 20 years 10 months
Location: N?rnberg, Germany

Post #25by maxim » 01.03.2004, 18:24

- instant usage of plugins: embedding sound, speech, video or flash animations is just one line of code away.
- instant usage of scripting capabilities for complicated gui task - with javascript.
- fully independed gui developement:
--> work intensive gui design can be easily spreaded between several developers.
--> failures in newly developed gui pages don't interfere with other code.
--> easy design and replacement of multiple skins.
--> fast setup and testing of gui elements.
--> standartised page description language.
- instant network capabilities:
--> setting up a webserver on any machine could immediately create a common playground.
--> HTTP protocol is quite firewall resistant.
--> instant cross platform capable.
- rapid developement.

However, direct gui access of mySQL would then require a local webserver with PHP or Java support.
As I said - it's just another view onto the problem.

maxim :)
Last edited by maxim on 01.03.2004, 22:48, edited 1 time in total.

don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 2 months
Location: Colorado, USA (7000 ft)

Post #26by don » 01.03.2004, 20:44

maxim wrote:marc,
have you ever thought of including an (existing?) lean and fast browsers core into celestia, and then using it's capability for HTML, XML, CSS, Javascript, Flash, Plugins ...

Interesting you should bring this up. See... http://www.shatters.net/forum/viewtopic.php?t=4516 (A web-based Celestia).

Guest

Post #27by Guest » 02.03.2004, 01:44

I think your approach is more suited to a distributed business application rather than a standalone game. Im going to be very negative here so dont take any of it personally. :)

maxim wrote:- instant usage of plugins: embedding sound, speech, video or flash animations is just one line of code away.
Difficult to add positional information and doppler effects to audio. No need for flash, we have openGl.
- instant usage of scripting capabilities for complicated gui task - with javascript.
Better to have a widget set that has enough features so we don't need to prop it up with a scripting language. Besides we have a great scripting language. Lua.
- fully independed gui developement:
--> work intensive gui design can be easily spreaded between several developers.
The gui design is not work intensive, and should be done on paper. Implementing it can be done using gui designer tools. (plib only has a very simple one) It is the plumbing behind it that is the hard bit.
--> failures in newly developed gui pages don't interfere with other code.
And nothing fails at compile time, meaning more bugs get through to releases, and it is difficult to debug.
--> easy design and replacement of multiple skins.
both plib and Qt have customizable styles that can easily be applied to all components.
- instant network capabilities:
I am using an embedded mysql server, If i ever get to the stage of trying networking capabilities all I need to do is to move the relavent tables from the embedded server to a remote mysql server. The api for embedded and remote is the same. Actually doing something with the networking is something else all together.
--> setting up a webserver on any machine could immediately create a common playground.
--> HTTP protocol is quite firewall resistant.
HTTP is designed for sending webpages, not for networking games. (then again neither is mySQL)
--> instant cross platform capable.
I'm guessing, just add Mozilla Firefox.
- rapid developement.
Be careful of this buzzword, can also mean inflexible development..

maxim
Posts: 1036
Joined: 13.11.2003
With us: 20 years 10 months
Location: N?rnberg, Germany

Post #28by maxim » 03.03.2004, 13:44

Im going to be very negative here so dont take any of it personally. :)

No problem. Let's see what I can answer:

maxim wrote:
- instant usage of plugins: embedding sound, speech, video or flash animations is just one line of code away.

Difficult to add positional information and doppler effects to audio. No need for flash, we have openGl.
We are talking about the gui. Sound for non gui effects should be handled elsewhere of course. Flash is also meant for gui effects as animated buttons, transparency, morphing of gui elements, etc. - all those eyecandy things that are usefull in game design - will be hard work to implement this in native OpenGL.


Quote:
- instant usage of scripting capabilities for complicated gui task - with javascript.

Better to have a widget set that has enough features so we don't need to prop it up with a scripting language. Besides we have a great scripting language. Lua.
Don't mix up the scripting language for automating Celestia, and a script language for gui tasks. They're completely independent from each other. And I don't think that any widget set contains things as event handlers for mouse and keyboard events - that would be far above their use intentations. Using Javascript you can create, rearange, fill, hide, change, popup, etc. gui elements. you can handle freeform buttons and even imaged areas. You can combine a button with a sound and a lot of other things. Of course there are other ways to do those things - but with far more effort.

Of course, if you keep things simple, you won't need this interactivity, but that would make usage a little more dull.


Quote:
- fully independed gui developement:
--> work intensive gui design can be easily spreaded between several developers.

The gui design is not work intensive, and should be done on paper. Implementing it can be done using gui designer tools. (plib only has a very simple one) It is the plumbing behind it that is the hard bit.
A good gui design is almost as work intensive as creating the applications core. There is not only the basic design done on paper, but also the testing, and the merging. From the first paper design until an intuitive, fast and secure usable gui it's a long way. Splitting it up could be usefull. You may have set of gui panes for traveling, another one for trading, fighting, ship upgrade, ...


Quote:
--> failures in newly developed gui pages don't interfere with other code.

And nothing fails at compile time, meaning more bugs get through to releases, and it is difficult to debug.
Again, don't mix up two different task blocks. If your underlying gui handler (here the browser core) is stable, you won't have to deal with compile time errors here. As I said above, gui testing is cruical, and errors usually arise from bad design rather than failureous coding. They are logical errors, not syntactical ones. The debugging of core code and gui design/implementation are intependend from each other and can easily be handled from different persons. If your gui implementation is good, you won't have to touch it any more, even when updating your core code several times.


Quote:
--> easy design and replacement of multiple skins.

both plib and Qt have customizable styles that can easily be applied to all components.
I've thought of other people that like to modify your gui skin, because they have some design ideas, they are talented in that way or something else. They would just have to replace it, with no need for recompiling the whole code.


Quote:
- instant network capabilities:

I am using an embedded mysql server, If i ever get to the stage of trying networking capabilities all I need to do is to move the relavent tables from the embedded server to a remote mysql server. The api for embedded and remote is the same. Actually doing something with the networking is something else all together.
Of course accessing the sql server from local or remote doesn't mean the game itself is network capable.


Quote:
--> setting up a webserver on any machine could immediately create a common playground.
--> HTTP protocol is quite firewall resistant.

HTTP is designed for sending webpages, not for networking games. (then again neither is mySQL)
HTTP is used for many task, not only for web pages - as a tunneling protocol for VPNs for example, or for other tunneling tasks. If you need fast action respond for ego shooter games or similar, it is surely too slow. But for less time critical things as trading or general positioning of atavars it should be sufficient.


Quote:
--> instant cross platform capable.

I'm guessing, just add Mozilla Firefox.
It should work with any browsers core. HTML and Javascript are platform independend.
To my opinion the Gecko enginge (Mozilla rendering engine) is too huge with about 8MB. I was searching for some other canditates on the net, and found some quite lean an fast ones. But all lacked of some capabilities (no javascript, only HTML subset, ...), so actually I haven't found a real good usable core yet.


Quote:
- rapid developement.

Be careful of this buzzword, can also mean inflexible development..

I should have said 'rapid prototyping'. Quickly setting up a test situation, and then going throught possible paths, looking for straighforward usage and design holes.


maxim :)

adamnieman
Posts: 42
Joined: 20.10.2003
With us: 20 years 11 months
Location: Bristol, United Kingdom

Post #29by adamnieman » 05.03.2004, 16:42

marc, et al

In developing Welcome to the Neighbourhood, we decided to use an embedded browser to allow us to create the UI in html.

(see http://www.nestafuturelab.org/showcase/neighbourhood/neighbourhood_flyer.pdf for some rather dated information about WTTN)

Doing it this way was a pain in the bum, but the flexibility it gives us to respond quickly to feedback from users and to modify the app for new uses is enormously valuable. It also means that the development of the UI is now completely independent of the program itself. This, and extensive use of Lua scripting means we can make dramatic changes to the functionality without having to bother a programmer :)

Image

Here's how the program looks at the moment. With a bit more testing with users, I expect it to change dramatically - but it won't be a problem.

I expect that your needs are totally different and the embedded browser route will not be appropriate. However, others might like to know that it has worked well for us.

Adam

don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 2 months
Location: Colorado, USA (7000 ft)

Post #30by don » 05.03.2004, 19:39

That looks really nice Adam. What embeded browser are you using?

Mikeydude750
Posts: 169
Joined: 31.01.2002
With us: 22 years 8 months
Location: Wisconsin

Post #31by Mikeydude750 » 05.03.2004, 20:12

Very impressive. It's people like you who make Celestia one of the best projects out there.

Curious, but are you going to add a pane for information? Click on an information button, and a website containing information on the selected object could appear in another pane.

Rassilon
Posts: 1887
Joined: 29.01.2002
With us: 22 years 8 months
Location: Altair

Post #32by Rassilon » 05.03.2004, 20:19

Well things have changed since I downloaded Qt for windows...Luckily I got it when I did otherwise I would be either porting it to 100% windows or some other library...

As far as I know there is no evaluation on my download...Besides what I do is non-commercial...If Im not making money off thier code I cant see paying them for it...
I'm trying to teach the cavemen how to play scrabble, its uphill work. The only word they know is Uhh and they dont know how to spell it!

Topic author
marc
Posts: 426
Joined: 13.03.2002
With us: 22 years 6 months
Location: Outback Australia

Post #33by marc » 06.03.2004, 03:52

adamnieman wrote:marc, et al

In developing Welcome to the Neighbourhood, we decided to use an embedded browser to allow us to create the UI in html.

(see http://www.nestafuturelab.org/showcase/neighbourhood/neighbourhood_flyer.pdf for some rather dated information about WTTN)

Doing it this way was a pain in the bum, but the flexibility it gives us to respond quickly to feedback from users and to modify the app for new uses is enormously valuable. It also means that the development of the UI is now completely independent of the program itself. This, and extensive use of Lua scripting means we can make dramatic changes to the functionality without having to bother a programmer :)

Image

Here's how the program looks at the moment. With a bit more testing with users, I expect it to change dramatically - but it won't be a problem.

I expect that your needs are totally different and the embedded browser route will not be appropriate. However, others might like to know that it has worked well for us.

Adam

I also would like to know which browser core you used, is the source code available?

maxim
Posts: 1036
Joined: 13.11.2003
With us: 20 years 10 months
Location: N?rnberg, Germany

Post #34by maxim » 06.03.2004, 10:04

Adam,

having a look at your PDF paper, I must say I LIKE this. It's a combination of education and art in public places - something that is discussed here in germany for quite some time.

Would you mind sharing some of your experiences in that project with us?
The question of the browser core used still arose. I'm just curious if you used an open source (which?) or a proprietary solution. I'm guessing from the pics and your post, that you are displaying Celestia within the browser window, and that all UI Buttons are underlayed with small lua scripts, so that a button click lets Celestia act in a desired way.

I, currently, would really like to see Celestia with an embedded browser/HTML rendering enginge - only that I would set the dependency other way round - the browser window displayed as a pane inside Celestia. And having custom buttons connected with custom lua scriptlets would be a cute way of getting some more complex tasks to work - not only for educational purposes.

I also think that UI developement should be separated from core developement. There has been a thread recently (http://www.shatters.net/forum/viewtopic.php?t=4462&postdays=0&postorder=asc&start=29) that discussed the posibilities of implementing some sientific/astronomic instruments into celestia. Currently this would heavily involve core developers. Regarding the typical sensibility of even wellformed C/C++ code to changes (improvements as well as changes of developement environment), as can be seen in all days work of Celestia developement and other projects you might know yourself, it would be the start of a long hard road getting those features implemented.

With an embedded browser, it could be done by an addon developer, where the addon contains a set of HTML pages along with some javascript scripts, a set of lua scriptlets, the technical data sets, definition files and textures.

Well, hopefully this is only the start of a discussion. ;)

maxim :)

adamnieman
Posts: 42
Joined: 20.10.2003
With us: 20 years 11 months
Location: Bristol, United Kingdom

Post #35by adamnieman » 08.03.2004, 10:28

Hi don, maxim, Mikeydude750 and marc,

Thank you for your comments about WTTN. We can indeed add information about objects. Currently this is done with a 'what is this place like to visit' button. This opens a window that fills the screen. We also want to add a 'how do we know about this place' button (because this is very important for public understanding of science reasons). We are also planning a tour that takes people through basic astronomical concepts because there is a LOT of confusion out there about planets, stars, etc. It is easy to modify the interface for any purpose though.

Within the next few weeks I'm hoping to make the source code, scripts, html and documentation available. There are one or two issues to sort out before we 'go public'.

The embedded browser is Internet Explorer. We went this route because it was easy. I've cut and pasted the following from the documentation left by the project's programmer (who is known on these forums as Alexibu). First his 'How it Works Section' then his 'HTML Interface' section.

In case you are wondering what SignControl.dll is all about: WTTN uses Celestia both to display pretty pictures and to calculate coordinates for an LED sign that can be oriented much like a telescope to point at the selected object (and which displays the changing distance).

--- snip ---

Execution mode
There is only really one thread in WTTN. The Web Browser Active X controls have separate threads, which means that web based animations etc should run relatively independantly to the rest of WTTN, but the extra threads shouldn't be of concern because interactions between these ActiveX controls and Welcome.exe will all be syncronised.

Processor time in WTTN
The celestia model is run by ticking the simulation from idle events from the Welcome.exe event handler.
SignControl.dll is ticked using a message timer from Welcome.exe, however if required it shouldn't be too hard to make another thread in SignControl.dll without altering its interface.

Welcome.exe
Shows a full screen dialog which can only be exited with Alt-F4, this dialog consists of an OpenGL context which is rendered by the celestia renderer, and two Web Browser controls in which the rest of the interface is implemented.
The webbrowser controls interact with Welcome.exe by Welcome.exe intercepting and decoding special URLs by using BeforeNavigate events from the Web Browser controls.
These events can make Welcome.exe show a full screen web browser, or run a script in celestia and point the sign etc. Parameters are loaded at run time from Welcome.ini.

CoreWrapper.dll
Wraps the celestia core, which is driven by idle time. It can run scripts and render OpenGL views of the universe.

SignControl.dll
Provides an interface to sign hardware which for the initial prototype consists of two serial protocols - one to talk to the LED display and one to control the telescope base. Parameters are loaded at run time from SignControl.dll.ini

HTML interface for WTTN
A HTML based interface was chosen for WTTN because this allowed the interface to be developed quickly and easily using web tools. It also allows contuing refinement and additions to the interface without needing to recompile the application itself.

To make the HTML pages able to communicate with the WTTN application from within the embedded web browser controls, a special URL based protocol was devised. At the moment all communication is one way. Web pages can tell the WTTN application what to do but the WTTN application can't tell the webpages any state information etc.
When the HTML document is navigated to a URL beginning with "wttn:///" this URL is interpreted by the WTTN application and the appropriate action is performed.
All html pages are loaded from the "html" directory in the working directory and all scripts are loaded from the "scripts" directory in the working directory.

Non WTTN URLs
Normal relative URLs are handled as normal. Absolute http:// style URLs are disabled.

"wttn:///" URL based protocol
wttn:///object.celx
This makes the sign to point to "object" and "object.celx" to be run in celestia. "object" should be an object in celestia so that it's position can be found and the sign pointing parameters calculated. "object" is also recorded for use when a ButtonHow.Click or ButtonVisit.Click is received.

wttn:///page.html
This makes a web browser fill the screen with "html/page.html" relative to the working directory. "page.html" should have a close button on it to allow the user to return to the main interface. If "page.html" doesn't exist then "defaultpage.html" is loaded.

wttn:///ButtonClose.Click
If this is received from a page in the full screen web browser, the full screen web browser is closed and the user returns to the main interface.

wttn:///ButtonClose.Click
If this is received from a page in the full screen web browser, the full screen web browser is closed and the user returns to the main interface.

wttn:///Button[ButtonName].[Event]
Other button events that are interpreted are :
ButtonFasterTime.Click - Increases the speed of time by a factor of 1000 and then 10
ButtonSlowerTime.Click - Decreases the speed of time by a factor of 10.
ButtonRealTime.Click - Sets the speed of time to normal.
ButtonWhere.Click - runs a script called "objectwhere.celx" where "object" is the name of the last object selected.
ButtonVisit.Click - loads a page called "objectvisit.html" where "object" is the name of the last object selected.
ButtonHow.Click - loads a page called "objecthow.html" where "object" is the name of the last object selected.
ButtonNow.Click - Sets time to now.
ButtonForward.Down - up down events from geographic rotate and zoom controls.
ButtonForward.Up
ButtonBackward.Down
ButtonBackward.Up
ButtonUp.Down
ButtonUp.Up
ButtonDown.Down
ButtonDown.Up
ButtonLeft.Down
ButtonLeft.Up
ButtonRight.Down
ButtonRight.Up
NearestAsteroid - Locates the nearest asteroid for example "eros". Writes "eros" to "nearest.txt" file. Runs "nearestobject.celx" which examines "nearest.txt". If the user subsequntly presses ButtonHow or ButtonVisit, then "eroshow.html" or "erosvisit.html" is loaded, if this page doesn't exist, "asteriodhow.html" or "asteroidvisit.html" is loaded. If this doesn't exist then the default page is loaded.
NearestPlanet - Locates the nearest non earth planet and proceeds as for NearestAsteroid.
NearestSatellite - Locates the nearest satellite (spacecraft in celestia).
NearestMoon - Locates the nearest moon. Aways earth/moon (we hope).
NearestComet - Locates the nearest comet.

wttn:///UserInit
This is sent to indicate that a new user has started for the log file.

wttn:///Command:page=[page.html]&script=[script.celx]&target=[object]
This command loads "page.html", runs "script.celx" and points the sign at "target". All of the three arguments are optional and can be in any order.

wttn:///[Show/Hide][Orbit|Label|Object]:[obitname|labelname|objectname] & another one
This command allows render and orbit and label flags to be switched on and off. e.g. "wttn:///ShowLabel:moons&ShowOrbit:planets&HideObject:constellations". The names of the flags are the same as in the corresponding functions in the LUA scripting interface.

don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 2 months
Location: Colorado, USA (7000 ft)

Post #36by don » 08.03.2004, 20:11

Howdy Adam,

WOW! 8O

Your project has really come a long way! It sounds great!

Is this something you are considering releasing to an open source home such as SourceForge, for additional development / assistance? Or just releasing as a set of DLLs and EXEs?

Will you also be releasing a set of Kiosk plans, so that highschool workshops (metal, woodworking, etc.) would be able to help build the Kiosk when a suitable computer system is provided? I can see something like this being placed in a school lunchroom, etc.

VERY COOL!

Keep up the great work Adam and team!

-Don G.

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

Post #37by Christophe » 08.03.2004, 21:35

don wrote:Is this something you are considering releasing to an open source home such as SourceForge, for additional development / assistance? Or just releasing as a set of DLLs and EXEs?


Well, they don't have a choice here. Remember Celestia is GPL, so any work building on it has to be GPLed too.

That, however, doesn't mean that they have to make the source code available, at least as long as no binaries are distributed. But it could still be argued whether or not a kiosk is a form of public distribution. Anyway since the added value of the product is only partially in the software itself, it shouldn't be a problem for Nesta Futurelab to release the source code.

By the way I'm just thinking that it may not be legal at all to use Celestia with proprietary libraries like IE. It probably depends on the specific implementation and how the modules interact.
Christophe

don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 2 months
Location: Colorado, USA (7000 ft)

Post #38by don » 08.03.2004, 22:01

Christophe wrote:By the way I'm just thinking that it may not be legal at all to use Celestia with proprietary libraries like IE.

I'm not sure how all of these different types of licenses work together, but if this were the case, then wouldn't it be a problem with Qt/KDE as well? Or is Qt OpenSource/GPL on Linux, even though it is not on Windows?

-Don G.

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

Post #39by Christophe » 08.03.2004, 22:27

don wrote:I'm not sure how all of these different types of licenses work together, but if this were the case, then wouldn't it be a problem with Qt/KDE as well? Or is Qt OpenSource/GPL on Linux, even though it is not on Windows?


Yes, Qt is available under the GPL on Unix and OSX. KDE is licenced under the LGPL.
Christophe

maxim
Posts: 1036
Joined: 13.11.2003
With us: 20 years 10 months
Location: N?rnberg, Germany

Post #40by maxim » 08.03.2004, 22:45

Why should it be illegal to use proprietary libraries???
This would be a restriction that GPLs intention was to avoid. Of course you can link a GPL program against any library you like. The result has to be GPL again, and that means that you have to make clear where and how it was linked, so that other people can do the same if they want.

maxim.


Return to “Development”