Archived

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

Please help test my DX8 game

This topic is 5491 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello everyone, I apologize for posting this here--I know that this is normally more appropriate for the "Your Announcements" section; however, I have a hunch that this is a DirectX-related bug. A couple of people who downloaded my (nearly-complete) game demo reported experiencing crashes when playing the game. Usually, this crash occurs immediately after pressing "Play" on the title screen (yeah, convenient place, isn''t it?) However, I cannot replicate this error on my machine, nor on my friends'' machines. I am hoping that someone out there kind enough to try my demo will experience the bug. If you experience this error, please e-mail me the game''s log file (log.txt, located in the same directory as the executable file). This file should be created when you run the game. The game can be downloaded from my portfolio site: www.fivestory.com/projects/game. My e-mail address is njohnson@fivestory.com. Thank you very much in advance for any information you can provide! --Neil aka "HoozitWhatzit". ---------------------- Check out my game demo and resume at www.fivestory.com/projects/game.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
yep, crashed here.

it also crashed in the options screen by repeatedly clicking (slowly or rapidly) in one of the right-hand fields i assumed were for key mapping.

1G P3 512MB, GF2 32MB DX8.1 XP PRO SP1

Share this post


Link to post
Share on other sites
To Anonymous Poster: would you mind e-mailing me the log file that is produced when the game crashes (after pressing "Play")? And, thank you for letting me know about the key-mapping click error. I will tackle that right away.

Thanks a ton, everyone! I''m grateful for your help.

--Neil.

----------------------
Check out my game demo and resume at
www.fivestory.com/projects/game.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Supports video mode 640 x 480.
Supports video mode 800 x 600.
Supports video mode 1024 x 768.
Supports video mode 1280 x 1024.
Supports video mode 1400 x 1050.
Supports video mode 1600 x 1200.
Supports video mode 640 x 480.
Supports video mode 800 x 600.
Supports video mode 1024 x 768.
Supports video mode 1280 x 1024.
Supports video mode 1400 x 1050.
Supports video mode 1600 x 1200.
Preferences file found and opened...
Parsing screen resolution...
Preferred screen width:
1024
Preferred screen height:
768

Using hardware-based T&L.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded splash screen.
Loaded options screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded alphabet screen.
Loaded credits screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded quit dialog screen.
CGameMain::StateGameLoading() -- 0.0
CGameMain::StateGameLoading() -- 0.1
CGameMain::StateGameLoading() -- 0.2
CGameMain::StateGameLoading() -- 0.2
CGameMain::StateGameLoading() -- 0.3
----------------------------------------------
Loaded default texture.
Loaded heads-up display texture.
Loaded floor texture.
Loaded skybox''s north wall texture.
Loaded skybox''s south wall texture.
Loaded skybox''s east wall texture.
Loaded skybox''s west wall texture.
Loaded skybox''s roof texture.
Loaded explosion texture.
Loaded shockring / spark texture.
Loaded player tank texture.
Loaded enemy tank body texture.
Loaded enemy tank top texture.
Loaded enemy tank turret texture.
Loaded impact flare texture.
Loaded all-white texture.
Loaded alphabet texture.
Loaded ''game over'' success msg texture.
Loaded ''game over'' failure msg texture.
Loaded ''enemy detected'' failure msg texture.
CGameMain::StateGameLoading() -- 0.4
CGameMain::StateGameLoading() -- 0.5
CGameMain::StateGameLoading() -- 0.6
CGameMain::StateGameLoading() -- 0.7
CGameMain::StateGameLoading() -- 0.8
CGameMain::StateGameLoading() -- 0.9
CGameMain::StateGameLoading() -- 1.0
CGameMain::StateGameLoading() -- 1.1
CGameMain::StateGameLoading() -- 1.2
CGameMain::StateGameLoading() -- 1.3
CGameMain::StateGameLoading() -- 1.4
CGameMain::StateGameLoading() -- 1.5
CGameMain::StateGameLoading() -- 1.6
CGameMain::StateGameLoading() -- 1.7
CScriptEvents::LoadScriptFile() -- 0.0
CScriptEvents::LoadScriptFile() -- 0.1
CGameMain::StateGameLoading() -- 1.8
CGameMain::StateGameLoading() -- 1.9
CGameMain::StateGameLoading() -- 2.0
CGameMain::StateGameLoading() -- 2.1
CGameMain::StateGameLoading() -- 2.2
CGameMain::StateGameLoading() -- 2.3

