Game Development Community

Game crashes with too many aiPlayer

by Matt Ahrens · in Torque 3D Professional · 05/12/2011 (9:11 am) · 4 replies

i am trying to devlop a RTS prototype, but once i have trained serveral units the game crashes. I am using ther version of torque before 1.1 and a 2.4 intel core duo on a macbook pro 2 gb memory and GeForce 8600 256 mb. I don't know if its my computer but i could swear i had anther game that more aiPlayers and wasn't crashing. Are they any known issues with aiPlayer's or something related to them. At first i thought it might be all the schdule calls i was making to get the workers to work, and buildings to build. I am not sure that is the case any more. I modified the scripts and it seems to crash when there is too many units, but is it posible for it to crash with too many schedule calls? I am going to run it in debug mode to see if i find anything.

#1
05/12/2011 (9:22 am)
ok, i debuged it and it crashes in the drawIndexedPrimitive() function file gfxGLDevice.cpp third line with error EXC_BAD_ACCESS. not sure exactly what that means. but my guess is that there is too many polys on the screen and it is crashing? It dosn't seem like there are that many, but i am using kork as my main worker, so maybe i just a lower poly model? still feels like it is crashing with low number of polys is there any other way to fix this?
#2
05/12/2011 (10:51 am)
It's the shadows...
I ran into a similar issue. My "fix" (source code side) was:

In basicSceneObjectLightingPlugin.cpp, in renderShadow comment out both lines that reference mShadow, and above that in updateShadow, comment out everything in that function. No more shadows, but also no more crashes.
#3
05/12/2011 (2:08 pm)
thanks thats seems to work. Maybe i can find a different solution later, but that does work for now.
#4
05/12/2011 (2:53 pm)
Basic Lighting uses a projected decal which updates every tick which is really expensive performance-wise if you have a lot of playerObjects. You can also disable the shadows in script for the various lighting settings in game/core/scripts/defaults.cs - just scroll down until you come to the lighting preference section and you'll see it. That way you can turn it off when you choose the lighting quality setting in the options Menu (ctrl O in-game).