Jump to content

  • Log In with Google      Sign In   
  • Create Account

- - - - -

Free game: Tower (latest version 1.6)


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
61 replies to this topic

#21 Andreas Jonsson   Moderators   -  Reputation: 3450

Like
Likes
Like

Posted 12 March 2004 - 02:21 PM

Here is the contents of the config.cfg file.


[audio]
"master" = "100"
 
[graphics]
"bpp" = "24"
"resX" = "1024"
"resY" = "768"
"windowed" = "0"


Jolle, you could try creating this file in the data directory and then set the windowed parameter to "1" for windowed mode, perhaps lower the resolution for the window to fit on the screen. Maybe this will let you play the game on your system until I get it working.

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




[edited by - WitchLord on March 12, 2004 9:24:00 PM]

Sponsor:

#22 Jolle   Members   -  Reputation: 178

Like
Likes
Like

Posted 13 March 2004 - 01:15 AM

Tried that game out on another computer now, on which it worked fine (winxp home sp1, athlon 1800, 256mb ram, gf ti4200). It did however shut down when another program in the background requested and got focus. Edit: found out that it didn't actually shut down.. but it wasn't in the alt+tab list or in the taskbar or anything.

I will try the adding config and set it to windowed mode solution as soon as I get home (sunday evening). I think that it's a win98 problem.. most other people seem to be running winxp/2k. My mail is jolle at cfxweb net.

[edited by - Jolle on March 13, 2004 8:50:25 AM]

#23 reana1   Members   -  Reputation: 277

Like
Likes
Like

Posted 13 March 2004 - 11:47 AM

Works fine on Win2K, but doesn''t work in full screen in Win98.
I tried several resolutions/bit depths and varying my desktop color depth, but had no luck on Win98 fullscreen. Also, in Win98 windowed I was unable to ALT-tab to another window (which I can do fine in Win2K). I didn''t actually try play a game in Win98 windowed, but the menu seemed to work fine.

Here''s the log from after it locked up when I went to full screen:
gfx.1 graphics adapter(s) available
====
gfx.Adapter: 0
gfx.Driver: NVDD32.DLL
gfx.Description: NVIDIA GeForce3 Ti 200
gfx.Version: 4.13.1.2832
gfx.VendorID: 000010DE
gfx.DeviceID: 00000201
gfx.SubSysID: 00301545
gfx.Revision: 000000A3
gfx.SubSysID: 00301545
gfx.Can render in windowed mode: Yes
gfx.Allow source blending with source alpha: Yes
gfx.Allow destination blending with inverse source alpha: Yes
gfx.Allow alpha channel in textures: Yes
gfx.Max texture size: 4096 x 4096
gfx.Max texture aspect ratio: 0
gfx.Max primitive count: 1048575
gfx.Max vertex index: 1048575
====
gfx.CreateWindowedDevice()
gfx.CreateTexture()
gfx.TextureID = 0
gfx.CreateTexture()
gfx.TextureID = 1
gfx.CreateTexture()
gfx.TextureID = 2
gfx.CreateTexture()
gfx.TextureID = 3
gfx.CreateTexture()
gfx.TextureID = 4
gfx.CreateTexture()
gfx.TextureID = 5
gfx.CreateTexture()
gfx.TextureID = 6
au.CreateSound()
au.Sound ID = 0
gfx.CreateMesh()
gfx.MeshID = 0
au.CreateSound()
au.Sound ID = 1
au.CreateSound()
au.Sound ID = 2
au.CreateSound()
au.Sound ID = 3
au.CreateSound()
au.Sound ID = 4
au.CreateSound()
au.Sound ID = 5
au.CreateSound()
au.Sound ID = 6
gfx.CreateMesh()
gfx.MeshID = 1
au.CreateSound()
au.Sound ID = 7
au.CreateSound()
au.Sound ID = 8
au.CreateSound()
au.Sound ID = 9
gfx.ResetDevice(800, 600, 24, 1)
gfx.ResetDevice(800, 600, 16, 0)