Share this post


Link to post
Share on other sites
Crashed out on clicking ''Play''. I have

AMD Althon 1Ghz, 512Mb, GeForce 3 Ti200 (64Mb), Win2K SP2, DX8.1

The log is (I stuck it as source to save space)

  
Supports video mode 640 x 480.
Supports video mode 800 x 600.
Supports video mode 848 x 480.
Supports video mode 1024 x 768.
Supports video mode 1152 x 864.
Supports video mode 1280 x 720.
Supports video mode 1280 x 768.
Supports video mode 1280 x 960.
Supports video mode 1280 x 1024.
Using hardware-based T&L.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded splash screen.
Loaded options screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded alphabet screen.
Loaded credits screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded quit dialog screen.
CGameMain::StateGameLoading() -- 0.0
CGameMain::StateGameLoading() -- 0.1
CGameMain::StateGameLoading() -- 0.2
CGameMain::StateGameLoading() -- 0.2
CGameMain::StateGameLoading() -- 0.3
----------------------------------------------
Loaded default texture.
Loaded heads-up display texture.
Loaded floor texture.
Loaded skybox''s north wall texture.
Loaded skybox''s south wall texture.
Loaded skybox''s east wall texture.
Loaded skybox''s west wall texture.
Loaded skybox''s roof texture.
Loaded explosion texture.
Loaded shockring / spark texture.
Loaded player tank texture.
Loaded enemy tank body texture.
Loaded enemy tank top texture.
Loaded enemy tank turret texture.
Loaded impact flare texture.
Loaded all-white texture.
Loaded alphabet texture.
Loaded ''game over'' success msg texture.
Loaded ''game over'' failure msg texture.
Loaded ''enemy detected'' failure msg texture.
CGameMain::StateGameLoading() -- 0.4
CGameMain::StateGameLoading() -- 0.5
CGameMain::StateGameLoading() -- 0.6
CGameMain::StateGameLoading() -- 0.7
CGameMain::StateGameLoading() -- 0.8
CGameMain::StateGameLoading() -- 0.9
CGameMain::StateGameLoading() -- 1.0
CGameMain::StateGameLoading() -- 1.1
CGameMain::StateGameLoading() -- 1.2
CGameMain::StateGameLoading() -- 1.3
CGameMain::StateGameLoading() -- 1.4
CGameMain::StateGameLoading() -- 1.5
CGameMain::StateGameLoading() -- 1.6
CGameMain::StateGameLoading() -- 1.7
CScriptEvents::LoadScriptFile() -- 0.0
CScriptEvents::LoadScriptFile() -- 0.1
CGameMain::StateGameLoading() -- 1.8
CGameMain::StateGameLoading() -- 1.9
CGameMain::StateGameLoading() -- 2.0
CGameMain::StateGameLoading() -- 2.1
CGameMain::StateGameLoading() -- 2.2
CGameMain::StateGameLoading() -- 2.3


Stephen

Share this post


Link to post
Share on other sites
OK! I''ve learned a little bit about the problem, thanks to your help. I still don''t know what''s wrong, but I know what isn''t wrong--and that''s a good start!

From what I''ve seen from everyone''s log files, the problem is NOT:

(1) Screen resolution change;
(2) Loading of the game script;
(3) Loading of the game''s assets;

The error is occurring during the main game loop.

I have two hypotheses now: some of my game''s textures are larger than 256x256. Perhaps this is causing the game to quit even with modern video cards?

Another possibility may be this: I am using a Quake-style game console that I lifted from a book. This console writes to the backbuffer to do its rendering (it''s the only part of my game that does so). I will disable this console so that backbuffer-locking is never used in the game.

