LEGO® Harry Potter: Years 1-4

LEGO® Harry Potter: Years 1-4

Not enough ratings
Fixing the "Failed to create D3D device" error
By sambrands
Solutions for fixing the "Failed to create D3D device" error (code 0x8876086c).
   
Award
Favorite
Favorited
Unfavorite
Introduction
This will be a guide to help you (probably) solve the "Failed to create D3D device" error, with error code 0x8876086c. I will start with the most common solutions, as they are the easiest and work for the majority of people.

There are many things that can cause this error. After having this error for months and trying everything I have read online, I finally fixed it. Not because I read something new, but because a colleague suggested I tried something new (which we'll get to in a second).

I hope this will help someone who thought they tried everything to get this game to work, just like I did.

If you have read and tried every possible fix online (just like I did) and still can't get it to work, you may want to skip to "Setting custom PC refresh rate". This is the only/first fix that worked for me after trying almost everything I could find.
Updating drivers
Let me start by saying this is unlikely to be the problem as this is an old game, but it may help and prevent problems with other games.

To update your drivers:

Nvidia:
  1. Open GeForce Experience
  2. Head over to the Drivers tab
  3. Click "Check for updates"
  4. Install the update, if available
AMD:
  1. Open AMD Radeon Software
  2. On the Home tab, check the top right corner
  3. If an update is available, install it by clicking the "Download" button and "Install" after the download is finished
Launch Options
In Steam you can add launch options to games. These are certain settings Steam uses to launch your games. They can help your game run on specific hardware and fix technical issues.

To set launch options, follow the steps below:
  1. Go to your Steam library
  2. Select the game you want to add launch options to
  3. Click on the cog icon on the right
  4. Under 'General', enter the launch options in the field and close the popup

Some launch flags to try (and combinations of these flags):
  • -autoconfig
  • -w 1920
  • (Optional)
    -h 1080
Audio bitrate
Because this is an old game, some newer technology is 'too good' for this game. It sounds silly, but it's really what's happening.

One possible fix is decreasing your audio quality. This can be done in 2 ways. The result will be the same, so feel free to pick either one.

Windows settings
  1. Open Windows settings (Win + i or search Settings in the start menu)
  2. Go to System > Sound and click on your preferred output device (probably something like 'Speakers' or 'Headphones')
  3. Under 'Output settings' > Format, try setting the quality to something else. Most common is 16 bit, 44100 Hz or 24 bit, 48000 Hz.
Control panel
  1. In Windows search, search for Control Panel and open it
  2. Go to 'Hardware and Sound' > 'Sound'
  3. Find your preferred output device (probably something like 'Speakers' or 'Headphones') and click on it
  4. Click on 'Properties'
  5. Go to the Advanced tab and select another format. Most common is 16 bit, 44100 Hz or 24 bit 48000 Hz.
  6. Click on Apply
Edit config file
You can change some settings in the game's config file. It's usually located in the following directory:
C:\Users\{your username}\AppData\Roaming\WB Games\LEGO® Harry Potter™
You can edit the pcconfig.txt file to change some settings.

For example, something that seems to fix the issue for a lot of people is setting the window size.
Try the following settings (just change the default values to the ones below):
ScreenWidth 1920
ScreenHeight 1080
WindowWidth 1920
WindowHeight 1080

If that doesn't work, try setting the refresh rate to 60:
ScreenRefreshRate 60

Kind of a last resort, try enabling VSync:
VerticalSync 1
Setting application refresh rate (Nvidia)
To manually set the application's refresh rate in Nvidia Control Panel, do the following:
  1. Open Nvidia Control Panel
  2. Go to "Manage 3D settings"
  3. Go to "Program Settings"
  4. Select LEGO Harry Potter: Years 1-4 from the dropdown (screenshot[i.imgur.com] for steps 2-4)
  5. Look for the "Max Frame Rate" setting and set the slider to 60
Setting custom PC refresh rate
Now this one is what fixed it for me, and I hope it can help other people. I haven't found this solution anywhere online, but it was the only one that worked for me.

If you have a PC or laptop with a high refresh rate display, you're kind of unlucky when it comes to playing some older games - and that's also the case for LEGO Harry Potter Years 1-4. I have a Lenovo Legion 5 (82JU) with a 165Hz display, and as I mentioned before, some modern hardware/technology is too good for these old games. LEGO Harry Potter Years 1-4 can only be played at 60Hz.

To change the refresh rate of your display:
  1. Open Windows Settings
  2. Go to System -> Display -> Advanced Display
  3. You'll see a dropdown to set the refresh rate:
  4. Open the dropdown and select 60Hz

If there is no other refresh rate available
Now if you're as unlucky as I was, there is no 60Hz option. As you can see, I only have the option to set it to 165Hz:



First world problems, am I right? Lucky for us, I have a solution:
  1. Open Nvidia Control panel (press the Windows button and search for it)
  2. Go to the Display section (screenshot[i.imgur.com])

    NOTE: If the Display section isn't there, go to "Manage Display mode" and set the Display Mode to NVIDIA GPU only. You'll most likely get a warning popup (that looks like an error) saying it can cause certain applications to crash. Just click "close". Then, click "Apply" in the bottom right corner. You'll get another popup asking if you want to install the new settings, click "Yes". Now there are more settings available. Now follow the steps below.

  3. Go to the "Change resolution" section
  4. Click on the "Customize" button
  5. Then, in the popup window, click on "Create Custom Resolution..."
  6. You'll get another popup windows. This window has many settings for your display. You'll only need to worry about one: refresh rate. Set the "Refresh rate (Hz)" to 60 and click "Test". (screenshot[i.imgur.com])
  7. If the test is succesful, you'll get a popup saying just that. It also asks if you want to save/install the resolution. Click "Yes".

If everything went well, the resolution is now saved to your computer. To make sure, do the following:
  1. Go to Windows Settings
  2. Go to System -> Display -> Advanced Display
  3. You'll probably have a dropdown at the top to select your display:
    Display 1 (Internal display) is probably selected by default and is listed as not active:
  4. Select Display 2 from the dropdown
  5. The refresh rate dropdown should now have the option to set it to 60Hz (you DON'T have to select it):

Now, try starting LEGO Harry Potter Years 1-4 through Steam. You don't have to manually change the refresh rate everytime you start and stop playing, it should do it automatically. It should work without any problems. If it still gives the error, try setting the refresh rate for LEGO Harry Potter Years 1-4 manually in the pcconfig.txt file or in Nvidia Control Panel.
Sources
Failed to create D3D Device:
https://steamproxy.net/steamhelp/en/faqs/view/102E-D170-B891-7145

Setting Game Launch Options:
https://steamproxy.net/steamhelp/en/faqs/view/7D01-D2DD-D75E-2955

Config file settings:
https://steamproxy.net/app/21130/discussions/0/627456486827509615/

Adding a custom resolution/refresh rate to your PC/laptop:
My colleague :)

Updating AMD drivers:
https://www.youtube.com/watch?v=jpBRTYOSaEw
2 Comments
カスルー 27 May @ 7:15am 
@Mynx-In-Match same
Mynx-In-Match 23 Oct, 2023 @ 5:45pm 
Tried everything. None of it worked. Still getting the error message.