Game Development Community

[1.1a DedSrv] DOF can't find focal point on Dedicated Server - RESOLVED

by Henry Todd · in Torque 3D Professional · 01/18/2010 (1:57 am) · 4 replies

Seems the DoF, which is enabled when you zoom with Z, is unable to find its focal point when you're playing on a dedicated server. I assume it's using a client-side raycast, so I have no idea why this would work in singleplayer or on a listen server and not on the DS.

There seem be a number of bugs that pop up only on a dedicated server, such as the explosion rendering bug someone else posted about a while back, or the scripted weapon selection failing.

(On an unrelated note, the forum tags section doesn't like commas, but the description says they should be used.)

#1
06/06/2010 (2:37 pm)
Logged as TQA-251.
#2
10/04/2010 (1:38 am)
This is still present in 1.1B3
#3
03/03/2011 (1:53 pm)
Greetings!

This has been fixed in 1.1 Final.

The issue ended up being that the DOF container search was going through the server container. That is why it worked in single player, but not multiplayer.

Changes to sceneGraph/sceneObject.cpp

Add the following include:

#include "T3D/gameBase/gameConnection.h"

Modify the top of the containerRayCast engine function to now read as:

{
   if (pExempt)
      pExempt->disableCollision();

   GameConnection* serverConnection = GameConnection::getConnectionToServer();
   Container* pContainer = serverConnection ? &gClientContainer : &gServerContainer;

   RayInfo rinfo;
   S32 ret = 0;
   if (pContainer->castRay(start, end, mask, &rinfo) == true)
      ret = rinfo.object->getId();

   if (pExempt)
      pExempt->enableCollision();
...

Changes to FPS Example/game/core/scripts/client/postFX/dof.cs

Modify line 512 from:

%result = containerRayCast( %start, %end, %mask, %cam );

to this:

%result = containerRayCast( %start, %end, %mask, %control );

- Dave
#4
04/24/2011 (6:52 pm)
Fixed in 1.1 Final and Preview.