Game Development Community

Advanced Camera and Interpolation

by Alex (Stalker) Sakablukow · in Torque Game Engine Advanced · 11/18/2006 (2:49 am) · 2 replies

I have a problem with this ressource:
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5471

I have the original "Thomas 'Man of Ice' Lund"-ressource with updates from "Gustavo Carvalho".. my problem is that since i have added the changes from Gustavo Carvalho, i can't see any item or ai-driven char.
It seems that i can see only client-side loaded things.

Probably its a server-client problem.. but maybe something else?

You can find my advCamera.h and a part of advCamera.cc on the end of ressource-thread.
It will be great, if someone can find the error.. i have tryed to fix it, but with no success :-/

#1
11/18/2006 (3:29 am)
Try this post:
Quote:Manoel Neto (Mar 07, 2005 at 19:27 GMT)
Okay, found a nasty bug.

The advanced camera server position is always ZERO, so things like items and vehicles will disappear around you if you walk too far from the world origin.

I got a small hack to solve it, and better solutions are welcome.

Go to advancedCamera::advanceTime() and move everything past updateMovementValues(dt) to advancedCamera::interpolateTick(), after Parent::interpolateTick(dt), so now yout advanceTime looks like this:

void AdvancedCamera::advanceTime(F32 dt) {

  Parent::advanceTime(dt);
  
  updateMovementValues(dt);
}


Now go to AdvancedCamera::processTick and add these at the end:

if (isServerObject())
	{
		interpolateTick(0.032f);
	}


(that magical number is how long a tick lasts - it wasn't needed really)

Compile, and now the scope problems are gone.
#2
11/18/2006 (5:20 am)
The game crash in the first frame after mission-loading if i add this changes.