Scolring - Forum

Entraides et échanges autour de la technologie Scol - Informations and exchanges on the Scol technology

Vous pouvez changer la langue de l'interface une fois inscrit - You can change the language once registered

You are not logged in.

#1 27-Oct-2014 22:12:27

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,541
Website

os3d player startup delays

colleagues:

in starting up the player or my slightly modified version of the player, I notice the following. assuming the vm is runnin in the background, once I click on my player .scol file, it takes

3 seconds to see a loading screen
all is well, the loading screen shows the packages being loaded by the vm
at 15 seconds, the mainwindow is created with crEdMainWindow. 


then nothing happens for ten seconds, there is just a blank scol window on the screen

at 25 seconds, a toolbar appears

and at 32 seconds, the splash screen widget appears

is the vm aware of:

the rendering of the toolbar, and
the rendering of the widget

or can the vm be made aware of such events with a timer function in scol?

or is there no way to handle these delays with scol coding?  (if it cannot be handled with scol, I cannot handle it and will consider it a problem for you guys to deal with or not deal with, scol and  os3d are so great anyway, you guys are great, etc.).

here is a movie of what I am describing. the framerate is low, but it more or less shows what I mean:

http://ifam.net/mediaoctopus3d/loadingvideo_x264.mp4

Offline

#2 27-Oct-2014 22:26:13

iri
Admin. / Scol language & Scol apps developer
From: France
Registered: 22-Feb-2009
Posts: 2,024
Website

Re: os3d player startup delays

You can manage the 2d and 3d display differently.

The writing in the console (_fooSXXX functions) slows down the running.

The safe loading (with _testpak Scol function to perform a safe compilation) takes much times.

...

Offline

#3 27-Oct-2014 22:36:33

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,541
Website

Re: os3d player startup delays

Thx Iri.... I'm not using secureload. I will try running the player without the console.


As to managing the 2d/3d differently, the window, toolbar, and splash widget are all created in the same function. Are the toolbar and splash widget nil until they become visible? If so I think I know what to do.

Offline

#4 27-Oct-2014 23:12:49

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,161
Website

Re: os3d player startup delays

Wrting the log file also take time, try disabling the logs in the scol voyager settings.

The SO3Engine have a lot to initialize, it can take some secondes to load.

Offline

#5 27-Oct-2014 23:42:02

iri
Admin. / Scol language & Scol apps developer
From: France
Registered: 22-Feb-2009
Posts: 2,024
Website

Re: os3d player startup delays

Hide the console.

Offline

#6 29-Oct-2014 14:22:16

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,541
Website

Re: os3d player startup delays

iri wrote:

Hide the console.

that makes things a bit quicker, but not much. 

In any case, this is the method I found which prevents a user from looking at a big blank player screen on an i3 or cheap windows tablet (as for the latter, I hope. I'll know next week when I have a Intel Atom processor Z3740D 2M in my hands)

create a callback function to destroy initializing_window and show mainwindow
creating a regular scol window(for this example, global variable initializing_window) maybe with pretty pictures and/or dynamic content, something using the core api and eventually using downloaded images when my master plan social media component is up or some simple php script..) window after .pkg dependencies have loaded...
I did this
create the mainwindow and set it to hidden
SO3WidgetOnLoadEndEventCb loadwidget @destroy_initializer nil;


this way the 3d mainwindow (including the child toolbar) only appears when the widget is rendered. using this method, the user never encounters a blank window

excerpted os3d initOS3Dplayer function:

fun initOs3dPlayer(file, projname, pw ,ph, fullscreen) =

  set sCurrentScenePath = file; 

  set initializing_window = _CRwindow _channel nil 400 400 400 250 WN_TOPMOST "Initializing Window";

  InitMainChannel;

  getOs3dVersion;

   

  if (pw == nil) || ((atoi pw) <= 0) then nil else

    set iWinW = atoi pw;

  if (ph == nil) || ((atoi ph) <= 0) then nil else

    set iWinH = atoi ph;

  let mkOcto3dplayer [0 nil] -> octoplayerstruct in

  let _GETdesktopSize -> [sw sh] in



  (

    set mainWindow = setEdWindowIcon (crEdMainWindow _channel nil ((sw / 2) - (iWinW / 2)) ((sh / 2) - (iWinH / 2)) iWinW iWinH nil strcatn "MediaOctopus3d Player : "::projname::nil) sWinPlayerMainIcon;
    setEdWindowVisible mainWindow 0;

    // size the window with borders

    if (getEdWindowIsAX mainWindow) then nil else

      setEdWindowPosSizeEx mainWindow ((sw / 2) - (iWinW / 2)) ((sh / 2) - (iWinH / 2)) iWinW + 1 iWinH + 1;

  );

  

  // set lib 2D default res path

  set sG2DDEFAULTRESOURCESPATH = "tools/os3dlib/res/";

  set sV3DDEFAULTRESOURCESPATH = "tools/os3dlib/res/";

  

  let getEdWindowSize mainWindow -> [nw nh] in
  //octopus3d code, make room for menu

  let crEdCtrl3D mainWindow 0 50 nw nh EDWIN_RESIZE_MW|EDWIN_RESIZE_MH -> ctrl3dviewstr in
  //end octopus3d code
  //octopus3dcode, create a color and a toolbar set to that color
  let make_rgb 255 0 0 -> toolbar_color in
  let crEdWindowToolBar mainWindow 0 0 nw 50 5 1  toolbar_color ETB_HORIZONTAL -> tbstr in 
  //end octopus3d code
  //make a button begin octo code
  let _LDalphaBitmap _channel _checkpack "tools/os3deditor/res/tb_playpause.png" -> aplaypause in

  let crEdToolBarButton tbstr aplaypause ETB_ALIGN_LEFT "Play / Pause" nil -> chkplaypause in
   let _LDalphaBitmap _channel _checkpack "tools/os3deditor/res/tb_stop.png" -> astop in

  let crEdToolBarButton tbstr astop ETB_ALIGN_LEFT "Stop" nil -> chkstop in
  let getEdCtrlView3d ctrl3dviewstr -> viewstr in

  let V3DgetDefaultSession viewstr -> sessionstr in

  (

     setEdToolBarVisible tbstr 1;
     paintEdToolBar tbstr;
     setEdCtrl3DdestroyCb ctrl3dviewstr @cbDestroyView3d;

    

    V3DaddViewport viewstr 0.0 0.0 1.0 1.0 0x0;

    initScene viewstr sessionstr;

    

    //Loading screen

    let V3DgetDefaultViewport viewstr -> viewportstr in

    let SO3BitmapWidgetCreate (V3DgetSession sessionstr) viewportstr.V3D_viewport "Loading" 0 0 nw nh 100 -> loadwidget in
    

    (

      let G2DloadAlphaBmp _channel "tools/mediaoctopus3dplayer/mainsplash.png" -> bmp in

      (

        SO3BitmapWidgetBlitAlpha loadwidget bmp;
        //create open button callback when player is initialized
        if (scene_is_loaded==0) then
        (
        setEdToolBarButtonCbClick tbstr chkstop mkfun5 @opendialog [viewstr loadwidget viewstr sessionstr];
        _DSalphaBitmap bmp;

        SO3BufferUpdate viewstr.V3D_buffer;
        SO3WidgetOnLoadEndEventCb loadwidget @destroy_initializer nil;
//more code

callback, destroy initializing_window and show mainwindow

 	fun destroy_initializer (widget, parameter)=
	_DSwindow  initializing_window;
 	setEdWindowVisible mainWindow 1;
 		0;;

feel free to use this, although you guys will do it more efficiently most probably.

in my quest to keep impatient users from getting more impatient....is there a way the vm can estimate the time it takes between creating the widget and rendering it?
if not, I'll put something dynamic in the initializing_window (in my case, a spinning octopus .gif if scol support .gif?/bitmap slideshow/web page hosting flash movie, whatever is fast enough)

Last edited by hebdemnobad (29-Oct-2014 14:38:05)

Offline

#7 29-Oct-2014 15:49:28

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,161
Website

Re: os3d player startup delays

No this is only the 3D engine initialization time, it depend a lot of the system.
I think this must be related to the partition parsing for resources directories. Not sure, there is so much at 3D engine start, like initializing chrome navigator in the engine, resources locations, default resources loading, directx initialization....

Offline

#8 29-Oct-2014 16:34:28

iri
Admin. / Scol language & Scol apps developer
From: France
Registered: 22-Feb-2009
Posts: 2,024
Website

Re: os3d player startup delays

When is the 3D initialized in os3d ?
The hardware drivers and co (directx, navigator, ...) can be initialized earlier as soon as Scol packages are loaded ?

Offline

#9 29-Oct-2014 16:40:35

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,541
Website

Re: os3d player startup delays

iri wrote:

When is the 3D initialized in os3d ?
The hardware drivers and co (directx, navigator, ...) can be initialized earlier as soon as Scol packages are loaded ?

I'll try creating a window with the so3 engine content following your template Iri. A swimming octopus with an orbital camera to twiddle around.

Offline

#10 29-Oct-2014 16:57:18

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,161
Website

Re: os3d player startup delays

Iri > as I remember this just when you create the first 3D buffer. and a lot of things can't be initialized before the first buffer is created.

Offline

#11 29-Oct-2014 17:01:59

iri
Admin. / Scol language & Scol apps developer
From: France
Registered: 22-Feb-2009
Posts: 2,024
Website

Re: os3d player startup delays

it's a pity. Mutual recursion.

Offline

#12 30-Oct-2014 15:08:05

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,541
Website

Re: os3d player startup delays

I've worked out a couple of start screens to keep let the user know that the vm is busy while os3d is starting up, as opposed to looking at a blank screen (I create the mainwindow as hidden, but if flashes, I posted to a separate thread about this.)

Here is the video:
http://ifam.net/mediaoctopus3d/allstartscreens_x264.mp4

I've tried various components to occupy the user after the dependencies have loaded and before os3d is initialized. The functions that blit a bitmap to a window do not work atm, I  believe arkeon said they are a work in progress. I tried the compbitmap way, but the bitmap loads and then immediately gets turned to gray (the windows not responding behavior)...I believe arkeon said that this is a work in progress or not being worked on right now. I'll put in a couple of feature requests on redmine regarding blitting bitmaps to plain windows (not using the comp api) and being able to put the webnavigator in a plain window (that way, maybe I could cheat and put in a slideshow/flashmovie in a web page in the navigator in the window.

So the most graphic format I could come up with is comptext in a container...it does not automatically go grey when it is rendered, unlike the compbitmap method, which shows the image greyed out or sometimes not at all (all you see is the color of the container.)  It would be great to get the vm to display images while the 3d engine start up. Maybe there is a method I'm not using. 

My design is horrible, but fortunately I'm married to a 2d designer who will help me work with what resources the api has to offer.

I changed the properties of the maindwindow objwin to topmost, so everything remains on the screen as the player loads (unless the user switches to another window.)

My bottom of the line tablet arrives today, we will see how everything works on that.

An idea about the time between loading dependencies and initializing os3d/the s03 engine.  What I'm thinking of doing is storing the time between dependency loading and 3d initialization in an .xml file.  Every time the user starts up the player, the vm will check how long this period is, creating an average time lapse over various sessions of using the vm, so over time, the vm will know approximately how long it should take between loading .pkg dependencies and seeing the mainwindow in all its glory.

So then the 3d engine startup screen will be able to give the user an estimate of how many seconds it will take to see the 3d buffer.  Whether the vm can repaint the container while initialization is taking place (to make a startup bar) remains to be seen.

But things are working well enough I think.  smile

thx for all of yoru ongoing help guys.

Last edited by hebdemnobad (30-Oct-2014 15:15:41)

Offline

Board footer

Powered by FluxBB