I will post here again when I''ve made these changes. I will be sure to share my findings here when I locate the source of the error.

Thanks!
--Neil.

----------------------
Check out my game demo and resume at
www.fivestory.com/projects/game.

Share this post


Link to post
Share on other sites
Ok, I have put up a new version of my game in order to test my hypotheses mentioned above. The game now uses only textures that are 256x256 and smaller, and it no longer draws to the backbuffer for any reason.

Finally, I put some logging code in the rendering loop (for the first 5 passes through the loop only).

Those of you who experienced the error, I would be grateful if you would download the game again and give it another try.

I sincerely appreciate the help tracking down this error. I normally wouldn''t ask anyone here to help me debug my own software; unfortunately, I cannot replicate this bug on my PC, nor on those of my friends...

This is one of those rare occasions when I wish a bug would occur!

Thanks again,
--Neil.

----------------------
Check out my game demo and resume at
www.fivestory.com/projects/game.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
same problem, any resolution:

  
Supports video mode 640 x 480.
Supports video mode 800 x 600.
Supports video mode 1024 x 768.
Supports video mode 1280 x 1024.
Supports video mode 1400 x 1050.
Supports video mode 1600 x 1200.
Supports video mode 640 x 480.
Supports video mode 800 x 600.
Supports video mode 1024 x 768.
Supports video mode 1280 x 1024.
Supports video mode 1400 x 1050.
Supports video mode 1600 x 1200.
Preferences file found and opened...
Parsing screen resolution...
Preferred screen width:
1024
Preferred screen height:
768

