🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Free game: Tower (latest version 1.6)

Started by
60 comments, last by WitchLord 20 years, 2 months ago
Changing the depth-stencil format to D3DFMT_D24X8 made the code work. I'm not sure what the DX8 docs say but here's a sample from DX9:
BOOL IsDepthFormatOk( D3DFORMAT DepthFormat,                       D3DFORMAT AdapterFormat,                       D3DFORMAT BackBufferFormat ) {    // Verify that the depth format exists.    HRESULT hr = pD3D->CheckDeviceFormat( D3DADAPTER_DEFAULT,                                          D3DDEVTYPE_HAL,                                          AdapterFormat,                                          D3DUSAGE_DEPTHSTENCIL,                                          D3DRTYPE_SURFACE,                                          DepthFormat);    if( FAILED( hr ) ) return FALSE;    // Verify that the depth format is compatible.    hr = pD3D->CheckDepthStencilMatch( D3DADAPTER_DEFAULT,                                       D3DDEVTYPE_HAL,                                       AdapterFormat,                                       BackBufferFormat,                                       DepthFormat);    return SUCCEEDED( hr );}Log with CATALYST 4.3:gfx.Desktop width: 1024gfx.Desktop height: 768gfx.Desktop format: X8R8G8B8gfx.1 graphics adapter(s) available====gfx.Adapter: 0gfx.Driver: ati2dvag.dllgfx.Description: RADEON 8500 SERIESgfx.Version: 6.14.10.6430gfx.VendorID: 00001002gfx.DeviceID: 0000514Cgfx.SubSysID: 013A1002gfx.Revision: 00000000gfx.SubSysID: 013A1002gfx.Can render in windowed mode: Yesgfx.Allow source blending with source alpha: Yesgfx.Allow destination blending with inverse source alpha: Yesgfx.Allow alpha channel in textures: Yesgfx.Max texture size: 2048 x 2048gfx.Max texture aspect ratio: 2048gfx.Max primitive count: 65535gfx.Max vertex index: 16777215====gfx.CreateFullscreenDevice(1024, 768, 32)gfx.Back buffer pixel format: Unknown formatgfx.Couldn't find suitable format for depth bufferFailed to create a fullscreen device. Your video card may not support the requested resolution.

It seems that you don't do the CheckDeviceFormat() -test for the depth formats. Try adding that and/or make it possible for the user to be able to force the format to be whatever he wants.

Yet, this is still strange as I have used D3DFMT_D32 myself sometimes and the driver is set up to support 32-bit Z-buffer. Hmm... looks like I have somewhat obsolete drivers, though (4.2). Maybe I should try with the new drivers first.

EDIT: Installed CATALYST 4.3 drivers; doesn't work but the log changed a bit. I inserted it after the code sample above.


[edited by - nonpop on March 15, 2004 10:53:56 AM]
Advertisement
quote: Original post by WitchLord
Thanks for the quick reply. In an effort to find the problem as fast as possible I give you the code for how I create the D3D device. Perhaps you can see something that I cannot.

The problem with Win98 seems to be that the refresh rate isn''t initialized correctly. I always thought by specifying the refresh rate to 0, DX would choose a suitable one, but this seems to not be the case for Win98.

Well, I''m just getting started on DirectX. So you''d probably know better than I would. But looking up the FullScreen_RefreshRateInHz at MSDN for DX8 says that full screen requires a result from EnumAdapterModes or one of two flags. Looking a little further it looks like EnumAdapterModes can return zero for the refresh rate. (The value of 0 indicates an adapter default.) You could try using D3DPRESENT_RATE_DEFAULT to let the run time choose the presentation rate. DX9 doesn''t appear to allow the flags anymore though.
(I see that nonpop has a reply now - so maybe that''s what you need.)
If you get a new version I can try it at home tonight.


Tadd
- WarbleWare
Tadd- WarbleWare
Nice game

Works fine on my GeForce 5200, 2.7Ghz Celeron.
Tried the 1.5 beta, and as reana1 said, the problem does still exist in win98 fullscreen mode. Log here http://jolle.se/bah/tower2.log.

I did however noticed a typing error in the readme:
quote: - The config.cfg file is not created at initialization if not already available
Zanthos:

Thanks. I''m happy you like the game.

nonpop:

Very strange indeed. D32 should work, since the I did verify the format.

I noticed that in the log, it says:

gfx.CreateFullscreenDevice(1024, 768, 32)

Did you change the bpp, manually in the config.cfg? Set it to 24, or it won''t work, 32 is not recognized by the game (I''ll fix this), which is why at the end of the log the game couldn''t find any suitable formats. It could still be a driver problem that you have, which would explain why it works on the other Radeon 8500, and not yours.

reana1:

Actually D3DPRESENT_RATE_DEFAULT is defined as 0, so this is what I do already. It seems that it doesn''t work for Win98. I''ll have to enumerate the available refresh rates and choose one of them instead of setting it to 0. I''ll do that as soon as possible. It''ll probably be a couple of days though, since I have very little time during the week.

Jingo:

Thanks, for the info. I''ll update the list.

Jolle:

I think the problem is that Win98 doesn''t accept refresh rate set to default (0), I''ll try enumerating available refresh rates.

Good catch on the readme.txt, I''ll fix it for the next release.

__________________________________________________________
www.AngelCode.com - game development and more...
AngelScript - free scripting library

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Ok, 24bpp will give the previous errors. But try the depth format checking method in my previous post (though you have to port it to DX8) and/or allow manual setting of the format.
Just uploaded another version 1.5 beta 2:

Tower 1.5 beta 2

This one has the following changes added:

- The user can now select refresh rate, which may help on some systems
- The depth buffer format D24X8 is chosen before D32
- It is now possible to chose fullscreen resolutions that do not have 4:3 ratio

I think that this should work for everyone now. Please try it out.

Regards,
Andreas

__________________________________________________________
www.AngelCode.com - game development and more...
AngelScript - free scripting library

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Just worked fine for me !

Config: Athlon 2000+
GeForce4 Ti 4200 128MB
512 DDR RAM
WinXP
Res - 1024x768

There is no problem, only solutions...
nonpop:

I was already using the depth buffer checking method you mentioned. See the source code I revealed. The problem is that the check passed, even though the driver didn''t allow me to create the device.

Could you check the DirectX Caps Viewer that comes with the DXSDK, and tell me what depth buffers your system allows?

In either case I think I have resolved the problem by checking for D24X8 first, and then D32. This will make the game choose the D24X8 format if it is available, which seems to be the most common one. My GeForce 256 don''t even support D32, even though it could have.

DarkPixel:

Thanks for the info. I''ll update the Tower page soon with the new working configurations that I''ve received these few days.

Regards,
Andreas

__________________________________________________________
www.AngelCode.com - game development and more...
AngelScript - free scripting library

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

quote: Original post by WitchLord
Tower 1.5 beta 2

Still no luck in Win98. When I switch to fullscreen in the options, it only has "auto" as the refresh rate and can''t be changed (though it is no longer grayed out). In Win2K I can change it, but "auto" is not an option. For either OS, when the option is set to windowed, the refresh rate is grayed out (which is as designed I expect).

Also, the mouse acceleration seemed to be more jumpy this time - did you adjust that again?

Tadd
- WarbleWare
Tadd- WarbleWare

This topic is closed to new replies.

Advertisement