Archived

This topic is now archived and is closed to further replies.

Link

Jim Adams ------------> Topic for you

Recommended Posts

Hi! i would buy your book Programming RPG with DirectX but i find these: http://www.gorilla.it/gorilla/product.asp?sku=1931841098&dept%5Fid= and http://www.amazon.com/exec/obidos/ASIN/1931841098/qid%3D1043011116/sr%3D11-1/ref%3Dsr%5F11%5F1/002-6815581-9484832 are there some difference? Could you suggest other better or more new book? (I Think this is the better but you know more of me!) Also: Is in this book explained how make an 3D rpg step by step from A at Z? Import 3D character and world, move, jump....? THX THX

Share this post


Link to post
Share on other sites
Same book - it''s just the book cover was redesigned at one point. The book covers using DirectX 8.0, but my website contains an update to use DX8.1.

My book shows how to create a 3-D engine, 2-D engine, mixed 2-D and 3-D engine, scripting, object and character control, plus much more. The book does come with a demo RPG w/full source code.

Share this post


Link to post
Share on other sites
quote:
Same book - it's just the book cover was redesigned at one point.


so the pages are perfectly indentical ?

[edited by - Link on January 20, 2003 8:30:34 AM]

Share this post


Link to post
Share on other sites
I have a question too, I didnt know who to ask and who better than the author...

I love the book, and read a lot of it already...I jump around to parts that interest me more than others..then i dive in and hack code and stuff...my question isnt a coding one, its more of a artistic one...

I have truespace 4.1, and know it can load x files but it has a problem loading the character .x files from (i think is the char demo..running around casting spells fighting in a small arena). I was curious what program could load and mess with .x file animations primairly? (like i said truespace 4.1 can do it, but it has real problems with animations and the characters dont load im guessing because of their animations)

What are some good programs/modelers that can handle this, i thought milkshape3d could do this, but it doesnt seem to be able to export (could of been import) .x files....

Any ideas?

-Shane

Share this post


Link to post
Share on other sites
What is 3d canvas?




However Jim Adams can you answare if the pages are perfectly indentical or there are some little difference?











[edited by - Link on January 20, 2003 8:48:07 AM]

Share this post


Link to post
Share on other sites
I''m sorry i understand! I''m sorry
Another thing: With this book i will study directX 8.0, after with your site i update my knowless at 8.1. But when i will want stdudy DirectX 9.0 Do you thing there are lot''s of difference with from directX 8.1 to directx 9.0?

Share this post


Link to post
Share on other sites
You should be able to use DX9.0 with little difficulty - there''s not much of a difference. The # of pages and the text are the same - the book cover that says DX8.0 is wrong - that''s the cover used during the design phase. It was actually published with the cover that doesn''t say 8.0.

Jim Adams

Share this post


Link to post
Share on other sites
1. I tried building chapter 10 programs using Visual Studio .Net and DirectX 9, but I get the following errors:

e:\Chap10\GameCore\Core_Graphics.cpp(1124): error C2660: 'ID3DXSkinMesh::UpdateSkinnedMesh' : function does not take 2 parameters
e:\Chap10\GameCore\Core_Graphics.cpp(1280): error C2660: 'ID3DXSkinMesh::GenerateSkinnedMesh' : function does not take 5 parameters
e:\Chap10\GameCore\Core_Graphics.cpp(1788): error C2660: 'ID3DXSkinMesh::UpdateSkinnedMesh' : function does not take 2 parameters

I looked up the declaration of the function UpdateSkinnedMesh and in DX9, it takes 4 parameters. Now I haven't looked into the code, I just wanted to see the program run. Can you tell me where to find the remaining arguments?

Also, I got an error in DirectPlay8Create Function.

The DX9 doc says:

Not currently supported.

Users should instead use CoCreateInstance to create the object.

What am I doing wrong?

2. What are your views about using STL? I notice that you create your own classes when such classes are already provided by the vendor? Is speed a concern?

Thanks