Using hardware-based T&L.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded splash screen.
Loaded options screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded alphabet screen.
Loaded credits screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded quit dialog screen.
CGameMain::StateGameLoading() -- 0.0
CGameMain::StateGameLoading() -- 0.1
CGameMain::StateGameLoading() -- 0.2
CGameMain::StateGameLoading() -- 0.2
CGameMain::StateGameLoading() -- 0.3
----------------------------------------------
Loaded default texture.
Loaded heads-up display texture.
Loaded floor texture.
Loaded skybox''s north wall texture.
Loaded skybox''s south wall texture.
Loaded skybox''s east wall texture.
Loaded skybox''s west wall texture.
Loaded skybox''s roof texture.
Loaded explosion texture.
Loaded player tank texture.
Loaded enemy tank body texture.
Loaded enemy tank top texture.
Loaded enemy tank turret texture.
Loaded impact flare texture.
Loaded all-white texture.
Loaded alphabet texture.
Loaded ''game over'' success msg texture.
Loaded ''game over'' failure msg texture.
Loaded ''enemy detected'' failure msg texture.
CGameMain::StateGameLoading() -- 0.4
CGameMain::StateGameLoading() -- 0.5
CGameMain::StateGameLoading() -- 0.6
CGameMain::StateGameLoading() -- 0.7
CGameMain::StateGameLoading() -- 0.8
CGameMain::StateGameLoading() -- 0.9
CGameMain::StateGameLoading() -- 1.0
CGameMain::StateGameLoading() -- 1.1
CGameMain::StateGameLoading() -- 1.2
CGameMain::StateGameLoading() -- 1.3
CGameMain::StateGameLoading() -- 1.4
CGameMain::StateGameLoading() -- 1.5
CGameMain::StateGameLoading() -- 1.6
CGameMain::StateGameLoading() -- 1.7
CScriptEvents::LoadScriptFile() -- 0.0
CScriptEvents::LoadScriptFile() -- 0.1
CGameMain::StateGameLoading() -- 1.8
CGameMain::StateGameLoading() -- 1.9
CGameMain::StateGameLoading() -- 2.0
CGameMain::StateGameLoading() -- 2.1
CGameMain::StateGameLoading() -- 2.2
CGameMain::StateGameLoading() -- 2.3
CGameMain::Render() -- 0.0 **************
CGameMain::Render() -- 0.1
CGameMain::Render() -- 0.2
CGameMain::Render() -- 0.3
CGameMain::Render() -- 0.4
CGameMain::Render() -- 0.5
CGameMain::Render() -- 0.6
CGameMain::Render() -- 0.7
CGameMain::Render() -- 0.8
CGameMain::Render() -- 0.9
CGameMain::Render() -- 1.0
CGameMain::Render() -- 1.1
CGameMain::Render() -- 1.2
CGameMain::Render() -- 1.3
CGameMain::Render() -- 1.4
CGameMain::Render() -- 1.5
CGameMain::Render() -- 1.6
CGameMain::Render() -- 0.0 **************
CGameMain::Render() -- 0.1
CGameMain::Render() -- 0.2
CGameMain::Render() -- 0.3
CGameMain::Render() -- 0.4
CGameMain::Render() -- 0.5
CGameMain::Render() -- 0.6
CGameMain::Render() -- 0.7
CGameMain::Render() -- 0.8
CGameMain::Render() -- 0.9
CGameMain::Render() -- 1.0
CGameMain::Render() -- 1.1
CGameMain::Render() -- 1.2
CGameMain::Render() -- 1.3
CGameMain::Render() -- 1.4
CGameMain::Render() -- 1.5
CGameMain::Render() -- 1.6
CGameMain::Render() -- 0.0 **************
CGameMain::Render() -- 0.1
CGameMain::Render() -- 0.2
CGameMain::Render() -- 0.3
CGameMain::Render() -- 0.4
CGameMain::Render() -- 0.5
CGameMain::Render() -- 0.6
CGameMain::Render() -- 0.7
CGameMain::Render() -- 0.8
CGameMain::Render() -- 0.9
CGameMain::Render() -- 1.0
CGameMain::Render() -- 1.1
CGameMain::Render() -- 1.2
CGameMain::Render() -- 1.3
CGameMain::Render() -- 1.4
CGameMain::Render() -- 1.5
CGameMain::Render() -- 1.6
CGameMain::Render() -- 0.0 **************
CGameMain::Render() -- 0.1
CGameMain::Render() -- 0.2
CGameMain::Render() -- 0.3
CGameMain::Render() -- 0.4
CGameMain::Render() -- 0.5
CGameMain::Render() -- 0.6
CGameMain::Render() -- 0.7
CGameMain::Render() -- 0.8
CGameMain::Render() -- 0.9
CGameMain::Render() -- 1.0
CGameMain::Render() -- 1.1
CGameMain::Render() -- 1.2
CGameMain::Render() -- 1.3
CGameMain::Render() -- 1.4
CGameMain::Render() -- 1.5
CGameMain::Render() -- 1.6
CGameMain::Render() -- 0.0 **************
CGameMain::Render() -- 0.1
CGameMain::Render() -- 0.2
CGameMain::Render() -- 0.3
CGameMain::Render() -- 0.4
CGameMain::Render() -- 0.5
CGameMain::Render() -- 0.6
CGameMain::Render() -- 0.7
CGameMain::Render() -- 0.8
CGameMain::Render() -- 0.9
CGameMain::Render() -- 1.0
CGameMain::Render() -- 1.1
CGameMain::Render() -- 1.2
CGameMain::Render() -- 1.3
CGameMain::Render() -- 1.4
CGameMain::Render() -- 1.5
CGameMain::Render() -- 1.6

Share this post


Link to post
Share on other sites
It worked fine for a couple seconds... then froze my machine solid. I hardbooted, and tried a couple times, with the same results. It freezes right in the beginning of playing the game.
System:
win98se
256MB ram
Athlon 1.4
radion9000pro

For the brief seconds it did work, it said I got 900 fps!

Share this post


Link to post
Share on other sites
Same again I'' afraid. It is definately entering the game loop, but bugs out (just drops out of the program altogether) within a fraction of a second.

