Skip to main content
GameDev.net gamedev.net
🔒 Locked

Working with "3D Game Engine Programming" or "Programming Multiplayer FPS in DirectX"

Started by Burnt_Fyr Oct 1, 2009 at 1:31 PM 16 replies 3.2k views
Original Post
Burnt_Fyr
Burnt_Fyr
First, this is not about getting source for books which you have d/l only to find they are useless without the disk, having spend somewhere in the order of thousands of dollars on math/physics/graphics/premier press books i have no sympathy for those who can't get source code. What I am looking for is anyone who is working with either: 3D Game Engine Programming Programming a Multi-Player FPS in DirectX who has successfully compiled ANYTHING with a newer direct X sdk (august 09 for me). I've been able to compile certain things from each book with much learning along the way, but would like to help/be helped by others struggling to use/using this "engines" for instance: I've comiled 3DGEP up to chapter 6, but meshes display no texture/materials I've compiled PMPFPS up to chapter 7 so far but have had to hack out anything related to the sound and networking (as dmusic and dplay are depreciated) So for those of you who are looking to help, please do, and for those looking for help, reply with your problem, and I'll see if i can't get you to where I am. Collectively our minds work better than alone. PS: If any of the authors happen to catch this post, I'd LOVE to pick your brains and perhaps bring this source up to date.
Burnt_Fyr
Burnt_Fyr
Quote:
Original post by Gage64
I think you should give the thread a more descriptive title, it will get more views that way.

Regarding "Programming a Multi-Player FPS in DirectX", you are much more likely to get help over at the book's website: www.coderedgames.com.


The forums have been dead for some time and are now locked, i've already attempted to post a similar thread there. And since I do not speak german, zfx.info is out as well.
avig2009
avig2009
i have 3D Game Engine Programming so if you got any problems just ask
Burnt_Fyr
Burnt_Fyr
Well I've compiled up to chapter 6, which is really the first demo of the renderer, but it is not texturing at all. There are no screen shots of that chapter in the book, but i'm assuming that the 3 items should be textured? were you able to compile this using a later DXSDK? i'm attempting to use the march 09 release. I'd like to see this in action but cannot seem to find what is wrong on my own. I've also attempted to compile later chapters and get blank polys as well (Like Chapter 7 and the lighting shading demos,they just display a black quad, although there is pic in the book that shows spec reflection on a brick wall.)
avig2009
avig2009
would you want me to publish the source code of that chapter or only specific source file or maybe even the exe file
Burnt_Fyr
Burnt_Fyr
as i said, i have the source, but perhaps confirm that chapter 6 will display textures with the latest directx sdk (august/09). I see the meshes, but no textures. And if it does, then i've a bug i can't find to squish.
avig2009
avig2009
here is some screen shots of chapter 6





Burnt_Fyr
Burnt_Fyr
Quote:
Original post by Gage64
Are you sure the textures are loading correctly? How robust is the error checking in this engine and its sample programs?

Also, enable the Direct3D Debug Runtime, it might give you some useful information.


I think so, although without seeing them it's hard to tell. the files are being read though, and textures are being saved in the skinmanager. I've activated the debug dlls, and now see that i'm getting 2 errors(IDirect3D9::GetDeviceCaps failed: D3DERR_NOTAVAILABLE) and a ((WARN) :SetVertexDeclaration: NULL declaration pointer), and then the program as it always has. Until i try to close it that is, and then i'm inundated with:


Direct3D9: (ERROR) : [0] : Address 0109E4CB
Direct3D9: (ERROR) : [1] : Address 0109E59B
Direct3D9: (ERROR) : [2] : Address 0109E440
Direct3D9: (ERROR) : [3] : Address 01092DB4
Direct3D9: (ERROR) : [4] : Address 4FDFAF2E
Direct3D9: (ERROR) : [5] : Address 1004A0B0
Direct3D9: (ERROR) : [6] : Address 10049910
Direct3D9: (ERROR) : [7] : Address 0043D72C
Direct3D9: (ERROR) : [8] : Address 0043CC9C
Direct3D9: (ERROR) : [9] : Address 00447176
Direct3D9: (ERROR) : [10] : Address 00446FFF
Direct3D9: (ERROR) : [11] : Address 7C817077
Direct3D9: (ERROR) : [12] : Address 00000000
Direct3D9: (ERROR) : [13] : Address 00000000
Direct3D9: (ERROR) : [14] : Address 00000000
Direct3D9: (ERROR) : [15] : Address 00000000

