• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
ProgrammerDX

D3DXCreateEffectFromFile major bug?

7 posts in this topic

On some of my client's PC's, D3DXCreateEffectFromFile fails regardless of the content of the .fx file.

 

D3DXCreateEffectFromFile returns an undocumented HRESULT value: 0x8007007E

 

Parameter ppCompilationErrors is NULL so it's not possible to retrieve any further error information.

 

It fails on some PC's, but on most it's fine!

 

So, I have a downloaded an .exe of arbitrary tutorial that shows .fx files and supplied that to the client's with the problem, and that works just fine. That was build on a DirectX version from 2006/2007 (d3dx_30.dll). So it's not about shaders not being supported or something!

 

I then rebuild that tutorial's project on my IDE (DirectX SDK June 2010), supplied the .exe to the client's experiencing this bug and then the function bugs again!

 

So, then I thought it might be the different DirectX SDK's.

 

I decided to download an old DirectX SDK, in my case August 2007.

 

I compiled the .exe with the old DirectX SDK and then the .exe and effect runs just fine!

 

To Summarize

D3DXCreateEffectFromFile in SDK 2007: OK

D3DXCreateEffectFromFile in SDK 2010: UNKNOWN FAIL

 

What black sorcery is causing this!?

Edited by ProgrammerDX
0

Share this post


Link to post
Share on other sites

Ok now it get's even funnier.

 

My .exe that runs on DirectX June 2010 uses d3dx9_43.dll        -> D3DXCreateEffectFromFile    ERROR

My .exe that runs on DirectX August 2007 uses d3dx9_35.dll    -> D3DXCreateEffectFromFile   OK

 

So now the funny part:

I copy d3dx9_35.dll and rename it to d3dx9_43.dll, et voila, it works.

 

Definitely bug in DirectX SDK's

Edited by ProgrammerDX
0

Share this post


Link to post
Share on other sites

K it's because I didnt redistribute Jun2010_D3DCompiler_43_x86.cab

 

dry.png

 

EDIT: full solution explanation below

Edited by ProgrammerDX
0

Share this post


Link to post
Share on other sites

Delay loading this dll should solve the problem.

Basically, use the effects if the dll loads successfully, otherwise use the D3D pipeline itself.

Above is applicable only when it isn't absolutely necessary to use effects.

This particular dll isn't necessarily present on all the machines.

It's generally present under system32 folder.

It's true that most distributables are shipping this dll to strictly use effects.

-1

Share this post


Link to post
Share on other sites

I resolved the problem.

 

It appears that for the June 2010 SDK (d3dx9_43.dll) and the one before that, Feb 2010 (d3dx9_42.dll), just supplying these dll's in the redistribute files to the end user is not enough to ensure that Effect class can be used.

 

Initially I believed supplying only the Jun2010_d3dx9_43_x86.cab redistribute file to the end user was enough. But for the mentioned SDKs it's not enough (special cases).

 

You need to supply all the Jun2010_*.cab files. (The one important to fix bug in this topic is Jun2010_D3DCompiler_43_x86.cab file)

 

So what I do now is just supply all the Jun2010_*.cab files as found in the \Microsoft DirectX SDK (June 2010)\Redist\   to the end-user. And the DSETUP.dll, dsetup32.dll, DXSETUP.exe, dxupdate.cab also found in that folder.

 

Then, force the client to execute DXSETUP.exe (to install the redist files) if LoadLibrary("d3dx9_43.dll") fails (test that in a launcher or something before running the actual game .exe).

 

So it was just a matter of not supplying all the right redistribute files to the end user because of a misunderstanding.

 

Problem is that it's not properly documented in MSDN and that there's no proper error message inside the function to tell you some files on the system are missing.

Edited by ProgrammerDX
1

Share this post


Link to post
Share on other sites

Btw that error code corresponds with this:

HRESULT: 0x8007007e (2147942526)
Name: ERROR_MOD_NOT_FOUND
Description: n/a
Severity code: Failed
Facility Code: FACILITY_WIN32 (7)
Error Code: 0x007e (126)

 

Which then leads to you having to check whether all the dlls that the application needs are present. Simple google fu would have found that from the error name.

When faced with an undocumented error code from a DX call it is likely this will actually be a WIN32 Error and these you can also look up on MSDN. The DX SDK also ships with a nice tool for translating error codes into readable errors which is in your SDK utils directory and is called DirectX Error Lookup, which I used to get the above info.

1

Share this post


Link to post
Share on other sites

your game has to run the installer using CreateProcess, or shell execute or equivalent, using this command line:

path-to-redistributable\dxsetup.exe /silent

cf.

http://msdn.microsoft.com/en-us/library/windows/desktop/ee416805(v=vs.85).aspx

and there are ways to make an installer embedding this step:

http://wix.sourceforge.net/manual-wix3/install_directx9.htm

not as on topic but interesting:

http://msdn.microsoft.com/en-us/library/windows/desktop/ee418797(v=vs.85).aspx

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0