Game Development Community

Cannot allocate that many verts in a volatile vertex buffer...

by Jack Stone · in Torque Game Engine Advanced · 11/24/2005 (8:01 pm) · 7 replies

I have begun porting a project from TGE 1.4 to TSE, and so far things are going pretty well. I havent had to change much code, mostly just the location of the guis and things. Anyway, I have a pretty sparse Space map, just two DTS planets, a DTS ship, and a player object, which has two particle emitter for contrails. The longer the player keeps the thrust button down, the longer the particle trail is.
That, and the User menus, guis etc are all I have ported so far.
It seems to work fine, I can select the mission, load it, and I have complete control of my ship. I can turn, accelerate, etc, but when I get to a certain speed, (IE when the particle trail is a certain size) I get a fatal error popping up:

Cannot allocate that many verts in a volatile vertex buffer, increase MAX_DYNAMIC_VERTS! -- BJG"

debugging in Visual C++, I find Line 1301 of gfxd3ddevice.cpp is causing the error. Doesnt sound too bad, I can just increase MAX_DYNAMIC_VERTS. However, I have tried changing lines 38 and 39 of gfxD3DDevice.h to larger numbers, going up in multiples of two. It was at 8192, I went to to twice that, and got the same error. THen went up even higher, im now at:


#define MAX_DYNAMIC_VERTS 1638400
#define MAX_DYNAMIC_INDICES 1638400

Which is way more than it was, and still its saying increase Max verts. Any ideas? Should I just keep adding zeroes? It doesnt seem to b working, even though it look like just a simple case of increasing a number.
THanks,
JS

#1
11/24/2005 (8:47 pm)
There are limits in DirectX as to the size of VB you can allocate. I would suggest turning down the particle counts. :) Can you tell me what's causing the assert, ie, what object's rendering is blowing up? Will help nail down the problem.
#2
11/25/2005 (8:06 am)
Well its a model of made of a spaceship, with two particle emmiters, thats all. It ran fine in TGE, Im surprised TSE supports less Dynamic Vertices, Id have thought it could take more?
I not sure what you mean by what object.... Ill try reducing the lifespan of the particles, see if that makes a difference?

EDIT:
Yes, reducing the lifespan of the particles fixes the error. (Smaller particle trail)
Im assuming this Maximum limit is not per object, its per gameworld? So the total number of dynamic vertices in your whole gameworld cant exceed this value? or is it per object?
If it was per object id be able to work with it no problem, but I intend to have quite a few multi-engined starships in my game, so I could end up running into a max limit if there was no way around it.
Thanks for any advice,
JS
#3
11/25/2005 (8:38 am)
Sorry, but I just got another error I think is relates to this:

AssertFatal(t <= 1.0f, "Out out bounds filter function for particle.");
in line 871, particleemiter.cpp.

It occurs when I change the colour of the contrail particle with this code: (again, worked in TGE)

if (Helmgui.getvalue() > 90 )
{

//moveforward(0);
//datablock ParticleData(ContrailParticle).lifetimeMS = 10;

ContrailParticle.lifetimeMS = 10;
ContrailParticle.colors[0] = "0.2173 0.757 0.006000 0.9";
$speedreadout = Helmgui.getvalue();




//echo("Helm Control");

}

The particle emitter does definatly change colour like it should, but about 2 or 3 seconds later, I get that error popping up. These seem to be all particle related, and when I was trying to port my .mis mission over originally, it gave me some error about particles as well, so I ended up modifying the existing TSE terrain_water_demo .mis file.
Is there a new particle editor im not using?

EDIT: removing the "ContrailParticle.lifetimeMS = 10;" line seems to fix this.

JS
#4
11/26/2005 (12:02 am)
What video card are you using? Let's take a peek at the top hardware portion of your console.log.
#5
11/26/2005 (8:33 am)
Ok, its an Nvidia 5950 ultra:

Video Init:
DirectX version - 9.0c
Direct 3D device found
Direct 3D device found

Cur. D3DDevice ref count=1
Pix version detected: 2.000000
Vert version detected: 2.000000
Initializing GFXCardProfiler (D3D9)
o Vendor : 'NVIDIA'
o Card : 'GeForce FX 5950 Ultra'
o Version: '81.94'
- Scanning card capabilities...
GFXCardProfiler (D3D9) - Setting capability 'autoMipMapLevel' to true.
- Loading card profiles...
- Loading card profile profile/D3D9.cs
- Loading card profile profile/D3D9.NVIDIA.cs
- No card profile profile/D3D9.NVIDIA.GeForceFX5950Ultra.cs exists
- No card profile profile/D3D9.NVIDIA.GeForceFX5950Ultra.8194.cs exists


JS
#6
12/07/2005 (11:58 am)
Are you using the Player class as the object you create or is it a vehicle class. I know that currently the player class has a vertex buffer problem and the particles could just be bringing this problem out in the open. If it is player class you might want to try making it a vehicle and seeing if that changes anything.
#7
12/24/2005 (4:38 pm)
Thanks, Ill try that. I am using the player class at the moment, its possible the vehicle class would actually be better for my project.
JS