Board index FlightGear Development Canvas

Splash Screens + Canvas

Canvas is FlightGear's new fully scriptable 2D drawing system that will allow you to easily create new instruments, HUDs and even GUI dialogs and custom GUI widgets, without having to write C++ code and without having to rebuild FlightGear.

Splash Screens + Canvas

Postby Hooray » Fri Feb 07, 2014 1:58 am

I got some messages from aircraft developers asking if they could use the Canvas system and Nasal to create more dynamic splash screens.
I said this wouldn't be possible currently. But theoretically, most of the required hooks should be in place for this, right ?

I mean, we already have support for raster images, text and vector graphics (SVG) already.

Now obviously, this is not such an important thing - but it would seem doable, and we could implement much more interactive splash screens that way, showing much more useful information.

In addition, it's worth keeping in mind that our existing splash screen handling code is rather inflexible and could be greatly simplified by allowing Canvas+Nasal to handle the animation side of things.
In fact, we could even show instruments or MFDs on the splash screen by supporting Canvases there, but also a loglist widget or other useful information that we cannot currently show easily when just starting.

So maybe it's not such a bad idea after all ?

Based on looking at the code, we would primarily need a way to add a new "splash screen" placement, so that a canvas could be used instead of a static RGB/PNG texture, right ?
We could then change the splash screen code to load PropertyList-encoded XML files with an embedded Nasal load/unload section, analogous to our GUI dialogs to run some scripting code for animation purposes. "Splash" images would then become XML files.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Splash Screens + Canvas

Postby Kabuki » Fri Feb 07, 2014 2:15 am

Splash screens as I understand them are images that are displayed as soon as possible when a program is launched, in order to give the user something to look at while the rest of the program is loading and initializing.

The Canvas system isn't ready to use immediately when fg is launched.
This is a family-friendly saloon. No talk stink.
Kabuki
 
Posts: 584
Joined: Sat Oct 24, 2009 12:21 am
Location: Usually on the ground, always in the sky, except when underwater.
Callsign: Kabuki
Version: 3.0.0
OS: Windows 7

Re: Splash Screens + Canvas

Postby Hooray » Fri Feb 07, 2014 3:05 am

good point - but splash screens are also used to show information during startup.
And we're planning on using Canvas to replace the built-in GUI, for this Canvas will NEED to become available sooner inevitably.
Canvas itself has a few dependencies - namely, Nasal, the property tree and timers (events)

Admittedly, I don't have any use for this here - because FG loads in under 20 seconds here typically - but some people may have to wait longer.
Supporting canvas-based splash screens would allow us to get rid of some old code, while also allowing aircraft developers to come up with dynamic splash screens (animated gauges etc).
In addition, we could show more startup information pretty easily - simply because that's what the canvas is good at - currently ,we only have a 2 properties to show a few words during startup.
Not very flexible or scalable obviously.
But like I said, I won't need this myself. But it seems there isn't too much missing to make this work (eventually).

Your point about initialization is a good one - but given the FGPanel trend, and TheTom's recent OpenGL ES comments, the canvas subsystem would actually benefit from being available as early as possible. So this really isn't all that far-fetched it seems.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Splash Screens + Canvas

Postby Crashpilot » Fri Feb 07, 2014 4:39 am

Kabuki wrote in Fri Feb 07, 2014 2:15 am:Splash screens as I understand them are images that are displayed as soon as possible when a program is launched, in order to give the user something to look at while the rest of the program is loading and initializing.

The Canvas system isn't ready to use immediately when fg is launched.


Lets have a two staged splash screen model:

When flightgear is started, it pops a splash banner immediately. It is a generic .png file showing the flightgear logo and maybe a progress bar. As a generic splash screen it is independ of the chosen plane, and it depends on no subsystems of flightgear.

The second splashscreen is canvas based and much more sophisticated, like Hooray described. It may appear defered, but obviously it should make sense to bring him up at all.

Example:

User starts fgfs the first splash screen appears with no noticeable delay. After 5 seconds the canvas screen appears, and after 20 seconds startup is complete.
Crashpilot
 
Posts: 28
Joined: Tue Jan 29, 2008 10:38 pm
Location: Cologne

Re: Splash Screens + Canvas

Postby Hooray » Fri Feb 07, 2014 5:57 am

I don't think many people around here will actually see startup times beyond 20+ seconds ? Maybe we should have a poll about this, but overall FG is up and running within a few seconds usually, absent some navcache rebuild, which may take ages, especially for some people - i.e.10-20 minutes, but I am not sure they would be much happier if they were to be presented with a nice animated splash screen then :D

I don't have any need for this myself, but I also don't typically start up complex aircraft at complex locations, so maybe more people are affected by splash screens that I was thinking.

Regarding the initialization concerns, I would not worry about those too much - eventually, we will make Nasal available for other reasons, and that will inevitably include events (timers) and the property tree (listeners) - so this would already include most things required by the canvas to address a single texture and update it dynamically.

I think technically, it's just a new placement mode that we need here, and maybe supporting loading *.nas from $FG_ROOT/Textures/Splashs - i.e. we could simply recognize *.nas as an extension for the splash-texture tag in aircraft-set.xml tags and then directly attach a single canvas.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Splash Screens + Canvas

Postby Thorsten » Fri Feb 07, 2014 8:04 am

