Game Development Community

Improving startup

by Daniel Buckmaster · in Torque 3D Professional · 07/03/2013 (12:28 am) · 25 replies

At the moment, when starting up a T3D window, I get a splashscreen for half a second, then a grey window for 5-10 seconds. The splashscreen is a good idea, but a bit pointless, and the grey window is pretty nasty for user experience.

Is there anything we can do about this? What is the engine doing while that grey window is open, until it pushes the startup GUI? Is there any way we could do that stuff while the splash window is open instead?

About the author

Studying mechatronic engineering and computer science at the University of Sydney. Game development is probably my most time-consuming hobby!

Page «Previous 1 2
#1
07/03/2013 (2:19 am)
I think the delay reason is due to the scripts execution.
Try changing canvas color to black :)

Another idea would be to open the canvas window invisible showing the splash for more, and unhide it when everything is ready
#2
07/03/2013 (3:33 am)
I confirmed that the window is created only when the canvas is created, so yeah, at that point we're in script land. When the canvas is created, the splash window is automatically destroyed. Might be nice to allow the splash to be fully script-controlled instead, so we can hide it when everything is actually ready.

Making the canvas black would help, though ;P.
#3
07/03/2013 (5:57 am)
Quote:
Making the canvas black would help, though ;P.

i55.photobucket.com/albums/g138/iand1993/Scruffy_Futurama.jpg
#4
07/03/2013 (8:34 am)
5-10 seconds with no feedback is a long time. I'd prefer an image than a straight colour, that way you could inform the user that the game is loading rather than them wonder if it's errored out.
#5
07/03/2013 (2:40 pm)
I remember back in TGE when they manually tested the CPU for its speed. It had to consume up to a full second for this. :) Glad that's gone.
#6
07/03/2013 (4:12 pm)
Yeah to keep the splash screen image on screen during loading would be the nicest option to have.

I like Unreal Engine the most of startup time and then getting in to game time, they seem to always preload a lot of assets so jumping in game is very fast.
#7
07/03/2013 (6:03 pm)
Edward,

Respectfully disagree. Some of the WORST 'loading screen' times I have seen have been in Unreal. As with any engine, this is all about how the developer decides to use the process. This process is NOT engine dependent, but developer determined.

Ron
#8
07/04/2013 (1:55 am)
You could remove all the content in the game, this will make it load a lot faster...
#9
07/04/2013 (5:27 pm)
We need to have it make coffee for the end-user during start-up. I'd like that....

Perhaps breaking the resource system off and making it thread-safe so we could stream our assets in while displaying splash screens would be good. It would also be nice if we could perhaps find a way to use such a resource system to break a level up into loading groups so that assets needed immediately are loaded before the level starts, but the rest of the stuff is streamed in after play begins (and hopefully before the player can come around the corner and catch us with our assets down).
#10
07/04/2013 (6:15 pm)
Just to be clear: I'm not saying it should load faster, I'm just saying there should be better feedback while it is loading. Having loading happen during splashscreens is a great idea.
#11
07/05/2013 (7:27 am)
I've just timed that startup and yeah ... it's nearly 10 seconds of blank grey - didn't realize it was that long actually ... :/

Having said that, my intro music kicks in at 3 or 4 seconds before my intro screen appears ...

Also I think getting rid of the MAGENTA for no GFX would be nice - occaisionally see that thing flash in for a second. It's more noticeable on a HDTV than a monitor.

In gui/guiCanvas.cpp

ColorI gCanvasClearColor( 0, 0, 0 ); ///< For GFX->clear //yorks was( 255, 0, 255)


Can't actually find the bit for the grey intro background in the code though ... :/
#12
07/05/2013 (2:14 pm)
I suggest we make use of that half second popup. You can provide a tutorial on how to change that image with a relevant loading image for your game and then pop the real canvas when it's ready to go.
#13
07/09/2013 (1:27 pm)
Quote:Can't actually find the bit for the grey intro background in the code though

I tried some things in the guiCanvas::onAdd after the createwindow call, but to no success. It stays grey.
#14
07/09/2013 (4:00 pm)
It looks like the original author(s) of win32Window.cpp got a little confused. They set the initial window background color in Win32Window::_registerWindowClass():

classInfo.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);    // Default color

But when the WM_PAINT event is received the code will call Win32Window::defaultRender() which does this:

// Fill with AppWorkspace color
FillRect( logoDC, &lRect (HBRUSH)GetSysColorBrush(COLOR_APPWORKSPACE) );

COLOR_APPWORKSPACE is the grey color everyone hates.

So, to fix it, replace the FillRect() line with something like:

FillRect( logoDC, &lRect, (HBRUSH) GetStockObject(BLACK_BRUSH));

That'll fill the window rect with RGB(0,0,0). You can create your own brush with your own color using CreateSolidBrush() but that'll take a bit more effort.

All of this is obviously Windows-only. Not sure how Macs handle all of this.

Edit: Another useful tidbit: consider removing the call to displaySplashWindow(). It's useless in my opinion. It creates a tiny little window to display a splash image (splash.bmp) but it's only displayed for a fraction of a second (the main window auto-closes it when it's created, which happens almost instantly). Shaves a few milliseconds off of the startup process.
#15
07/09/2013 (6:54 pm)
You know, I spent about 4 hours searching for that - I had a feeling....
#16
07/10/2013 (12:24 am)
Quote:You could remove all the content in the game, this will make it load a lot faster...
This is an awesome comment, LOL!

Guy Allard was kind enough to whip me up a minimal starting script a while back:
new GuiControlProfile(GuiDefaultProfile);
new GuiControlProfile(GuiToolTipProfile);
new GuiCanvas(Canvas);
Canvas.setWindowTitle("ScriptT3D");
new RenderPassManager(DiffuseRenderPassManager);
setLightManager("Basic Lighting");
activateDirectInput();
GlobalActionMap.bindCmd("keyboard", "escape", "quit();", "");
new GuiControlProfile(GuiTextProfile)
{
  fontSize = 48;  
  fontColor = "50 50 50";  
  justify = "center";
};
%txt = new GuiTextCtrl()
{
  profile = GuiTextProfile;
  position = "200 100";
  extent = "200 100"; 
  horizSizing = "center";
  verSizing = "center";  
  text = "Hello ScriptT3D!!";
};
Canvas.setContent(%txt);

This loads in 3.5 seconds or so. I only get the grey screen for that time. So is it possible to rearrange the way things get loaded to reduce time the grey screen is up? I don't think everything that is going on in script is specific to GUI dependencies. So maybe only the GUI stuff gets loaded first and you will only see the grey screen during that time and can pop up a splash screen or widget. Then everything else can continue to be loaded as normal.
#17
07/10/2013 (6:43 am)
That grey area is meant for your NVIDIA or AMD splash ;-)

@Chris; Thanks for sharing! Would you perhaps know how to define the CreateSolidBrush()? I think that having a color instead of black would give more the impression something is loading...
#18
07/10/2013 (7:11 am)
COLOR_APPWORKSPACE <--- no wonder my search for RGB values didn't return anything!
#19
07/10/2013 (7:39 am)
Moving the splash call out of main.cs to scripts/client/init.cs and calling it after the window is configured let's it stay visible until the startup screen appears.

function initClient()
{
//...
   // The common module provides basic client functionality
   initBaseClient();

   // Use our prefs to configure our Canvas/Window
   configureCanvas();
   displaySplashWindow();//yorks moved from main.cs

   // Load up the Game GUIs
//...

Much nicer.
Page «Previous 1 2