repeating printing out for uhm... 2670 lines or so. same 16 lines over and over, although the addresses are different each time the program is run.
I'm going to poke around the getdevicecaps calls in this code tonight, and hopefully come up with something, but I feel I'm no further ahead now then i was before.
Burnt_Fyr
Burnt_Fyr
Quote:
Original post by avig2009
here is some screen shots of chapter 6






something i'd nevernoticed before as i've always run windowed mode, my screen resolution is not as it should be, hopefully this leads me to some sort of solution.
Gage64
Gage64
The "address" errors mean that certain resources are not being released. You should look into that later.

The first two errors are more interesting. It seems that SetVertexDeclaration is being passed a NULL pointer. I think this is what's causing the problem.

It also seems strange that GetDeviceCaps fails...

Can you post the code that calls these two functions, and the code that creates the vertex declaration?

If you have several calls to SetVertexDeclaration, you can step through the program with the debugger and see which call generates that error message.
Burnt_Fyr
Burnt_Fyr
HRESULT ZFXD3DEnum::EnumDevices(ZFXADAPTERINFO &xAdapter) {   ZFXDEVICEINFO *pDev;   HRESULT        hr;   const D3DDEVTYPE d3dDevTypes[] = {                D3DDEVTYPE_HAL,                D3DDEVTYPE_SW,                D3DDEVTYPE_REF                };   xAdapter.nNumDevs = 0;   for (UINT nDev=0; nDev<3; nDev++) {      pDev = &xAdapter.d3dDevs[xAdapter.nNumDevs];      pDev->nNumCombo   = 0;      pDev->nAdapter    = xAdapter.nAdapter;      pDev->d3dDevType  = d3dDevTypes[nDev];      // will fail if unsupported devtype      if (FAILED(m_pD3D->GetDeviceCaps(pDev->nAdapter,                 pDev->d3dDevType, &pDev->d3dCaps)))         continue;


this is the code that is causing the getdevicecaps failure, and this:

void ZFXD3D::UseShaders(bool b) {    if (!m_bCanDoShaders) return;   if (m_bUseShaders == b) return;   // clear all vertex caches   m_pVertexMan->ForcedFlushAll();   m_pVertexMan->InvalidateStates();   m_bUseShaders = b;   // deactivate use of shaders   if (!m_bUseShaders) {      m_pDevice->SetVertexShader(NULL);      m_pDevice->SetPixelShader(NULL);      m_pDevice->SetVertexDeclaration(NULL);      }   else {      m_pDevice->SetFVF(0);      }   } // UseShaders
is the function that is calling SetVertexDeclaration. I understand that these might not be enough on their own to solve the issue, but who knows. I came across a similar thread (a clone of the engine from the book) and it was a shader issue. more digging i guess

Burnt_Fyr
Burnt_Fyr
Quote:

here is the source code withe the exe and textures try it :)


hmmm... well this exe/dll combo does work, but it's not compiled with 9.0c, and when i bring it up to date ( with the createfont and draw text edits ) it no longer works. The dll is almost a 3rd the size of the one you provided.

back to the original question, Has anyone successfully compiled chapter 6 from this book with the latest DirectXSDK?
avig2009
avig2009
i compiled it with visual studio 2008 and directx sdk 2008
why it is not working for you too??
Burnt_Fyr
Burnt_Fyr
well, if i knew that i wouldn't have started this thread :). I'm using the latest (aug/09) direct x sdk, perhaps i'll try with a 2008 sdk, what quarter was the release?

That doesn't explain the missing 1.3 mb or so that the zfxd3d.dll is off by. hmmm....
avig2009
avig2009
i am using this DXSDK_Nov08.exe

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.