Log is

  
Supports video mode 640 x 480.
Supports video mode 800 x 600.
Supports video mode 848 x 480.
Supports video mode 1024 x 768.
Supports video mode 1152 x 864.
Supports video mode 1280 x 720.
Supports video mode 1280 x 768.
Supports video mode 1280 x 960.
Supports video mode 1280 x 1024.
Using hardware-based T&L.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded splash screen.
Loaded options screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded alphabet screen.
Loaded credits screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded stitch screen.
Loaded quit dialog screen.
CGameMain::StateGameLoading() -- 0.0
CGameMain::StateGameLoading() -- 0.1
CGameMain::StateGameLoading() -- 0.2
CGameMain::StateGameLoading() -- 0.2
CGameMain::StateGameLoading() -- 0.3
----------------------------------------------
Loaded default texture.
Loaded heads-up display texture.
Loaded floor texture.
Loaded skybox''s north wall texture.
Loaded skybox''s south wall texture.
Loaded skybox''s east wall texture.
Loaded skybox''s west wall texture.
Loaded skybox''s roof texture.
Loaded explosion texture.
Loaded player tank texture.
Loaded enemy tank body texture.
Loaded enemy tank top texture.
Loaded enemy tank turret texture.
Loaded impact flare texture.
Loaded all-white texture.
Loaded alphabet texture.
Loaded ''game over'' success msg texture.
Loaded ''game over'' failure msg texture.
Loaded ''enemy detected'' failure msg texture.
CGameMain::StateGameLoading() -- 0.4
CGameMain::StateGameLoading() -- 0.5
CGameMain::StateGameLoading() -- 0.6
CGameMain::StateGameLoading() -- 0.7
CGameMain::StateGameLoading() -- 0.8
CGameMain::StateGameLoading() -- 0.9
CGameMain::StateGameLoading() -- 1.0
CGameMain::StateGameLoading() -- 1.1
CGameMain::StateGameLoading() -- 1.2
CGameMain::StateGameLoading() -- 1.3
CGameMain::StateGameLoading() -- 1.4
CGameMain::StateGameLoading() -- 1.5
CGameMain::StateGameLoading() -- 1.6
CGameMain::StateGameLoading() -- 1.7
CScriptEvents::LoadScriptFile() -- 0.0
CScriptEvents::LoadScriptFile() -- 0.1
CGameMain::StateGameLoading() -- 1.8
CGameMain::StateGameLoading() -- 1.9
CGameMain::StateGameLoading() -- 2.0
CGameMain::StateGameLoading() -- 2.1
CGameMain::StateGameLoading() -- 2.2
CGameMain::StateGameLoading() -- 2.3
CGameMain::Render() -- 0.0 **************
CGameMain::Render() -- 0.1
CGameMain::Render() -- 0.2
CGameMain::Render() -- 0.3
CGameMain::Render() -- 0.4
CGameMain::Render() -- 0.5
CGameMain::Render() -- 0.6
CGameMain::Render() -- 0.7
CGameMain::Render() -- 0.8
CGameMain::Render() -- 0.9
CGameMain::Render() -- 1.0
CGameMain::Render() -- 1.1
CGameMain::Render() -- 1.2
CGameMain::Render() -- 1.3
CGameMain::Render() -- 1.4
CGameMain::Render() -- 1.5
CGameMain::Render() -- 1.6
CGameMain::Render() -- 0.0 **************
CGameMain::Render() -- 0.1
CGameMain::Render() -- 0.2
CGameMain::Render() -- 0.3
CGameMain::Render() -- 0.4
CGameMain::Render() -- 0.5
CGameMain::Render() -- 0.6
CGameMain::Render() -- 0.7
CGameMain::Render() -- 0.8
CGameMain::Render() -- 0.9
CGameMain::Render() -- 1.0
CGameMain::Render() -- 1.1
CGameMain::Render() -- 1.2
CGameMain::Render() -- 1.3
CGameMain::Render() -- 1.4
CGameMain::Render() -- 1.5
CGameMain::Render() -- 1.6
CGameMain::Render() -- 0.0 **************
CGameMain::Render() -- 0.1
CGameMain::Render() -- 0.2
CGameMain::Render() -- 0.3
CGameMain::Render() -- 0.4
CGameMain::Render() -- 0.5
CGameMain::Render() -- 0.6
CGameMain::Render() -- 0.7
CGameMain::Render() -- 0.8
CGameMain::Render() -- 0.9
CGameMain::Render() -- 1.0
CGameMain::Render() -- 1.1
CGameMain::Render() -- 1.2
CGameMain::Render() -- 1.3
CGameMain::Render() -- 1.4
CGameMain::Render() -- 1.5
CGameMain::Render() -- 1.6
CGameMain::Render() -- 0.0 **************
CGameMain::Render() -- 0.1
CGameMain::Render() -- 0.2
CGameMain::Render() -- 0.3
CGameMain::Render() -- 0.4
CGameMain::Render() -- 0.5
CGameMain::Render() -- 0.6
CGameMain::Render() -- 0.7
CGameMain::Render() -- 0.8
CGameMain::Render() -- 0.9
CGameMain::Render() -- 1.0
CGameMain::Render() -- 1.1
CGameMain::Render() -- 1.2
CGameMain::Render() -- 1.3
CGameMain::Render() -- 1.4
CGameMain::Render() -- 1.5
CGameMain::Render() -- 1.6
CGameMain::Render() -- 0.0 **************
CGameMain::Render() -- 0.1
CGameMain::Render() -- 0.2
CGameMain::Render() -- 0.3
CGameMain::Render() -- 0.4
CGameMain::Render() -- 0.5
CGameMain::Render() -- 0.6
CGameMain::Render() -- 0.7
CGameMain::Render() -- 0.8
CGameMain::Render() -- 0.9
CGameMain::Render() -- 1.0
CGameMain::Render() -- 1.1
CGameMain::Render() -- 1.2
CGameMain::Render() -- 1.3
CGameMain::Render() -- 1.4
CGameMain::Render() -- 1.5
CGameMain::Render() -- 1.6