[edited by - Jaspreet on January 20, 2003 7:37:18 PM]

Share this post


Link to post
Share on other sites
1.

Try here
Basically those functions were altered in the upgrade from DX8.0 to DX8.1. The link will take you to Jim Adams'' site where he explains the changes and lists the new arguments.

2.

I think Jim chose to implement certain things himself to show the reader how they work.


pan narrans | My Website | Study + Hard Work + Loud Profanity = Good Code

Share this post


Link to post
Share on other sites
Hmrph,

Jim, I was wondering if you''re planning to
do a DirectX 9 update to the gamecore
much like you did with the DirectX 8.1
update to the gamecore.

I''ve being struggling with converting
the code from DX8.1 to DX9 for a while.
I''ve gone from 255+ errors to 23 errors.

I get a lot of the following warnings:

warning C4309: ''argument'' : truncation of constant value

For the error messages, here are some highlights:

error C2660: ''IDirect3DDevice9::CreateVertexBuffer'' : function does not take 5 parameters

error C2660: ''IDirect3DDevice9::SetStreamSource'' : function does not take 3 parameters

error C2664: ''IDirect3DVertexBuffer9::Lock'' : cannot convert parameter 3 from ''BYTE ** '' to ''void ** ''

error C2660: ''ID3DXSkinInfo::UpdateSkinnedMesh'' : function does not take 3 parameters

error C2660: ''IDirect3DDevice9::CreateTexture'' : function does not take 7 parameters

...and then a series of "XXX" is not a member of ID3DXSkinInfo errors...

