Crash on Start up

HI All,

Unable to run the game on my machine. The splash screen appears and it crases The error I get on starting is: ERROR IN FUNCTION: DIRECTINPUTCREATE

Error occurs regardless to windowed or resolution.

Any help or suggestions appreciated, have not found this error in the forums.

Cheers.

From the logs:

errors.txt

20/6/2010 - 3::40 - D3DERR_INVALIDCALL
20/6/2010 - 3::40 - CreateDevice
20/6/2010 - 3::40 - D3DERR_INVALIDCALL
20/6/2010 - 3::40 - CreateDevice failed again
20/6/2010 - 3::40 - Failed to initialise 3D Engine:…\src\Game.cpp 303

drawdebug.txt

Initialising 3D Engine
Driver : ati2dvag.dll
Description : ATI Radeon HD 3800 Series
DeviceName : \.\DISPLAY1
Checking For Shader Support
NumSimultaneousRTs:4
hal_caps.PixelShaderVersion >= D3DPS_VERSION(2, 0)
About to Create 3D Device with width: 1024 and height : 768
Attempting hardware Vertex Processing
Finished initialising 3D Engine
Initialising Render target of 512 X 512 rt_ship
rt_ship
Initialising Render target of 1024 X 1024 rt_offscreen1
rt_offscreen1
Initialising Render target of 1024 X 1024 rt_offscreen2
rt_offscreen2
Initialising Render target of 1024 X 1024 rt_transition
rt_transition
titlescreen1024.bmp

debug.txt

----DEBUG FILE----
Windows XP detected
GSB Debug File. App version Full 1.41
Desktop resolution is 1280 x 768
Initialising Direct3D
Initialising global vertex buffer
creating render targets
success in initialising 3D
Initialising Direct Input
DirectInputCreate
Unknown Error

Have you tried redownloading the game and your video card drivers?

This is directx related. something to do with input, weird keyboard or mouse drivers maybe? possibly a keylogger? maybe using some graphics tablet that is interfering with directinput?
Maybe re-installing the directx runtime would fix it, although the game does that on install. It sounds like a system, directx thing, mroe than a specific to GSB thing.

I had GSB 1.36 installed (on Windows XP), and had the same problem. Tried the following to get it working:

  • Uninstalled, deleted My Documents\My Games\GratuitousSpaceBattles, reinstalled.
  • Downloaded the latest GSB 1.42 using the download link sent to me when I bought the game, and installed that (first install over 1.36, when that didn’t work I uninstalled 1.36 and wiped the GSB folder in My Games, then installed 1.42 again).
  • Upgraded my NVidia drivers to the latest version, uninstalled 1.42, cleaned My Games folder, reinstalled 1.42.
  • Downloaded and installed the latest DirectX 9, uninstalled 1.42, cleaned My Games, reinstalled 1.42.

None of these steps helped. I keep getting the same error on startup.

From errors.txt:

26/6/2010 - 22::7 - D3DERR_INVALIDCALL
26/6/2010 - 22::7 - CreateDevice
26/6/2010 - 22::7 - D3DERR_INVALIDCALL
26/6/2010 - 22::7 - CreateDevice failed again
26/6/2010 - 22::7 - Failed to initialise 3D Engine:…\src\Game.cpp 303

drawdebug.txt:

Initialising 3D Engine
Driver : nv4_disp.dll
Description : NVIDIA GeForce 7900 GTX
DeviceName : \.\DISPLAY1
Checking For Shader Support
NumSimultaneousRTs:4
hal_caps.PixelShaderVersion >= D3DPS_VERSION(2, 0)
About to Create 3D Device with width: 0 and height : 0
Attempting hardware Vertex Processing
Attempting software Vertex Processing

Any assistance would be greatly appreciated.

Sigh, moments after posting my original message I found that my prefs.ini file was empty. Populated it with:

[prefs]
width = 1920
height = 1200
windowed = 0
sound_channels = 512

(Which I had on a previous Windows installation on a different hard drive)

This makes the game progress a little further before crashing: I get to see the main title screen, but nothing happens after that. And when I click the mouse the game crashes. Now the problem seems to be related to sound. Weird thing is that an older version of GSB worked just fine on my previous Windows installation on the same hardware.

debug.txt:

----DEBUG FILE----
Windows XP detected
GSB Debug File. App version Full 1.42
Desktop resolution is 1920 x 1200
Initialising Direct3D
Initialising global vertex buffer
creating render targets
success in initialising 3D
Initialising Direct Input
Finished Initialising Direct Input
Initialising Sound Engine

drawdebug.txt:

Initialising 3D Engine
Driver : nv4_disp.dll
Description : NVIDIA GeForce 7900 GTX
DeviceName : \.\DISPLAY1
Checking For Shader Support
NumSimultaneousRTs:4
hal_caps.PixelShaderVersion >= D3DPS_VERSION(2, 0)
About to Create 3D Device with width: 1920 and height : 1200
Attempting hardware Vertex Processing
Finished initialising 3D Engine
Initialising Render target of 512 X 512 rt_ship
rt_ship
Initialising Render target of 2048 X 2048 rt_offscreen1
rt_offscreen1
Initialising Render target of 2048 X 2048 rt_offscreen2
rt_offscreen2
Initialising Render target of 2048 X 2048 rt_transition
rt_transition
titlescreen2048.bmp
cwfont20.dds
zekton16.dds

errors.txt:

26/6/2010 - 22::38 - ERROR - FMOD[Failed to init FMOD] (58) Error creating hardware sound buffer.
:…\src\GUI_Sounds.cpp 654

I’ve tried setting HARDWARESOUND = 0.00 in config.txt, but this makes no difference. Besides, I had hardware sound enabled under the previous installation.

If there’s anyone who can make sense of my confused postings and assist with a solution I’d be eternally grateful :slight_smile:

I always think the best debugging process is to start with the absolute first thing that goes wrong.
Prefs.ini should not be empty. It should be written by the game. It could be a permissions issue, in that somehow the game is being prevented from writing files, which could trip it up in all kinds of places. It only wriets to places you have permissions (such as an offshoot of MyDocuments), but maybe some security software or high-security setting could be interfering. You can always try the nuclear options of running it as administrator or reinstalling it to some offshoot of MyDocuments to be 100% sure.
Have you run the directx diagnostics program to check that directx itself is working ok?

Edit: fixed - see last paragraph.

Hi,

Thanks for your reply.

I followed your advice, and uninstalled the game, disabled antivirus, ThreatFire, and the firewall just to be sure, and reinstalled. The installer by default starts the game, and this brings up the following error message before crashing (from errors.txt):

27/6/2010 - 20::10 - ERROR - FMOD[Failed to init FMOD] (58) Error creating hardware sound buffer.
:…\src\GUI_Sounds.cpp 654

When I check the My Games folder I see that the GratuitousSpaceBattles folder structure and contents have been created, but that the prefs.ini file is empty. So I’m guessing this is the root problem - something is causing the sound system to fail and this aborts the proper creation of the file. Since the rest of the files get created it would seem that this isn’t related to a permissions problem, but I checked my user account’s effective permissions on the prefs.ini file, and it shows all the permissions as ticked. My account is a member of the administrators group.

I ran dxdiag, and performed all the tests that the different tabs allow. All tests completed successfully (including sound), and none of the tabs report any problems. On the off chance I set the sound tab’s hardware acceleration level from full to no acceleration, wiped the GSB folder in My Games, and reinstalled, but this makes no difference.

Aaaah, just managed to fix it: was searching the forum for the sound error message and trying all the solutions that people suggested, until I stumbled across a message from you that suggested that the wrong speaker setup may be selected in Control Panel -> Sounds And Audio Devices. And that turned out to be the problem.

So, many thanks for the suggestions, past and present! Now that I have the basic setup working I can install the expansions again and resume playing!

This turned out to be the solution to my problem as well - I have speaker phones and headphones and will often switch between them if I’m doing one of my brother’s challenges so he can hear sound too. When I tried running GSB this morning it displayed the start screen but without any button bars, etc., and clicking anywhere would cause it to crash. Plugging in a sound device solved this problem… apparently I had forgotten to plug one of them back when I turned my computer off last night but that really shouldn’t cause the program to stop working. At most it should warn you that you have no sound - crashing because there isn’t one is just ridiculous. Aside from this and having undeletable challenges (which I fixed by searching the forum), my GSB experience has been pretty good.

I had a similar thing and thought I’d share my findings.

Whenever I tried to launch the game it’d crash even though I had previously played it.

16/8/2010 - 21::23 - D3DERR_INVALIDCALL
16/8/2010 - 21::23 - CreateDevice
16/8/2010 - 21::23 - D3DERR_INVALIDCALL
16/8/2010 - 21::23 - CreateDevice failed again
16/8/2010 - 21::23 - Failed to initialise 3D Engine:…\src\Game.cpp 305

I had a poke around the ini files and fiddled with the resolution to make it smaller and this worked. Basically my laptop had been plugged into my big screen (1920 x 1200) but when I was undocked I was running at 1440 x 900. Looks like D3D was trying to init for a screen resolution the laptop wouldn’t support.