Stephen

Share this post


Link to post
Share on other sites
OK, thanks to your feedback, I discovered something crucially wrong about my code.

My approach to dynamic vertex buffers was completely wrong, yet it worked on a large number of machines. Go figure! Thanks to the excellent docs available on the NVidia website, I straightened myself out...

I am currently overhauling my code and I will post a new version of the game in the next few hours.

I highly recommend the article "Efficient Use of Vertex Buffers" by Richard Huddy on the NVidia website. It's a little old (DirectX 7-related), but it helped me figure out what I was supposed to do.

Note to the GameDev editors: I think that a feature article on how to do dynamic buffers in DX8 would be great to see on this website. Microsoft's SDK has a page on the issue, but leaves out a LOT of detail that newbies need to see. Nvidia has some great docs, too, but as I mentioned, they're either too old or too general.

I'll post snippets of my dynamic VB code for future reference. When the GameDev search engine comes back online that may help the next guy tackling this problem.

--Neil.

edit: added hyperlinks.

----------------------
Check out my game demo and resume at
www.fivestory.com/projects/game.

[edited by - HoozitWhatzit on November 22, 2002 5:03:10 PM]

Share this post


Link to post
Share on other sites
I've uploaded the changes. If anybody has another minute, would you mind trying it out?

For the benefit of anyone else who's struggled with dynamic vertex buffers, I'll post the code that I've settled on below.

About the code: m_VBPos is a cursor that keeps track of how many verts you've placed into the buffer. This helps to know when to flush the buffer.

m_BaseVertexIndex is used for the second parameter of the pDevice->SetIndices() call.

CBitmapVertex is my custom FVF class containing vertex data.

Lastly: m_bFlushVB should be TRUE the first time this code is executed.

Here's the locking code:

    
CBitmapVertex* pVertexData = 0;


if (totalVertsToCopy == 0)
return;


m_BaseVertexIndex = m_VBPos;

// Lock the vertex buffer.

