TGEA 1.8.1 Projectile rending appears to be moving backwards
by Andrew13 · in Torque Game Engine Advanced · 04/04/2009 (5:54 pm) · 20 replies
I am seeing a very strange effect on projectiles with an attached camera that wanted to try and get some input on.
I started with the template project on TGEA 1.8.1.
i added this code to the swarmgun.cs projectile block to attach a camera to a moving projectile.
I set the life of the projectile higher and started moving the camera after firing and watching the results.
It appears that the position of the projectile was reverting to an earlier point in its path . At other times is seems the projectile "stopped".
what i see appears like this
Frame 1 projectile in correct positon ( ie in front of the particle trail)
Frame 2 projectile in postion -4 relative to original position
Frame 3 projectile in postion -3
etc
Eventually the projectile appears to get back to the head of the particle trail , then on the next frame jumps back. Suspecting a lack of processing power i moved the project from a 2.3 Core duo 2 laptop with 256 mb graphics to a quad xeon with a 512 mb graphics card. However this did not result in any improvement.
I will work on posting a movie but wanted to see if this rang any bells .
thanks
I started with the template project on TGEA 1.8.1.
i added this code to the swarmgun.cs projectile block to attach a camera to a moving projectile.
%obj.client.setControlObject(%obj.client.camera); %obj.client.camera.setOrbitMode( %p, %p.getTransform(), 0.05, 0.05, 0.05);
I set the life of the projectile higher and started moving the camera after firing and watching the results.
It appears that the position of the projectile was reverting to an earlier point in its path . At other times is seems the projectile "stopped".
what i see appears like this
Frame 1 projectile in correct positon ( ie in front of the particle trail)
Frame 2 projectile in postion -4 relative to original position
Frame 3 projectile in postion -3
etc
Eventually the projectile appears to get back to the head of the particle trail , then on the next frame jumps back. Suspecting a lack of processing power i moved the project from a 2.3 Core duo 2 laptop with 256 mb graphics to a quad xeon with a 512 mb graphics card. However this did not result in any improvement.
I will work on posting a movie but wanted to see if this rang any bells .
thanks
#2
I can see this even adding this code to a stock template project. Faster machines seem to have exactly the same problem leading me to believe the issue is somewhere in the rendering code ?
Any help would be greatly appreciated. I have put up a high and low res version of the movie.
thanks
04/05/2009 (10:45 pm)
Still not having any luck finding out what causes this strange effect.I can see this even adding this code to a stock template project. Faster machines seem to have exactly the same problem leading me to believe the issue is somewhere in the rendering code ?
Any help would be greatly appreciated. I have put up a high and low res version of the movie.
thanks
#3
04/06/2009 (5:17 am)
On my computer, the template project is a bugware( and the new generated projects too): "teleport" mooving, small stops, sound issues, etc. I'm using the Stronghold example. Try to include your script code in to the stronghold example for a test. On my brother's computer (64bit system), the torque going to crazy. The Global timers go mad, and all game demos speed up at least 20x faster than standard game speed. The template is jam (no screen refresh, only when he was move the window) sorry for my english, I hope u understand me.
#4
I think i understand that you have seen bad things from the template project.
I like your Idea. I will try the stronghold project
04/06/2009 (4:52 pm)
MartonI think i understand that you have seen bad things from the template project.
I like your Idea. I will try the stronghold project
#5
The effect there is even more noticeable. The particle trail and the arrow are offset and the arrow is clearly skipping .
I will try the Stronghold project next
04/06/2009 (5:04 pm)
As an experiment I tried adding the above code to the crossbow weapon onfire in the template project.The effect there is even more noticeable. The particle trail and the arrow are offset and the arrow is clearly skipping .
I will try the Stronghold project next
#6
I used the stock stronghold project
I added the below code in crossbow.cs in function CrossbowProjectile::onCollision
Then i added
in function CrossbowImage::onFire
The result is the same as the template project. In this case the particle trail is vertically offset from the projectile. Also the projectile is oscillating back and forth along its flight path.
This tells me its not a defect in the projects. Could my camera transform be rendering position incorrectly ?
If anything this effect is easier to see with the crossbow as its flight path is non-ballistic.
I get the same result moving everything to a faster CPU better GPU .
anyone help me out here ? Thanks
04/06/2009 (5:19 pm)
OK here is what i did I used the stock stronghold project
I added the below code in crossbow.cs in function CrossbowProjectile::onCollision
//This code returns camera to player
echo("boom");
%player=%obj.client.player;
%obj.client.setControlObject(%player);
%obj.client.camera.setTransform(%player.getEyeTransform());Then i added
%obj.client.setControlObject(%obj.client.camera); %obj.client.camera.setOrbitMode( %p, %p.getTransform(), -7, 1.0, 1.1);
in function CrossbowImage::onFire
The result is the same as the template project. In this case the particle trail is vertically offset from the projectile. Also the projectile is oscillating back and forth along its flight path.
This tells me its not a defect in the projects. Could my camera transform be rendering position incorrectly ?
If anything this effect is easier to see with the crossbow as its flight path is non-ballistic.
I get the same result moving everything to a faster CPU better GPU .
anyone help me out here ? Thanks
#7
Both the arrow and the shell are DTS shapes ... is there a way to control how accurately these are rendered ?
I also tried removing the particle trail ..no luck the DTS projectile still skips back and forth.
04/07/2009 (9:45 pm)
I tried this on a third computer ..same result.Both the arrow and the shell are DTS shapes ... is there a way to control how accurately these are rendered ?
I also tried removing the particle trail ..no luck the DTS projectile still skips back and forth.
#8
with prediction (ie your camera is seeing the predicted position rather than the real one, and that prediction is way off) ?
It just reminds me of when I was trying to get prediction better in a RtCW
mod I did many years ago.
Just an idea to look at :)
Hewster
04/07/2009 (11:39 pm)
Just throwing this out there, but could it be network interpolation screwingwith prediction (ie your camera is seeing the predicted position rather than the real one, and that prediction is way off) ?
It just reminds me of when I was trying to get prediction better in a RtCW
mod I did many years ago.
Just an idea to look at :)
Hewster
#9
The projectile interpolation is wrong, the camera works fine. Try to send it to the bug list, I hope GG will fix it.
04/08/2009 (9:55 am)
I was tested this yesterday, sorry I don't know the solution :(The projectile interpolation is wrong, the camera works fine. Try to send it to the bug list, I hope GG will fix it.
#10
Could you tell me the system specs and OS version of your computer so i can include them in the bug report ?
Also what Version TGEA did you try ?
Thanks again for your help.
Can anyone else confirm this bug ?
04/08/2009 (5:39 pm)
Marton Could you tell me the system specs and OS version of your computer so i can include them in the bug report ?
Also what Version TGEA did you try ?
Thanks again for your help.
Can anyone else confirm this bug ?
#11
Tested with my project and with the Stronghold example.
Config: WinXP 32bit, Notebook 2ghz Core2Duo, 2Gb ram, X1600 Ati card 256MB vram
04/08/2009 (7:01 pm)
version: TGEA 1.8.1Tested with my project and with the Stronghold example.
Config: WinXP 32bit, Notebook 2ghz Core2Duo, 2Gb ram, X1600 Ati card 256MB vram
#13
Using the same code I created a multiplayer game using the stronghold project.
I had a second player standing perpendicular to the firing player . I had both players windows open side by side on my desktop.
The same effect was visible from the second player . The particle trail was offset vertically and the DTS projectile was "oscillating" back and forth along its flight path.
So clearly not some sort of "forced perspective" effect.
I am going to repeat the same test without the code and see if the problem goes away.
04/11/2009 (2:22 pm)
As an experiment I wanted to see if this effect was caused by camera angle.Using the same code I created a multiplayer game using the stronghold project.
I had a second player standing perpendicular to the firing player . I had both players windows open side by side on my desktop.
The same effect was visible from the second player . The particle trail was offset vertically and the DTS projectile was "oscillating" back and forth along its flight path.
So clearly not some sort of "forced perspective" effect.
I am going to repeat the same test without the code and see if the problem goes away.
#14
The problem still exsists...Its just hard to see but its there .
Clearly the code i posted exaggerates the problem ...in particular the particle trail is more offset vertically with the code applied .
I don't see anything in the known issues that would effect this .
Anyone have any suggestions on where to proceed from here ? I am not familiar with the source enough to even know where to start looking.
04/11/2009 (2:48 pm)
I repeated the test without the code.The problem still exsists...Its just hard to see but its there .
Clearly the code i posted exaggerates the problem ...in particular the particle trail is more offset vertically with the code applied .
I don't see anything in the known issues that would effect this .
Anyone have any suggestions on where to proceed from here ? I am not familiar with the source enough to even know where to start looking.
#15
I Tried removing the particle trail altogether, however the projectile still oscillated back and forth.
I tested hewster's suggestion ...i setup a 2nd computer and a small network. Using ipchains and changing some switch variables i created a very laggy connection between the 2nd computer and the server.
I did not see any change in either the client on the server ( <1ms lag) and the 2nd computer had renderings that looked equivalent on a frame per frame analysis.
I am going to try some different .dts shapes and see what effects that has on the problem.
Does anyone know how to control the position of the particle emitter relative to it's parent ?
04/12/2009 (11:49 pm)
Still not having any luck tracking this down.I Tried removing the particle trail altogether, however the projectile still oscillated back and forth.
I tested hewster's suggestion ...i setup a 2nd computer and a small network. Using ipchains and changing some switch variables i created a very laggy connection between the 2nd computer and the server.
I did not see any change in either the client on the server ( <1ms lag) and the 2nd computer had renderings that looked equivalent on a frame per frame analysis.
I am going to try some different .dts shapes and see what effects that has on the problem.
Does anyone know how to control the position of the particle emitter relative to it's parent ?
#16
On closer inspection in looks like the render of th projectile is actually being aborted or something . FOr example the "blot" projectile is consistently missing the front "cone" polys and well as the feathers .
If there a way to force TGEA to render in wireframe only mode ?
I can't find any reason for why the projectile particle emitter is vertically offset either . However i see the same approximate offset for both projectiles.
Any help would be greatly appreciated .
04/22/2009 (5:20 pm)
OK i tried the swarmgun projectile DTS. Same result .On closer inspection in looks like the render of th projectile is actually being aborted or something . FOr example the "blot" projectile is consistently missing the front "cone" polys and well as the feathers .
If there a way to force TGEA to render in wireframe only mode ?
I can't find any reason for why the projectile particle emitter is vertically offset either . However i see the same approximate offset for both projectiles.
Any help would be greatly appreciated .
#17
Try with that code:
04/23/2009 (2:34 am)
Andrew, i hope wrong ghosting ?Try with that code:
F32 ShapeBase::getUpdatePriority(CameraScopeQuery *camInfo, U32 updateMask, S32 updateSkips)
{
if (camInfo->camera == this) return 10.0f;
if (camInfo->camera && (camInfo->camera->getType() & ShapeBaseObjectType))
{ if(((ShapeBase *) camInfo->camera)->getObjectMount() == false)
return 10.0f;}
return Parent::getUpdatePriority(camInfo, updateMask, updateSkips);
}
#18
thanks for your post.
Where is this code ?
Also have you tried this on your setup ? I was able to produce the problem with the above code in both the template and stronghold projects.
04/23/2009 (5:21 pm)
Picaso thanks for your post.
Where is this code ?
Also have you tried this on your setup ? I was able to produce the problem with the above code in both the template and stronghold projects.
#20
Ok some change ...
what has not changed ...
The projectile models still jumps backwards and forwards . The projectile is still incorrectly modeled in that the " head " of the projectile is missing and are the feathers on the end are missing.
however some improvement..
at the start of the shot the projectile is simply jumping backwards and forwards along it's arc .. and only slightly. However by the end of the arc the projectile and it "ghosts " are both visible and the distance jumped is further.
perhaps if i increased this value ? Normally this value is 1 ? perhaps it needs to be larger ?
04/26/2009 (9:46 pm)
PicassoOk some change ...
what has not changed ...
The projectile models still jumps backwards and forwards . The projectile is still incorrectly modeled in that the " head " of the projectile is missing and are the feathers on the end are missing.
however some improvement..
at the start of the shot the projectile is simply jumping backwards and forwards along it's arc .. and only slightly. However by the end of the arc the projectile and it "ghosts " are both visible and the distance jumped is further.
return 10.0f
perhaps if i increased this value ? Normally this value is 1 ? perhaps it needs to be larger ?
Torque 3D Owner Andrew13
http://idisk.mac.com/stimpy-Public?view=web