I also noticed no high scores in the high score table (all though the file has my name in it). All it ever lists is Nobody with a score of 0. Maybe my scores were negative.

I''d also suggest an F1 popup (or something) that lists the control keys. I had to resort to RTFM also.

Also, maybe let the mouse buttons move the piece right/left too. So you could play with one hand on QWAS/spacebar and one on the mouse (not sure if that would work well though). I just kept trying to move or drop the pieces with the mouse at first. So there might be something you could add to the mouse buttons.

Athlon 1333 MHz
Geforce 3 Ti 200 (64 MB)
256 MB RAM
Win2K SP4 / Win98SE

Tadd
- WarbleWare

#24 Jolle   Members   -  Reputation: 178

Like
Likes
Like

Posted 14 March 2004 - 06:16 AM

Ok, tried it in windowed mode now on win98, and as you can read above, it works. I didn''t have any problems using alt+tab though. The only annoying thing was the mouse capture when in the menus.

#25 Andreas Jonsson   Moderators   -  Reputation: 3450

Like
Likes
Like

Posted 14 March 2004 - 08:21 AM

Ok, I''ve made some changes to the Tower game. The new version can be downloaded here:

http://www.angelcode.com/tower/files/installtower15beta.exe

The changes that I''ve made are:

- The Direct3D device is now created for fullscreen mode directly, instead of first for window mode and then switching to fullscreen
- The game is now visible in the task bar when switching to another app in fullscreen mode
- When pressing ALT+TAB during fullscreen mode, the game is minimized and resolution restored to original mode
- The config.cfg file is created at initialization if not already available (before it was created at exit)
- Increased the rotation speed of the tower, so that it will align with moving blocks a little quicker
- Some more information is now logged

I don''t think the problem with Win98 and and fullscreen has been fixed, but I now log the resolution and pixel format chosen so you can verify that the resolution is actually available.

I don''t know why ALT+TAB doesn''t work for some in Win98, I don''t do anything to block it, so it really should work. Could be a problem with the DirectX drivers.

I''ll see what I can do about the mouse capture in the menu when in windowed mode. I too, find it annoying that it is captured, but I usually don''t play in windowed mode so I didn''t think too much about it.

reana1:

There are actually three different high score lists, one for each tower size. Did you check the other two?

There is a help option in the menu, there you can read about the controls. But I could implement the F1 button to go directly to this menu options. Interesting idea about moving the blocks with the mouse buttons, when I play I don''t even use the mouse. I''ll think about that one, thanks.

jolle, nonpop, and reana1:

Could you try this new version with the -log option and send me the new log?

Thanks for all the feedback, people. I''m sure that I will be able to iron out all the bugs soon enough.

Regards,
Andreas

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

#26 nonpop   Members   -  Reputation: 122

Like
Likes
Like

Posted 14 March 2004 - 10:20 AM

Bad luck this time, too. This is really odd... I checked the D3D headers and the error code (0x8876086A) is D3DERR_NOTAVAILABLE. What are the actual device creation parameters you use? Maybe we should all have a look at them ? I tried some DX9 SDK samples and they worked (though they use D3D9) so...

?

Here''s the log:

gfx.Desktop width: 1024
gfx.Desktop height: 768
gfx.Desktop format: X8R8G8B8
gfx.1 graphics adapter(s) available
====
gfx.Adapter: 0
gfx.Driver: ati2dvag.dll
gfx.Description: RADEON 8500 SERIES
gfx.Version: 6.14.10.6422
gfx.VendorID: 00001002
gfx.DeviceID: 0000514C
gfx.SubSysID: 013A1002
gfx.Revision: 00000000
gfx.SubSysID: 013A1002
gfx.Can render in windowed mode: Yes
gfx.Allow source blending with source alpha: Yes
gfx.Allow destination blending with inverse source alpha: Yes
gfx.Allow alpha channel in textures: Yes
gfx.Max texture size: 2048 x 2048
gfx.Max texture aspect ratio: 2048
gfx.Max primitive count: 65535
gfx.Max vertex index: 16777215
====
gfx.CreateFullscreenDevice(640, 480, 24)
gfx.Back buffer pixel format: X8R8G8B8
gfx.Depth buffer pixel format: D32
gfx.Failed to create device with hardware vertex processing, trying software (8876086A)
gfx.Failed to create device with software vertex processing (8876086A)
Failed to create a fullscreen device. Your video card may not support the requested resolution.



#27 reana1   Members   -  Reputation: 277

Like
Likes
Like

Posted 14 March 2004 - 10:26 AM

quote:
Original post by WitchLord
I don''t think the problem with Win98 and and fullscreen has been fixed, but I now log the resolution and pixel format chosen so you can verify that the resolution is actually available.

Right, still not fixed for me. The resolution at the end of the log file matches my desktop resolution. This time I got a "Out of scan range" message from my monitor, which I always thought meant the program was running at a refresh rate that the monitor couldn''t handle. Mine is set to "optimal" in Win98 and 60Hz in Win2K. I''ll go back to Win98 and try 60Hz.

quote:
Original post by WitchLord
I don''t know why ALT+TAB doesn''t work for some in Win98, I don''t do anything to block it, so it really should work. Could be a problem with the DirectX drivers.

Still wouldn''t let me tab out (or CTRL-ALT-DEL or anything). Maybe I''ll try reinstalling DX (I think I have DX9 now).

quote:
Original post by WitchLord
There are actually three different high score lists, one for each tower size. Did you check the other two?

Doh, missed that! A possible improvement may be to change the table title to something like "Showing Small Scores" where only "Small" is purple to indicate ability to change it. You could also add an "All" option, if that would ever be desirable.

quote:
Original post by WitchLord
There is a help option in the menu, there you can read about the controls. But I could implement the F1 button to go directly to this menu options. Interesting idea about moving the blocks with the mouse buttons, when I play I don''t even use the mouse. I''ll think about that one, thanks.

Oops, missed that too, sorry.

Some other comments:
- Mouse acceleration is great now.
- A feature I thought of was to add a shadow to the floor to indicate where the pieces will drop. But maybe that''s part of the challenge to the game. It would be helpful early on though when there are only a few blocks and you are trying to lay one long-wise. I usually have to rotate past where I want it then go back to make sure it lands next to the particular block I want to be next to.

quote:
Original post by WitchLord
Could you try this new version with the -log option and send me the new log?

The new log is below.
gfx.Desktop width: 1024
gfx.Desktop height: 768
gfx.Desktop format: R5G6B5
gfx.1 graphics adapter(s) available
====
gfx.Adapter: 0
gfx.Driver: NVDD32.DLL
gfx.Description: NVIDIA GeForce3 Ti 200
gfx.Version: 4.13.1.2832
gfx.VendorID: 000010DE
gfx.DeviceID: 00000201
gfx.SubSysID: 00301545
gfx.Revision: 000000A3
gfx.SubSysID: 00301545
gfx.Can render in windowed mode: Yes
gfx.Allow source blending with source alpha: Yes
gfx.Allow destination blending with inverse source alpha: Yes
gfx.Allow alpha channel in textures: Yes
gfx.Max texture size: 4096 x 4096
gfx.Max texture aspect ratio: 0
gfx.Max primitive count: 1048575
gfx.Max vertex index: 1048575
====
gfx.CreateWindowedDevice(800, 600)
gfx.Back buffer pixel format: R5G6B5
gfx.Depth buffer pixel format: D24X8
au.CreateDevice(2, 22100)
gfx.CreateTexture()
gfx.TextureID = 0
gfx.CreateTexture()
gfx.TextureID = 1
gfx.CreateTexture()
gfx.TextureID = 2
gfx.CreateTexture()
gfx.TextureID = 3
gfx.CreateTexture()
gfx.TextureID = 4
gfx.CreateTexture()
gfx.TextureID = 5
gfx.CreateTexture()
gfx.TextureID = 6
au.CreateSound()
au.Sound ID = 0
gfx.CreateMesh()
gfx.MeshID = 0
au.CreateSound()
au.Sound ID = 1
au.CreateSound()
au.Sound ID = 2
au.CreateSound()
au.Sound ID = 3
au.CreateSound()
au.Sound ID = 4
au.CreateSound()
au.Sound ID = 5
au.CreateSound()
au.Sound ID = 6
gfx.CreateMesh()
gfx.MeshID = 1
au.CreateSound()
au.Sound ID = 7
au.CreateSound()
au.Sound ID = 8
au.CreateSound()
au.Sound ID = 9
gfx.DestroyMesh(1)
gfx.CreateMesh()
gfx.MeshID = 2
gfx.ResetDevice(1024, 768, 16, 0)
gfx.Back buffer pixel format: R5G6B5
gfx.Depth buffer pixel format: D24X8