if ((m_VBPos+totalVertsToCopy) < VB_SIZE && !m_bFlushVB) {
m_pVB->Lock(m_VBPos * sizeof(CBitmapVertex), totalVertsToCopy * sizeof(CBitmapVertex), (BYTE**)&pVertexData, D3DLOCK_NOOVERWRITE);

} else {

m_pVB->Lock(0, totalVertsToCopy * sizeof(CBitmapVertex), (BYTE**)&pVertexData, D3DLOCK_DISCARD);
m_bFlushVB = FALSE;
m_VBPos = 0;
m_BaseVertexIndex = 0;
}


Here's the rendering code:

              
g_pDevice->SetIndices(m_pIB, m_BaseVertexIndex);

g_pDevice->DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0, totalVertsToCopy, startIndex, numPrims);


The crucial element for me was the pDevice->SetIndices() call. I had been using zero (0) as the second parameter to this call for months. However, when locking VBs with the NOOVERWRITE flag, I learned you should use an offset value into the location of your most recent block of vertex data; this may be non-zero when using NOOVERWRITE.

Another crucial factor that I was too stupid to realize was this: the data pointer that is returned from a Lock() call always points to the location where your first byte of data should be copied. I had believed that this pointer always pointed to the beginning of the VB no matter what lock flag you used...

Again, the lack of info in the SDK is a shortcoming that I think should be addressed, in my humble opinion.

Thanks again to anyone who helps me test my game!
--Neil.

(edit: editing the source tags for appearance).

----------------------
Check out my game demo and resume at
www.fivestory.com/projects/game.

[edited by - HoozitWhatzit on November 22, 2002 8:08:52 PM]

[edited by - HoozitWhatzit on November 22, 2002 8:13:18 PM]

Share this post


Link to post
Share on other sites
Hey this is an addon to my last post:

just wanna say im not trying to rip ur code off and steal it, its just im 12 and am trying to learn and code to this would greatly help. i would be learning certain graphics aspects along with probably some mathmatical stuff that is nessacery in a game.

thanks

Quantum Kid!
"When the going hets tough he tough gets going"

Share this post


Link to post
Share on other sites
QuantumKid:

I understand your needing to see source code to learn this stuff, but certainly you can understand my hesitation to send you mine. I'm sure your motives are pure, but I don't usually show anyone my full-blown source code--unless they're going to give me a job! (I'm looking for one, btw)

However, I'm happy to help you out with any specific problems you might be having programming your own game (or at least the ones that I can help you with--I'm a relative newbie myself).

It's best to keep questions here on the gamedev website, but you can also e-mail me if you'd rather ask me something directly: njohnson@fivestory.com.

Thanks for your comments, and good luck!

--Neil.

----------------------
Check out my game demo and resume at
www.fivestory.com/projects/game.

[edited by - HoozitWhatzit on November 22, 2002 12:59:22 AM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Hooz,

I haven''t had a chance to try your demo, but your description of the crashes reminds me of an earlier problem I had with D3DX. Since you lifted the console from a book, I''m gonna guess it makes use of the D3DX libraries (likely with CD3DFont) The problem might be as simple as using the d3dx8 debug libraries.

The normal dx libraries are both debug and release friendly. It''s just the D3DX libs that aren''t. I''ve thrown in a snippet to dynamically include the correct lib.

#ifdef _DEBUG
#pragma comment(lib, "d3dx8d.lib"
#else
#pragma comment(lib, "d3dx8.lib"
#endif


TLC

Share this post


Link to post
Share on other sites
Great game!

FPS: 60
Celleron 400
RivaTNT2 64mb
256MB RAM
Windows ME

Controling the ship is a little harder, I got a little confused at first. The terrain has to much deeps and highs.
The mouse pointer in the menu responds a little delayed.

It looks great anyway, good job dude

Share this post


Link to post
Share on other sites
Ok i understand hooz, about the job... i have a company that is just starting out... and i need a few good progammers. it wont pay much at first but when we start selling games im sure i can get u at least a little money... i know its not a great offer but mostly its just to bring it to ur attention if ur interested at all... thanks!:D

quantumkid

Quantum Kid!
"When the going hets tough he tough gets going"

Share this post


Link to post
Share on other sites