Force rendering of an object?
by Daniel Buckmaster · in Torque Game Engine · 09/13/2008 (12:42 pm) · 13 replies
I'm running into problems with my game - at certain look angles, my player and weapon completely disappear, and stop animating - since I'm using the more realistic first person resource, this means my camera stops moving.
I think the problem is that for some reason, the engine decides that the player no longer needs to be rendered, therefore animated. How do I force the player to be renered?
I think the problem is that for some reason, the engine decides that the player no longer needs to be rendered, therefore animated. How do I force the player to be renered?
About the author
Studying mechatronic engineering and computer science at the University of Sydney. Game development is probably my most time-consuming hobby!
#2
09/13/2008 (2:11 pm)
I dropped in the realistic first person resource and haven't run into any angles that cause the player not to render. Does it happen with the Torque Orc? If so, how often?
#4
09/13/2008 (3:28 pm)
Also, you might try looking at the scene through the world editor, which will show the player bounding box.
#5
The problem happens every time I look about 45 degrees up (but not down). I am using custom animations, too, which may explain it.
I has a misconception that LOSCol meshes were used to determine line of sight collision, so I put a big LOSCol mesh around the player's head. Of course, this didn't work :P.
09/14/2008 (4:05 am)
Quote:The downside to that is that it will also make the object collide with object's it's not supposed to collide with (since collision goes off the bounding box).This is exactly the prolem I want to avoid. I'm using the Orange Guy, who is roughly the same size as Kork, and I left the datablock settings the same. The thing is, I want to make the bounding box as small as possible, so that it's basically the size of the player's body (maybe a little larger). This will partly allow more realistic movement through tight spaces. I'm using hitboxes for projectile collision, so the bounding box doesn't come into play there.
The problem happens every time I look about 45 degrees up (but not down). I am using custom animations, too, which may explain it.
Quote:This might happen if the animations move the skeleton far outside the bounding box.That's what I'm thinking is happening - but I don't know how I should solve the problem. I checked out that resource link, thanks - I might see if it helps at all. The problem is, I don't really want to change the player's bounding box - I just want to make sure the player always renders.
I has a misconception that LOSCol meshes were used to determine line of sight collision, so I put a big LOSCol mesh around the player's head. Of course, this didn't work :P.
#6
with a debug build, just open the console and set "GameBase::boundingBox" to true.
(that's from a TGE 1.4 codebase, but probably true in whatever you're using)
or go in to player.cc and change this line:
09/14/2008 (1:39 pm)
Sounds like you need to determine if it's this animation vs. bounding box issue or not.with a debug build, just open the console and set "GameBase::boundingBox" to true.
(that's from a TGE 1.4 codebase, but probably true in whatever you're using)
or go in to player.cc and change this line:
if (!mShapeInstance || gShowBoundingBox) {to this:if (true) {
#7
EDIT: Yes, that is the solution :P. But this strikes me as not a great solution for the future - what if I want to, for example, have the camera placed on the scope of a weapon? I refuse to make all my bounding boxes big enough to cover every weapon eventuality :P. In fact, I want to go smaller. I guess it's oky for players, but I can forsee a number of issues (like that weapon ting I mentioned).
09/15/2008 (7:52 am)
I thought they were the same issue. I did what you suggested. I don't know what it tells me, but I still think that you were riht before - my running animation combined with the look up animation is carrying the eye node outside the bounding box. Is the solution simply to make my bounding box bigger?EDIT: Yes, that is the solution :P. But this strikes me as not a great solution for the future - what if I want to, for example, have the camera placed on the scope of a weapon? I refuse to make all my bounding boxes big enough to cover every weapon eventuality :P. In fact, I want to go smaller. I guess it's oky for players, but I can forsee a number of issues (like that weapon ting I mentioned).
#8
09/16/2008 (9:45 am)
Here's another (big) issue. When I use the new player positions resource (and associated addon resources) I'm changing the character's bounding box based on their stance. When I go prone, I usually can't see the character's bounding box when the transition happens. So I get stuck with an unanimated, invisible character.
#9
09/16/2008 (10:02 am)
It really sounds like that bounding-box-updating resource may be what you're after.
#10
09/17/2008 (12:54 pm)
It's not the bounding box that's the problem - from what I can see, that resource will compute the size the bounding box should be to encompass the whole shape. I don't need my bounding box to change at all. The problem is that when I do things that change the bounding box, the camera gets left behind - so the character is not rendered, not animated, and since the camera is attached to a node that is animated to move the camera, it goes unresponsive.
#11
Just an idea... I can write it up if you need.
edit* grammar.
09/17/2008 (12:58 pm)
Why not prevent the "eyeNode" or "camera" (whatever is leaving the bounding box) from leaving the bounding box? This would keep your bounding box the same size, but you might start seeing the insides of the object.Just an idea... I can write it up if you need.
edit* grammar.
#12
Alternatively, I could hack into the rendering code, and see if the object is the client's control object, and if so, force a render.
09/20/2008 (3:30 am)
The camera node doesn't leave the bounding box (now that I've made the box bigger). The problem is when I change pose (for example, stand->prone), the old camera position is outside the new bounding box. Therefore the model doesn't render, and doesn't animate. I think the inherent problem is the animation transition - the bounding box change is instant, but the animation transition isn't. Maybe I need to do some bound-box-interpolation code.Alternatively, I could hack into the rendering code, and see if the object is the client's control object, and if so, force a render.
#13
I apologise for an amount of blunt stupidity, as well as a small amount of reading what you wrote. My bad.
That resource isn't exactly what I'm looking for, but it will be a start, at least - thanks for providing the link. I think what I'll do is just expand the bounding box while the transition is in place to include both player boxes (old and new), so that the cam node definitely doesn't leave the box. This shouldn't create too many additional problems, since you generally won'tmove a great deal while transitioning.
EDIT: That approach is working. I initially used some fancy interpolation code that made the bounding box grow/shrink to the desired size over time, but depending on the two animations transitioning, the cam node would still get outside the box.
09/26/2008 (11:54 am)
Ah. Now I see what you were saying all along, Orion. :PI apologise for an amount of blunt stupidity, as well as a small amount of reading what you wrote. My bad.
That resource isn't exactly what I'm looking for, but it will be a start, at least - thanks for providing the link. I think what I'll do is just expand the bounding box while the transition is in place to include both player boxes (old and new), so that the cam node definitely doesn't leave the box. This shouldn't create too many additional problems, since you generally won'tmove a great deal while transitioning.
EDIT: That approach is working. I initially used some fancy interpolation code that made the bounding box grow/shrink to the desired size over time, but depending on the two animations transitioning, the cam node would still get outside the box.
Torque 3D Owner Avid Gamer