LEGO® Harry Potter: Years 1-4

LEGO® Harry Potter: Years 1-4

Not enough ratings
Failed to create d3d device - Lego Harry Potter / Lego Star Wars
By Casual Cucumber
This guide aims to help with the error "Failed to create d3d device".
   
Award
Favorite
Favorited
Unfavorite
Disclaimer
I am no special tech guy. This is simply a guide I have made after trying to solve the d3d error on my own computer. Therefore I can't be held responsible if you can't get it to work, I am simply writing a summary of all the fixes I tried to hopefully make it a easier time for you.

I made this guide for Lego Star Wars and Harry Potter, but hopefully any of these suggestions can help you if you're trying to get another game to work. The common problem with Lego Harry Potter and Lego Star Wars is that the game can't start because your screen can't display 60Hz, but displays higher than this value.
What is D3D?
D3D or Direct3D is the hardware accelerated graphics rendering API used in games that uses 3D graphics.
Change display
There is an issue with this game requiring 60Hz and a lot of modern laptops can't display this. To change the display of your screen:
Open system settings>Display>Advanced Display Settings>Display Adapter Properties for Display>Monitor>Select 60hz>Apply

If this doesn't work, you can alternatively plug your pc into another screen that can display 60Hz and a game should run fine.

Some users has also had succes in the nvidia control panel for the game and changing the display options.

Updating drivers
The error is a common problem if your drivers are out of dates. Simply update your video drivers. Make sure your computers OS is up to date and your hardware is up to date.

If any of the other fixes in this guide didn't work, you might have to reinstall your drivers.
Simple solution
1. Make sure the game is running on your dedicated graphic card, some users have reported the game tried to run on the integrated graphic card or similar.
2. Verify the local cache, then restart your pc.
3. Run the game as administrator
4. Run compatibility check on legoharrypotter.exe file (not working try running the game in compatibility for another windows OS.

5. If this didn't work delete the game, restart your pc and reinstall the game.

Messing with the files
Some users had succes changing values in the files and in that way getting the game to start.

1. head to the PC configs for the game - this is done my finding the %appdata% folder --> Roaming --> WB games --> lego Harry Potter
Or use this path if you are having issues:
C:\Users\${USERNAME}\AppData\Roaming\Warner Bros. Interactive Entertainment - (its your username)

Inside the Harry Potter folder you will find a text file named "pcconfig" open this. Here you're gonna change some values:
Set the values
ScreenWidth 1920
ScreenHeight 1080
WindowWidth 1920
WindowHeight 1080
to this and also change the screen refresh rate in the folder to 60 and the vsync to 1.


Launch options
Right click on the game in your library. Click properties then set launch option:
Write -autoconfig
If this didn't work try writing "dxlevel 81" or "dxlevel90". Otherwise try forcing the game to start in windowed by writing "–windowed" or launching it in 1920x1080p with "-screen-width 1920 -screen-height 1080"
Game can't launch due to speakers
Some users have reported the game cant launch because of some setting related with sound. For this fix I am gonna link to this Harry Potter guide:
https://steamcommunity.com/sharedfiles/filedetails/?id=671142648
If this does work please give him an upvote.

I myself couldn't get this to work, however there is a workaround. Linking your PC up to a different PC screen or television might do the trick. I haven't been able to solve the problem, but when I wired my laptop up with my TV using a HDMI, the game ran perfectly - this might be related to the sound fix or the display fix, I don't know. But its a workaround that worked on my computer when none of these other suggestions worked.
None of the solutions worked?
If none of the other fixes worked, here is the last solution.
Download the program DxWnd from here:

https://sourceforge.net/projects/dxwnd/

The program can force open the game and create the D3D window. You can play the game normally, but there will be a few graphically errors (I only saw one) and you won't be able to change the video game settings without the game crashing.
3 Comments
Casual Cucumber  [author] Dec 12, 2023 @ 6:55am 
@Bubutype Thanks for sharing what worked for you!! Hopefully someone else can benefit from your good comment!

@Willdumb Happy to hear it works!
WillDumb Dec 12, 2023 @ 6:31am 
Thank you I pluged my HDMI1 into my tv and it worked
Bubutype Jul 16, 2023 @ 8:45am 
I have a gaming laptop with an Nvidia GPU.
I tried everything on this guide and nothing worked.
After multiple hours of trying I found a guide on how to create a virtual monitor:

https://www.youtube.com/watch?v=ybHKFZjSkVY

With this guide, and the "pcconfig" set to "1920x1080" "60 Hz" "VirtualSynch 1" and everything below "MouseSensitivity 10" I have set to 0.
My Nvidia systemsettings are still at 1080p with 144 Hz.
The Windows 10 settings are on "dublicate this monitor" (with the virtual monitor present).