Game Development Community

Register object failed" only on dedicated server?

by Lee Latham · in Torque Game Engine · 02/05/2007 (4:27 pm) · 7 replies

My explosions work fine when I run combined server/client, but when running from a dedicated server I get "register object failed for object (null) of class Explosion" on the server. I'm wondering if I've borked some client server stuff? Any ideas?

It may also be relevent that I can no longer connect to a combined server/client instance from another client. I used to could do this with no problem.

Also, my bravetree cars no longer can have their taillights mounted. I'm not mentioning that as a seperate problem (although it might be), but as a possible relevance. I get Unable to find object: 'MissionCleanup' attempting to call function 'add'--and this is when running as combined server/client as well. I just cannot figure out when that started happening. But again, I'm thinking I'm not "getting" something about the client/server model Torque uses.

Any ideas would be greatly appreciated. I'm positive I've done something foolish, but I'm not smart (or experienced) enough yet to figure out what it might be.

Lee

#1
02/13/2007 (11:31 pm)
Anybody? Surely this is obvious to someone other than me? :-)
#2
02/14/2007 (10:05 am)
Explosions themselves never actually "exist" on a dedicated server. In stock, explosions are not actually networked, but are client side only, and are the result of a projectile collision.

Honestly, explosions in stock torque are from Tribes, and the mechanism used isn't really the best--instead of creating the explosion itself and then networking it, we send a bit of information (the fact that the projectile has an explosion when it hits something), and then when the projectile collides on the client, the explosion occurs.
#3
02/14/2007 (4:00 pm)
Hmm...sooo..what does this mean? I get the error message on the server, and no explosions on my clients..?
#4
02/14/2007 (4:11 pm)
Hi Lee,

I received that same error message when running a dedicated server as soon as I upgraded to version 1.4.0 of TGE. I also noticed that some features associated with explosions either stopped working altogether or did not function correctly in 1.4.0 (IFL animations, debris etc).

Search through the bug forums for some community fixes / patches. IIRC the problem(s) may have been fixed in versions 1.4.2 / 1.5.0 of TGE.

Alternatively grab the explosions source code from version 1.3 (you'll have to make some minor modifications to compile in 1.4 and above) and use that.

Best of luck.
#5
02/14/2007 (4:12 pm)
Stephen already told you what it meant. Explosions are client-side only objects that are not designed to be created as an object on the server because it is merely a visual feature and nothing the server should worry about.

As for the rest of your questions, I have no clue. :)

Edit: Your explosions won't "turn up on your clients" because you need to spawn them on each client, not on the server.
#6
02/14/2007 (8:59 pm)
Tim: I'm using 1.5.. :(

Edit: Stephen, I'm trying to grasp the implication. Does that mean that only a projectile explosion can be invoked from a server? I could maybe do a test in the projectile collision code on the collidee's health and do a different explosion, then?

Stefan/Stephen: sorry if I'm being obtuse--I'm a novice scripter. The sample code shows a way of creating explosions, which I copied, of course. How does one go about "spawining" it client-side? It's blowing my mind just thinking about it :-}

I'm blowing up vehicles when their health reaches zero. So I have:
function VehicleData::damage(%this,%obj,%type,%vel,%damage,%damageType)
{
   echo("Vehicle IS HIT");
  %obj.applyDamage(%damage);
  if(%obj.getDamageState() $= "Destroyed" )
  {
     blowup (%obj);
   }
   Parent::damage(%this, %obj);
}

and then I blow it up:

function blowup(%obj)
{
%pos = %obj.getposition();
%p = new explosion() {
dataBlock = "CrossbowExplosion";
position = %pos;
};

%obj.schedule(2000, "delete");

}
#7
02/18/2007 (8:38 pm)
Found this thread which has a link to a resource for a hack that looks like it should work fine:

http://www.garagegames.com/mg/forums/result.thread.php?qt=7653