Tadd
- WarbleWare

#28 reana1   Members   -  Reputation: 277

Like
Likes
Like

Posted 14 March 2004 - 11:08 AM

Update:
- Win98 in 60Hz had no effect.
- Installed latest DX version. This didn''t help ALT+TAB, but I did notice now that when I hit ALT+TAB the windows mouse cursor will sometimes blink from behind the Tower window. Not sure if that''s because of the new DX version or if my mouse was just not behind the window before or if I just didn''t notice.
- The new DX version does appear to affect the log file. The first time I tried to switch to fullscreen, the log was the same as my previous one except these 3 mesh lines at the end are no longer there:

gfx.DestroyMesh(1)
gfx.CreateMesh()
gfx.MeshID = 2

The next time I ran Tower, I got this log file and a message box containing the error at the end of the log file. It appeared to try to start in Fullscreen mode.

gfx.Desktop width: 1024
gfx.Desktop height: 768
gfx.Desktop format: R5G6B5
gfx.1 graphics adapter(s) available

====
gfx.Adapter: 0
gfx.Driver: NVDD32.DLL
gfx.Description: NVIDIA GeForce3 Ti 200
gfx.Version: 4.13.1.2832
gfx.VendorID: 000010DE
gfx.DeviceID: 00000201
gfx.SubSysID: 00301545
gfx.Revision: 000000A3
gfx.SubSysID: 00301545
gfx.GetDeviceCaps(0) failed (8876086A)
====
gfx.CreateWindowedDevice(800, 600)
Failed to create a windowed device. Your primary video accelerator may not support windowed rendering.

Then the next time I ran it, it was back in Windowed mode and fine (until I switch to full screen again). This last time the log file went back to the original (the 3 mesh lines were back in). Hope that helps somehow.

Also I meant to mention that I did play a game in Win98 in windowed mode (before I had just been in the menu). Windowed does work fine for me.

Tadd
- WarbleWare

#29 Andreas Jonsson   Moderators   -  Reputation: 3450

Like
Likes
Like

Posted 14 March 2004 - 11:44 AM

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.



