🎉 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
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]

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

Advertisement
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]
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: 0gfx.Driver: NVDD32.DLLgfx.Description: NVIDIA GeForce3 Ti 200gfx.Version: 4.13.1.2832gfx.VendorID: 000010DEgfx.DeviceID: 00000201gfx.SubSysID: 00301545gfx.Revision: 000000A3gfx.SubSysID: 00301545gfx.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: 4096 x 4096gfx.Max texture aspect ratio: 0gfx.Max primitive count: 1048575gfx.Max vertex index: 1048575====gfx.CreateWindowedDevice()gfx.CreateTexture()gfx.TextureID = 0gfx.CreateTexture()gfx.TextureID = 1gfx.CreateTexture()gfx.TextureID = 2gfx.CreateTexture()gfx.TextureID = 3gfx.CreateTexture()gfx.TextureID = 4gfx.CreateTexture()gfx.TextureID = 5gfx.CreateTexture()gfx.TextureID = 6au.CreateSound()au.Sound ID = 0gfx.CreateMesh()gfx.MeshID = 0au.CreateSound()au.Sound ID = 1au.CreateSound()au.Sound ID = 2au.CreateSound()au.Sound ID = 3au.CreateSound()au.Sound ID = 4au.CreateSound()au.Sound ID = 5au.CreateSound()au.Sound ID = 6gfx.CreateMesh()gfx.MeshID = 1au.CreateSound()au.Sound ID = 7au.CreateSound()au.Sound ID = 8au.CreateSound()au.Sound ID = 9gfx.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
Tadd- WarbleWare
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.
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

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

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: 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.6422gfx.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(640, 480, 24)gfx.Back buffer pixel format: X8R8G8B8gfx.Depth buffer pixel format: D32gfx.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.

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: 1024gfx.Desktop height: 768gfx.Desktop format: R5G6B5gfx.1 graphics adapter(s) available====gfx.Adapter: 0gfx.Driver: NVDD32.DLLgfx.Description: NVIDIA GeForce3 Ti 200gfx.Version: 4.13.1.2832gfx.VendorID: 000010DEgfx.DeviceID: 00000201gfx.SubSysID: 00301545gfx.Revision: 000000A3gfx.SubSysID: 00301545gfx.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: 4096 x 4096gfx.Max texture aspect ratio: 0gfx.Max primitive count: 1048575gfx.Max vertex index: 1048575====gfx.CreateWindowedDevice(800, 600)gfx.Back buffer pixel format: R5G6B5gfx.Depth buffer pixel format: D24X8au.CreateDevice(2, 22100)gfx.CreateTexture()gfx.TextureID = 0gfx.CreateTexture()gfx.TextureID = 1gfx.CreateTexture()gfx.TextureID = 2gfx.CreateTexture()gfx.TextureID = 3gfx.CreateTexture()gfx.TextureID = 4gfx.CreateTexture()gfx.TextureID = 5gfx.CreateTexture()gfx.TextureID = 6au.CreateSound()au.Sound ID = 0gfx.CreateMesh()gfx.MeshID = 0au.CreateSound()au.Sound ID = 1au.CreateSound()au.Sound ID = 2au.CreateSound()au.Sound ID = 3au.CreateSound()au.Sound ID = 4au.CreateSound()au.Sound ID = 5au.CreateSound()au.Sound ID = 6gfx.CreateMesh()gfx.MeshID = 1au.CreateSound()au.Sound ID = 7au.CreateSound()au.Sound ID = 8au.CreateSound()au.Sound ID = 9gfx.DestroyMesh(1)gfx.CreateMesh()gfx.MeshID = 2gfx.ResetDevice(1024, 768, 16, 0)gfx.Back buffer pixel format: R5G6B5gfx.Depth buffer pixel format: D24X8


Tadd
- WarbleWare
Tadd- WarbleWare
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: 1024gfx.Desktop height: 768gfx.Desktop format: R5G6B5gfx.1 graphics adapter(s) available====gfx.Adapter: 0gfx.Driver: NVDD32.DLLgfx.Description: NVIDIA GeForce3 Ti 200gfx.Version: 4.13.1.2832gfx.VendorID: 000010DEgfx.DeviceID: 00000201gfx.SubSysID: 00301545gfx.Revision: 000000A3gfx.SubSysID: 00301545gfx.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
Tadd- WarbleWare
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, ∩︀);	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

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

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:.

This topic is closed to new replies.

Advertisement