MS''s guide to DX8->DX9 isn''t very helpful...
Well, back to some more hair pulling ... ;(

- JC

Share this post


Link to post
Share on other sites
"function does not take 5 parameters"

Look up those functions in the DX SDK documentation and check the ordering of the arguments. To get an error like that some new ones have been added or some have been taken away. You will have to alter the arguments you are sending, and if its anything like the conversion from 8.0 to 8.1 then it will most likely be a couple of null values you need to pass.

"truncation of constant value"

I know that Jim uses unsigned chars in the book to hold colour values, because they hold values from 0->255. But instead of typing unsigned char each time he puts /J in the C++ project options box which sets a char type to unsigned as default. If you have forgotten to do that then you might get that error.


pan narrans | My Website | Study + Hard Work + Loud Profanity = Good Code

Share this post


Link to post
Share on other sites
Hey, thanks pan narrans for the reply.
I must be a dork to overlook something like that (/J).

Do you happen to know if Jim Adams planning to
post an update guide or not?

I''m curious as to why/how Jaspreet is still using

"ID3DXSkinMesh::UpdateSkinnedMesh, etc."

instead of using

"ID3DXSkinInfo::UpdateSkinnedMesh"

since the DX 9 SDK doc states:

"...ID3DXSkinMesh was renamed ID3DXSkinInfo"

???

- JC

P.S. I''m currently at 18 errors and 8 warning now, wahoo!

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Perhaps it''s something to do with DirectX being fully backwards compatible with previous version, no?

Share this post


Link to post
Share on other sites
I also got a bunch of errors. I however did not install anything from the book''s CD, I just copied the GameCore files into my workspace. I believe I am using Direct X SDK 8.1, and Visual Studio 6. along with the errors that it has a different amount of parameters I got errors stating that "XXX" missing storage class or type specifiers. I noticed that "BOOL" was listed as many of them and find/replaced all BOOL with bool and fixed it. I still have 49 errors. I''m guessing from previous repies that it has to do with the DirectX version. is my guess right? if I find what HINSTANCE, HWND and the other listed errors are changed to in the directX files It''ll fix my errors? is that what the update on the website fixes?

Stuff does programming things.

Share this post


Link to post
Share on other sites
ok, I did change a few functions according to the DirectX documentation and got rid of 5 of the errors. I still have 44 and am stumped as to how to clear them.

c:\game1\core_input.cpp(135) : error C2664: ''EnumDevices'' : cannot convert parameter 2 from bool to int

the book code is
if(FAILED(m_Input->GetDirectInputCOM()->EnumDevices(DI8DEVCLASS_GAMECTRL, EnumJoysticks, this, DIEDFL_ATTACHEDONLY)))

c:\game1\core_system.h(15) : error C2146: syntax error : missing '';'' before identifier ''m_hInst''
c:\game1\core_system.h(15) : error C2501: ''HINSTANCE'' : missing storage-class or type specifiers
c:\game1\core_system.h(15) : error C2501: ''m_hInst'' : missing storage-class or type specifiers

the second error is repeated for ''HWND, MAX_PATH, WNDCLASSEX, and DWORD.

most of the errors are in core_system.h
Also in core_system.h are the errors

c:\game1\core_system.h(44) : error C2146: syntax error : missing '';'' before identifier ''PASCAL''
c:\game1\core_system.h(44) : error C2433: ''FAR'' : ''virtual'' not permitted on data declarations
c:\game1\core_system.h(44) : error C2501: ''FAR'' : missing storage-class or type specifiers
c:\game1\core_system.h(44) : error C2146: syntax error : missing '';'' before identifier ''MsgProc''
c:\game1\core_system.h(44) : error C2501: ''PASCAL'' : missing storage-class or type specifiers

for this line of code

virtual FAR PASCAL MsgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { return DefWindowProc(hWnd, uMsg, wParam, lParam); }

and somehow it came to an unexpected end of file shortly after the end of the cApplication class definition, but there are more classes defined afterwards in the same file.

... I''m lost
can someone free me from this insanity?


Stuff does programming things.

Share this post


Link to post
Share on other sites
All your problems seem Windows related. HINSTANCE, HWND, MAX_PATH, WNDCLASSEX, BOOL, etc, are all windows stuff. Are you including "windows.h"? That should fix all those problems, and would have fixed the BOOL problem too, but if you want to avoid changing those all back I think you can fix EnumDevices like this:

If you look for the function EnumJoysticks I think you''ll find it must be returning a bool, i.e.
bool EnumJoysticks(...);

Try changing the bool to an int.


pan narrans | My Website | Study + Hard Work + Loud Profanity = Good Code

Share this post


Link to post
Share on other sites
I included Core_System.h, Core_System.cpp includes Core_Global.h which includes windows.h, all of the books Core_*.h files and a bunch of DirectX header files, so I thought it was covered... aparently not, I just changed my include to Core_Global.h and the errors dropped down to 2. now my errors are

LIBCMT.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/game1.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

But I think it''s because I cut out a bunch of stuff to cut down on the errors, I just have to recopy the book files to my directory and try again.

Thanks

Stuff does programming things.

Share this post


Link to post
Share on other sites
Mumble, grumble. my last error turned into 56. I changed all the directX related names and fixed the parameters and now I''m getting a ton of unresolved external symbol errors

Linking...
Core_Graphics.obj : error LNK2001: unresolved external symbol _Direct3DCreate8@4
Core_Graphics.obj : error LNK2001: unresolved external symbol _D3DXCreateSprite@8
Core_Graphics.obj : error LNK2001: unresolved external symbol _D3DXMatrixPerspectiveFovLH@20
Core_Graphics.obj : error LNK2001: unresolved external symbol _D3DXMatrixTranslation@16
Core_Graphics.obj : error LNK2001: unresolved external symbol _D3DXMatrixRotationYawPitchRoll@16
Core_Graphics.obj : error LNK2001: unresolved external symbol _D3DXMatrixScaling@16
Core_Graphics.obj : error LNK2001: unresolved external symbol _D3DXMatrixMultiply@12
Core_Graphics.obj : error LNK2001: unresolved external symbol _D3DXMatrixTranspose@8
Core_Graphics.obj : error LNK2001: unresolved external symbol _D3DXMatrixRotationZ@8
Core_Graphics.obj : error LNK2001: unresolved external symbol _D3DXMatrixRotationY@8
Core_Graphics.obj : error LNK2001: unresolved external symbol _D3DXMatrixRotationX@8
Core_Graphics.obj : error LNK2001: unresolved external symbol _D3DXCreateFontIndirect@12
Core_Graphics.obj : error LNK2001: unresolved external symbol _DirectXFileCreate@4
Core_Graphics.obj : error LNK2001: unresolved external symbol _IID_IDirectXFileData
Core_Graphics.obj : error LNK2001: unresolved external symbol _IID_IDirectXFileDataReference
Core_Graphics.obj : error LNK2001: unresolved external symbol _TID_D3DRMAnimationKey
Core_Graphics.obj : error LNK2001: unresolved external symbol _TID_D3DRMAnimation
Core_Graphics.obj : error LNK2001: unresolved external symbol _TID_D3DRMAnimationSet
Core_Graphics.obj : error LNK2001: unresolved external symbol _D3DXCreateTextureFromFileA@12
Core_Graphics.obj : error LNK2001: unresolved external symbol _D3DXComputeBoundingSphere@20
Core_Graphics.obj : error LNK2001: unresolved external symbol _D3DXComputeBoundingBox@20
Core_Graphics.obj : error LNK2001: unresolved external symbol _D3DXLoadSkinMeshFromXof@36
Core_Graphics.obj : error LNK2001: unresolved external symbol _TID_D3DRMMesh
Core_Graphics.obj : error LNK2001: unresolved external symbol _TID_D3DRMFrameTransformMatrix
Core_Graphics.obj : error LNK2001: unresolved external symbol _TID_D3DRMFrame
Core_Graphics.obj : error LNK2001: unresolved external symbol _TID_D3DRMAnimationOptions
Core_Graphics.obj : error LNK2001: unresolved external symbol _D3DXCreateTextureFromFileExA@56
Core_Graphics.obj : error LNK2001: unresolved external symbol _D3DXMatrixRotationQuaternion@8
Core_Graphics.obj : error LNK2001: unresolved external symbol _D3DXQuaternionSlerp@16
Core_Graphics.obj : error LNK2001: unresolved external symbol _D3DXGetFVFVertexSize@4
Core_Input.obj : error LNK2001: unresolved external symbol _DirectInput8Create@20
Core_Input.obj : error LNK2001: unresolved external symbol _IID_IDirectInput8A
Core_Input.obj : error LNK2001: unresolved external symbol _c_dfDIJoystick
Core_Input.obj : error LNK2001: unresolved external symbol _c_dfDIMouse
Core_Input.obj : error LNK2001: unresolved external symbol _GUID_SysMouse
Core_Input.obj : error LNK2001: unresolved external symbol _c_dfDIKeyboard
Core_Input.obj : error LNK2001: unresolved external symbol _GUID_SysKeyboard
Core_Sound.obj : error LNK2001: unresolved external symbol _GUID_DirectMusicAllTypes
Core_Sound.obj : error LNK2001: unresolved external symbol _GUID_PerfMasterVolume
Core_Sound.obj : error LNK2001: unresolved external symbol _CLSID_DirectMusicPerformance
Core_Sound.obj : error LNK2001: unresolved external symbol _IID_IDirectMusicPerformance8
Core_Sound.obj : error LNK2001: unresolved external symbol _CLSID_DirectMusicLoader
Core_Sound.obj : error LNK2001: unresolved external symbol _IID_IDirectMusicLoader8
Core_Sound.obj : error LNK2001: unresolved external symbol _DirectSoundCreate8@12
Core_Sound.obj : error LNK2001: unresolved external symbol _IID_IDirectSoundNotify
Core_Sound.obj : error LNK2001: unresolved external symbol _IID_IDirectSoundBuffer8
Core_Sound.obj : error LNK2001: unresolved external symbol _GUID_StandardMIDIFile
Core_Sound.obj : error LNK2001: unresolved external symbol _IID_IDirectMusicSegment8
Core_Sound.obj : error LNK2001: unresolved external symbol _CLSID_DirectMusicSegment
Core_Sound.obj : error LNK2001: unresolved external symbol _GUID_ConnectToDLSCollection
Core_Sound.obj : error LNK2001: unresolved external symbol _GUID_PerfMasterTempo
Core_Sound.obj : error LNK2001: unresolved external symbol _IID_IDirectMusicCollection
Core_Sound.obj : error LNK2001: unresolved external symbol _GUID_DefaultGMCollection
Core_Sound.obj : error LNK2001: unresolved external symbol _CLSID_DirectMusicCollection
LIBCMT.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/game1.exe : fatal error LNK1120: 55 unresolved externals
Error executing link.exe.

game1.exe - 56 error(s), 0 warning(s)

Note: I made the same changes to a game made for chapter 20 and it compiled completely. I don''t see why my particular programm should be giving me this much trouble...

Share this post


Link to post
Share on other sites
quote:
Original post by Anonymous Poster
Perhaps it''s something to do with DirectX being fully backwards compatible with previous version, no?


Based on the above reply, I went back and tried building
the GameCore with the DX8 libraries included with DX9 SDK...
wow! I was stunned stupid. It actually worked. I did
get a bunch of errors at first because I didn''t include
the proper *.lib files. I also had to comment out the
the "GetIP" references in the Core_Network.h/Core_Network.cpp
just to get rid of some vague linker errors. At any rate,
the *.lib files that works for me are:

d3d8.lib d3dx8.lib dinput8.lib dsound.lib dplayx.lib dxguid.lib d3dxof.lib winmm.lib

...and of course the "/J" switch for the C++ option. I am
still getting the following warnings:

Core_System.h(44) : warning C4244: ''return'' : conversion from ''LRESULT'' to ''int'', possible loss of data
Core_System.h(44) : warning C4244: ''return'' : conversion from ''LRESULT'' to ''int'', possible loss of data
Core_System.h(44) : warning C4244: ''return'' : conversion from ''LRESULT'' to ''int'', possible loss of data
Core_System.h(44) : warning C4244: ''return'' : conversion from ''LRESULT'' to ''int'', possible loss of data
Core_Network.cpp(298) : warning C4267: ''='' : conversion from ''size_t'' to ''DWORD'', possible loss of data
Core_Network.cpp(632) : warning C4267: ''argument'' : conversion from ''size_t'' to ''const DWORD'', possible loss of data
Core_Network.cpp(721) : warning C4267: ''='' : conversion from ''size_t'' to ''DWORD'', possible loss of data
Core_System.h(44) : warning C4244: ''return'' : conversion from ''LRESULT'' to ''int'', possible loss of data
Core_System.h(44) : warning C4244: ''return'' : conversion from ''LRESULT'' to ''int'', possible loss of data

Heh, is there another C++ switch that I forgot to add similar
to the "/J" switch? These warnings are annoying...

At any rate, I have successfully compiled and ran chapter 12''s
MeshLvl example without any problem.

I''m gonna try chapter 12''s nodetree and chapter 20''s the
tower example next.

Oh, and thanks to the anonymous poster for clueing me in
on using DX8 with DX9 SDK..."so that''s why there are DX8*
files in the DX9 SDK''s include directory..."

- JC

Share this post


Link to post
Share on other sites
Wahoo! Both the nodetree and the tower examples work!
There''s one issue with the tower example though.
After I beat the one monster in the village, I cannot
talk to any of the villagers or the guy on the bridge
in the next screen so I could not enter the tower to
see if the other parts of the game is working or not.

Has anyone here experience this? I''m using the updated
code downloaded from Jim''s website with the DX8.1 update.

''kay...I''m going to sleep now...

- JC

Share this post


Link to post
Share on other sites
I''ve been gone for a while, so I missed most of this thread

The most common problems for the engine not picking up on clicked meshes is that the mesh/vertex buffer creation flags are set to write only, which throws off the D3DXIntersect function. Try searching for WRITEONLY flags and change them to 0 and see if that helps.

Share this post


Link to post
Share on other sites