int scCGraphics::CreateFullscreenDevice(scHWND wnd, int w, int h, int bpp)
{
Log.Write(LOGTYPE_DEBUG, "gfx.CreateFullscreenDevice(%d, %d, %d)\n", w, h, bpp);

if( d3d8 == 0 ) return -1;
ReleaseDevice();

HRESULT hr;

// Check the capabilities of this adapter

if( CheckCapabilities(adapter) < 0 )
return -1;

D3DFORMAT format;
if( bpp == 16 )
{
// Choose the best pixel format for the backbuffer

D3DFORMAT formats[] = {D3DFMT_R5G6B5, D3DFMT_X1R5G5B5};
int numFormats = sizeof(formats)/sizeof(D3DFORMAT);
for( int n = 0; n < numFormats; n++ )
if( SUCCEEDED(d3d8->CheckDeviceType(adapter, D3DDEVTYPE_HAL, formats[n], formats[n], FALSE)) )
{
format = formats[n];
break;
}

if( n == numFormats )
{
Log.Write(LOGTYPE_DEBUG, "gfx.Couldn''t find suitable pixel format for back buffer\n");
return -1;
}
}
else if( bpp == 24 )
{
// Choose the best pixel format for the backbuffer

D3DFORMAT formats[] = {D3DFMT_R8G8B8, D3DFMT_X8R8G8B8};
int numFormats = sizeof(formats)/sizeof(D3DFORMAT);
for( int n = 0; n < numFormats; n++ )
if( SUCCEEDED(d3d8->CheckDeviceType(adapter, D3DDEVTYPE_HAL, formats[n], formats[n], FALSE)) )
{
format = formats[n];
break;
}

if( n == numFormats )
{
Log.Write(LOGTYPE_ERROR, "gfx.Couldn''t find suitable pixel format for back buffer\n");
return -1;
}
}

Log.Write(LOGTYPE_DEBUG, "gfx.Back buffer pixel format: %s\n", IdentifyFormat(format));

// Choose the best depth stencil format available

D3DFORMAT depthFormat;
D3DFORMAT depthFormats[] = {D3DFMT_D32, D3DFMT_D24X8, D3DFMT_D16};
int numFormats = sizeof(depthFormats)/sizeof(D3DFORMAT);
for( int n = 0; n < numFormats; n++ )
if( SUCCEEDED(d3d8->CheckDepthStencilMatch(adapter, D3DDEVTYPE_HAL, format, format, depthFormats[n])) )
{
depthFormat = depthFormats[n];
break;
}

if( n == numFormats )
{
Log.Write(LOGTYPE_ERROR, "gfx.Couldn''t find suitable format for depth buffer\n");
return -1;
}

Log.Write(LOGTYPE_DEBUG, "gfx.Depth buffer pixel format: %s\n", IdentifyFormat(depthFormat));

// Setup the presentation parameters

ZeroMemory( &pparam, sizeof(pparam) );
pparam.BackBufferWidth = w;
pparam.BackBufferHeight = h;
pparam.BackBufferFormat = format;
pparam.BackBufferCount = 1;
pparam.MultiSampleType = D3DMULTISAMPLE_NONE;
pparam.SwapEffect = D3DSWAPEFFECT_DISCARD;
pparam.hDeviceWindow = (HWND)wnd;
pparam.Windowed = FALSE;
pparam.EnableAutoDepthStencil = TRUE;
pparam.AutoDepthStencilFormat = depthFormat;
pparam.Flags = D3DPRESENTFLAG_LOCKABLE_BACKBUFFER; // TODO: Make optional as it may incurr a performance penalty on some cards

pparam.FullScreen_RefreshRateInHz = 0;
pparam.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;

// Try with hardware vertex processing first

hr = d3d8->CreateDevice(adapter, D3DDEVTYPE_HAL, (HWND)wnd,
D3DCREATE_HARDWARE_VERTEXPROCESSING,
&pparam, &device);
if( FAILED(hr) )
{
Log.Write(LOGTYPE_DEBUG, "gfx.Failed to create device with hardware vertex processing, trying software (%X)\n", hr);

// Try again with software vertex processing

hr = d3d8->CreateDevice(adapter, D3DDEVTYPE_HAL, (HWND)wnd,
D3DCREATE_SOFTWARE_VERTEXPROCESSING,
&pparam, &device);
if( FAILED(hr) )
{
Log.Write(LOGTYPE_ERROR, "gfx.Failed to create device with software vertex processing (%X)\n", hr);

return -1;
}
}

return InitializeDevice();
}



