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«First 1 2 Next»
#21
07/10/2013 (9:00 am)
@Nils: Sure thing. Need a few changes:

1). In win32Window.h, just below the line:
/// Menu associated with this window.  This is a passive property of the window and is not required to be used at all.
   HMENU mMenuHandle;

add:

/// Background color brush associated with this window.
	HBRUSH mBackgroundColor;

2). In win32Window.cpp, in Win32Window::Win32Window() (around line 78), add:
mBackgroundColor(NULL),

3). In win32Window.cpp, in Win32Window::~Win32Window() (around line 102) add:
// free our background color brush
	DeleteObject(mBackgroundColor);

4). In win32Window.cpp, in Win32Window::_registerWindowClass() (around line 628) add:
mBackgroundColor = CreateSolidBrush(RGB(255,0,255));

Change the RGB param to whatever color you'd like. Hot pink may not be the best choice. :]

5). In win32Window.cpp, in Win32Window::defaultRender() (around line 926), comment out this line:
FillRect( logoDC, &lRect, (HBRUSH)GetSysColorBrush(COLOR_APPWORKSPACE));

and add this line just below it:
FillRect( logoDC, &lRect, mBackgroundColor );

That should be it.


As for displaySplashWindow(), I think UDK has the right idea in this case. It shows a splash screen as well but it hides the main game window until loading is complete so all the end user sees is a nice, responsive splash window and then their game is ready to go.
#22
07/10/2013 (10:34 am)
@Chris; Wow, that works like a charm! Many thanks!!!

@Steve; minor detail: the splash doesn't go away until you close the game (window) if you move it to init.cs

#23
07/10/2013 (12:11 pm)
Quote:it hides the main game window until loading is complete
IMO this is probably the best solution. It will obviously be a platform-specific solution, and probably involve some different method calls on the window. I really have no experience in this area but I had a bit of a poke around the splashscreen stuff when I first thought of this.

Great find, Steve, that's tops. I think we should add a console method to destroy the splashscreen as well, instead of it being auto-destroyed on Canvas::onAdd (I think is where it happens). Then we could destroy it from script when the first GUI is pushed.
#24
07/12/2013 (10:02 am)
So, is there a quick fix for Steve's idea, without having to go into the engine code?

I like how the splash stays loaded now by moving it into init.cs, just would like a quick way to force it to disappear once the startup gui has loaded. Because as stated it will now stay there until the game is closed lol.

Thanks
P
#25
07/12/2013 (11:43 am)
I was fiddling around and found the CloseSplashWindow() function but there is no console function for it. Not horribly hard to make one - I'll hammer it out and post it later.
Page«First 1 2 Next»