I don't think many people around here will actually see startup times beyond 20+ seconds ?


Windows users will...
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Splash Screens + Canvas

Postby sa7k » Fri Feb 07, 2014 11:17 am

Also if you start at a location which you don't have scenery and have the in sim terrasync enabled. You could have many minutes of splash screen waiting.
sa7k
 
Posts: 380
Joined: Fri Mar 16, 2012 3:24 pm
Location: SA7K
Callsign: LV-EPM
IRC name: sa7k
Version: git
OS: debian

Re: Splash Screens + Canvas

Postby Kabuki » Fri Feb 07, 2014 2:02 pm

sa7k wrote in Fri Feb 07, 2014 11:17 am:Also if you start at a location which you don't have scenery and have the in sim terrasync enabled. You could have many minutes of splash screen waiting.


Well, sure. But in this case, you're doing much more than just starting up the simulation.

I just timed my startup with the Dragonfly at PMDY, which is about the fastest loading setup I can think of, and it was 40 seconds with a lightweight scenario included. Immediately after starting, I exited and de-selected the scenario and started again, and it was 36 seconds. I don't know how much of that difference was attributable to not loading the scenario, and how much was due to HD caching some data (my CPU is not so fast, but I have a SSHD and 10 GB or RAM)

My main interest is in getting to the point where I can fly, and I'm not really interested in looking at the screen until that point comes. I suppose a more elaborate splash screen could supply
some sort of briefing information, but in that case, many things will still have to be initialized before there's any information available for canvas to display.

The main thing is flying, and getting to that point as quickly as possible. I just don't consider an elaborate splash screen will add much to the flying experience. I'm not against it, I just think there are many more important improvements that could be made. IOW, nothing wrong with the idea, but it won't add anything to the overall experience, which is flying.
This is a family-friendly saloon. No talk stink.
Kabuki
 
Posts: 584
Joined: Sat Oct 24, 2009 12:21 am
Location: Usually on the ground, always in the sky, except when underwater.
Callsign: Kabuki
Version: 3.0.0
OS: Windows 7

Re: Splash Screens + Canvas

Postby Hooray » Fri Feb 07, 2014 7:54 pm

This would be a different discussion if we didn't have canvas already - but given that we have it, we could consider using it here if people really think they need more dynamic -and more responsive- splash screens. Compared to other simulators, FG is already pretty fast when it comes to booting. So I do not have any use for sophisticated elaborate splash screens - then again, most of the work related to this, is likely to be done either way - i.e. making Nasal & Canvas available earlier. Keep in mind that the long-term ideas post 3.2 is to move many frontend/launcher features back into FG. So this would not be about coming up with a huge new feature - it be primarily about using existing code to get rid of old C++ code - i.e .unifying the rendering 2D back-end.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Splash Screens + Canvas

Postby Hooray » Sun Apr 27, 2014 11:56 pm

See: A progress bar for the splash screen?

I don't particularly like to idea to add even more low level OpenGL code to the init code to implement such things, but once we can initialize Nasal earlier (which will probably Philosopher's boootstrap.nas script, but which also depends on Zakalawe's reset/re-init work) we should be able to pull this off with less than 50 lines of Nasal/Canvas code.

I think a new splash screen "placement" would make a nice tutorial for the wiki

Then again, I think the real problem here is not the splash screen, but rather the navcache/POI code that needs to be fixed - navcache rebuilds taking ages have been around since the first got introduced, but for some reason most people who build from source are not even affected...
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Splash Screens + Canvas

Postby TheTom » Tue Apr 29, 2014 3:54 am

It is also possible to use the Canvas without Nasal...

Why a new placement? The splashscreen is nothing but a simple window without decoration ;-)
TheTom
 
Posts: 322
Joined: Sun Oct 09, 2011 11:20 am

Re: Splash Screens + Canvas

Postby Philosopher » Tue Apr 29, 2014 4:01 am

Hooray wrote in Sun Apr 27, 2014 11:56 pm:I think a new splash screen "placement" would make a nice tutorial for the wiki

I don't think he was talking about your sense of "placement", just meaning a dialog with simple things on it.
Philosopher
 
Posts: 1593
Joined: Sun Aug 12, 2012 7:29 pm

Re: Splash Screens + Canvas

Postby Hooray » Tue Apr 29, 2014 5:09 am

right, we could simply get rid of the splash screen and just show a dialog without decoration. I am not sure though if we really want to "animate" a canvas using fgSet*() and friends in C++
I don't know just how early we can actually use canvas meanwhile, but if tooltips can be shown on top of splash screens we should be all fine actually.
Then we really only need to disable the hard-coded splash screen texture and instead use canvas to show the same texture and process those init properties to update the progress bar.
Nasal-wise, one could simply support an embedded Nasal block that directly loads the canvas stuff into a private context that gets deleted after init, i.e. just a subset of nasal/canvas for animating things there.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Splash Screens + Canvas

Postby Hooray » Thu Jul 10, 2014 7:09 am

Subject: FGCanvas Experiments & Updates

Making Nasal/Canvas available as early as possible, also means that we can show Canvas-based splash screens, or even run Canvas dialogs until the scenery has finished loading. This screen shot shows two fully-responsive Canvas dialogs while FlightGear is still scenery loading:
Image
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU


Return to Canvas

Who is online

Users browsing this forum: No registered users and 0 guests