Advertisement

Splash Bitmaps while loading...

Started by January 21, 2000 04:20 AM
5 comments, last by babar_zafar 24 years, 10 months ago
Hi, I''ve run into a tricky problem, i have a complete 2D engine a game which uses it, but when the game loads I''m forced to watch a black screen for like 5-10 secs while the resource managment system loads everything. Because I''m also using an external mod player, FMOD (www.fmod.org) the wait increases. While this isn''t a REAL problem - it''s still really annoying. I use a SYS_Init() before a enter the message loop which loads all the interfaces (sound,video etc). Any idea on what to do? Should I init DDraw and manually load a bitmap and use a general splash windows Please give me some good advice... // Babar Zafar // Copyright (c) 1982-2000, Parents Inc
// Babar Zafar// Copyright (c) 1982-2000,
I initialize the DX-Stuff at the very beginning (that does not take much time). Then i Blt a splash screen to the Primary Buffer before loading the gameart.
Advertisement
Ok then, well here is another question - do you have any idea if it is a good idea to do a simple animation while my resource managent system is active. The current resource interface implemention is single threaded - what do you think about moving the resource managment to a separate thread. With this thread I could also ''touch'' my data in the swap file when the game is inactive. This would be great, cause it wouldn''t let windows tamper with the swapfile when the game is running. It sounds great, but has anyone done this - i don''t want to write >2000 lines of code and then get pissed cause it won''t work. Give me a hint if you''ve done this..

By the way, all you newbies complaining over not finding any good sources - drop the crap. Find Chris Hargrooves "Code on the Cobb", lock your self in your room with nothing but refreshments and the wonderful MSDN. I started for about 6 months ago and now I write rock solid 2D DirecX code. Don''t jump into 3D if you don''t know the basics. Anyway I''m planning on releasing my game engine code
cause a lot of my friends like it, since it covers video,sound,input,resource managment. Mail me if you''re interested...
// Babar Zafar// Copyright (c) 1982-2000,
I would be very careful trying to trick Windows into keeping your stuff from being swapped. Sounds like a good way to get a really thrashy computer going. Since your program doesn''t know the reason for the swap (maybe the user is trying to bring up his email, for instance), your better off letting Windows handle this.

Notwen
Notwenwww.xbox.com
I''ve never done it, but the multithread thing seems like a sound enough idea. I''m considering doing the same thing - if I do it before you do, I''ll let you know how it goes.

I think you''re going to have a hard time trying to subvert the swapfile, though... might be more trouble than what it''s worth.





Mason McCuskey
Spin Studios - home of Quaternion, 2000 GDC Indie Games Fest Finalist!
www.spin-studios.com
Founder, Cuttlefish Industries
The Cuttlefish Engine lets anyone develop great games for iPad, iPhone, Android, WP7, the web, and more!
I think what babar_zafar is trying to do with the swap file is to touch the data and force windows to commit some physical memory for the data. This is a common optimization to minimize page faults. When you allocate memory in Windows, Windows will allocate a set of virtual memory pages to satisfiy the request without actualy commiting any physical memory. When you write data to memory windows will then commit a physical page of memory. However, this alone will not ensure that windows will not swap the commited pages back out to disk immediatly. You have to trick Windows into thinking the data is being used frequently. This can be done by "touching" the data, by performing reads of your data in the newly allocated memory block. Windows will then think that the memory is being used frequently, will commit physical memory, and will mark it so that the virtual memory system will be less likely to swap it to disk. This doesn't subvert the swap file at all. The memory allocated by the active process always has a higher priority than memory allocated by other process so switching to another app is not a problem. It can cuase a switch to another app to be slower because the newly active app has to bring it's data into physical memory from the swap file, but Windows is designed to handle that.

Just a little clarification.

Edited by - bstach on 1/21/00 3:19:10 PM
Advertisement
If you take a look, many game have a loading time before it start, but they put an image, or better a bar tath show the progress. Try to do the same, a simple image is better than a empty screen!

This topic is closed to new replies.

Advertisement