int scCGraphics::CreateWindowedDevice(scHWND wnd, int w, int h)
{
Log.Write(LOGTYPE_DEBUG, "gfx.CreateWindowedDevice(%d, %d)\n", w, h);


if( d3d8 == 0 ) return -1;
ReleaseDevice();

HRESULT hr;

// Check the capabilities of this adapter

if( CheckCapabilities(adapter) < 0 )
return -1;

// Can it render in windowed mode?

D3DCAPS8 caps;
hr = d3d8->GetDeviceCaps(adapter, D3DDEVTYPE_HAL, &caps);
if( FAILED(hr) )
return -1;

if( caps.Caps2 & D3DCAPS2_CANRENDERWINDOWED == 0 )
{
Log.Write(LOGTYPE_ERROR, "gfx.Device can''t render in windowed mode\n");
return -1;
}

// Check if the desktop display format is acceptable

if( !(displayMode.Format == D3DFMT_R8G8B8 ||
displayMode.Format == D3DFMT_X8R8G8B8 ||
displayMode.Format == D3DFMT_R5G6B5 ||
displayMode.Format == D3DFMT_X1R5G5B5) )
{
Log.Write(LOGTYPE_DEBUG, "gfx.Desktop mode isn''t supported\n");
return -1;
}

// Choose the best pixel format for the backbuffer

D3DFORMAT format ;
D3DFORMAT formats[] = {D3DFMT_R8G8B8, D3DFMT_X8R8G8B8, D3DFMT_R5G6B5, D3DFMT_X1R5G5B5};
int numFormats = sizeof(formats)/sizeof(D3DFORMAT);
for( int n = 0; n < numFormats; n++ )
if( SUCCEEDED(d3d8->CheckDeviceType(adapter, D3DDEVTYPE_HAL, displayMode.Format, formats[n], TRUE)) )
{
format = formats[n];
break;
}

if( n == numFormats )
{
Log.Write(LOGTYPE_DEBUG, "gfx.Couldn''t find suitable pixel format for backbuffer\n");
return -1;
}

Log.Write(LOGTYPE_DEBUG, "gfx.Back buffer pixel format: %s\n", IdentifyFormat(format));

// Choose the best depth stencil format available

D3DFORMAT depthFormat;
D3DFORMAT depthFormats[] = {D3DFMT_D32, D3DFMT_D24X8, D3DFMT_D16};
numFormats = sizeof(depthFormats)/sizeof(D3DFORMAT);
for( n = 0; n < numFormats; n++ )
if( SUCCEEDED(d3d8->CheckDepthStencilMatch(adapter, D3DDEVTYPE_HAL, displayMode.Format, format, depthFormats[n])) )
{
depthFormat = depthFormats[n];
break;
}

if( n == numFormats )
{
Log.Write(LOGTYPE_DEBUG, "gfx.Couldn''t find suitable depth buffer format\n");
return -1;
}

Log.Write(LOGTYPE_DEBUG, "gfx.Depth buffer pixel format: %s\n", IdentifyFormat(depthFormat));

// Setup the presentation parameters

ZeroMemory( &pparam, sizeof(pparam) );
pparam.BackBufferWidth = w;
pparam.BackBufferHeight = h;
pparam.BackBufferFormat = format;
pparam.BackBufferCount = 1;
pparam.MultiSampleType = D3DMULTISAMPLE_NONE;
pparam.SwapEffect = D3DSWAPEFFECT_DISCARD;
pparam.hDeviceWindow = (HWND)wnd;
pparam.Windowed = TRUE;
pparam.EnableAutoDepthStencil = TRUE;
pparam.AutoDepthStencilFormat = depthFormat;
pparam.Flags = D3DPRESENTFLAG_LOCKABLE_BACKBUFFER; // TODO: Make optional as it may incurr a performance penalty on some cards

pparam.FullScreen_RefreshRateInHz = 0;
pparam.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;

// Try with hardware vertex processing first

hr = d3d8->CreateDevice(adapter, D3DDEVTYPE_HAL, (HWND)wnd,
D3DCREATE_HARDWARE_VERTEXPROCESSING,
&pparam, &device);
if( FAILED(hr) )
{
Log.Write(LOGTYPE_DEBUG, "gfx.Failed to create device with hardware vertex processing, trying software (%X)\n", hr);

// Try again with software vertex processing

hr = d3d8->CreateDevice(adapter, D3DDEVTYPE_HAL, (HWND)wnd,
D3DCREATE_SOFTWARE_VERTEXPROCESSING,
&pparam, &device);
if( FAILED(hr) )
{
Log.Write(LOGTYPE_ERROR, "gfx.Failed to create device with software vertex processing (%X)\n", hr);

return -1;
}
}

return InitializeDevice();
}



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

#30 Zanthos   Members   -  Reputation: 300

Like
Likes
Like

Posted 14 March 2004 - 11:45 PM

That game kicks ass(and works fine), certainly a new twist to falling blocks

Spec:
CPU: P4 2.4Ghz (non HT)
RAM: 512Mb DDR 400
Gfx: GeForce 3 Ti 200
OS: Win2k Pro SP4

.:Cubicle2:.

#31 nonpop   Members   -  Reputation: 122

Like
Likes
Like

Posted 15 March 2004 - 03:01 AM

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: 1024
gfx.Desktop height: 768
gfx.Desktop format: X8R8G8B8
gfx.1 graphics adapter(s) available
====
gfx.Adapter: 0
gfx.Driver: ati2dvag.dll
gfx.Description: RADEON 8500 SERIES
gfx.Version: 6.14.10.6430
gfx.VendorID: 00001002
gfx.DeviceID: 0000514C
gfx.SubSysID: 013A1002
gfx.Revision: 00000000
gfx.SubSysID: 013A1002
gfx.Can render in windowed mode: Yes
gfx.Allow source blending with source alpha: Yes
gfx.Allow destination blending with inverse source alpha: Yes
gfx.Allow alpha channel in textures: Yes
gfx.Max texture size: 2048 x 2048
gfx.Max texture aspect ratio: 2048
gfx.Max primitive count: 65535
gfx.Max vertex index: 16777215
====
gfx.CreateFullscreenDevice(1024, 768, 32)
gfx.Back buffer pixel format: Unknown format
gfx.Couldn't find suitable format for depth buffer
Failed 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]

#32 reana1   Members   -  Reputation: 277

Like
Likes
Like

Posted 15 March 2004 - 03:27 AM

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

#33 Jingo   Members   -  Reputation: 582

Like
Likes
Like

Posted 15 March 2004 - 03:42 AM

Nice game

Works fine on my GeForce 5200, 2.7Ghz Celeron.

#34 Jolle   Members   -  Reputation: 178

Like
Likes
Like

Posted 15 March 2004 - 03:45 AM

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


#35 Andreas Jonsson   Moderators   -  Reputation: 3450

Like
Likes
Like

Posted 15 March 2004 - 06:27 AM

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

#36 nonpop   Members   -  Reputation: 122

Like
Likes
Like

Posted 15 March 2004 - 07:16 AM

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.


#37 Andreas Jonsson   Moderators   -  Reputation: 3450

Like
Likes
Like

Posted 15 March 2004 - 10:34 AM

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

#38 DarkPixel   Members   -  Reputation: 136

Like
Likes
Like

Posted 15 March 2004 - 10:50 AM

Just worked fine for me !

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

#39 Andreas Jonsson   Moderators   -  Reputation: 3450

Like
Likes
Like

Posted 15 March 2004 - 12:48 PM

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

#40 reana1   Members   -  Reputation: 277

Like
Likes
Like

Posted 15 March 2004 - 03:00 PM

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




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS