Game Development Community

InitRadiusSearch (or similar) on the client?

by Hugo Mardolcar · in Torque Game Engine · 04/01/2004 (9:19 am) · 5 replies

Hello everyone!

I'm making a minimap for my game, and I'm right now taking care of drawing the objects on that minimap (besides the player of course, I want to draw the buildings, other players, etc).

Now, I'm able to do it if the game is single player... but when I switch to multiplayer the dots that represent the objects don't appear, and that is because I'm using the initRadiusSearch method and, when in multiplayer, that doesn't work...

Does any of you know of any other way of search for the surrounding objects?

Of course I can switch the object search to the server side, but that would put too much (unnecessary) pressure on the network.

I guess there's a way at least to find the objects that are within the player's field of view, but I don't know how...

Thanks in advance!

#1
04/02/2004 (8:21 am)
You can iterate over objects that the client is aware of but because of Torque's network architecture you can't get all objects unless you force them scoped at all times.

If you read the C++ source you will find a LocalConnectionGroup or something similar in which all local ghosted objects reside.
#2
04/02/2004 (9:23 am)
Ok, thanks, I'll dig into that LocalConnectionGroup.
#3
04/15/2004 (8:36 am)
Hum

There is no LocalConnectionGroup, but there is a ClientConnectionGroup.

The problem is that there are only 3 references to this ClientConnectionGroup in the whole C++ code (and no references to it in the scripts).

Also, when I try to make on the console "echo(ClientConnectionGroup.listObjects());" it shows that ClientConnectionGroup is empty, and there are clients in the player's scope...

So, does anyone know any other way of finding which objects is the currect player/client viewing?

Thanks for the info!
#4
04/15/2004 (9:31 am)
Hi Hugo,

I just had to solve a similiar type of problem. I'm making a client-side only raycast for doing mouse-overs of game objects. I didn't want to have to ask the server everytime, because client's will do a lot of mouse-overs. Here's a thread about it.

Basically, what I had to do was have the server send the client a reference to itself (and use getGhostIndex() and resolveGhost() while sending, to make sure the client is using the correct ID for their gameset), then use a client-side raycast. To get the raycast working, I had to make a new function from the console function ContainerRayCast, and change the container searcher from gServerContainer to gClientContainer.

Not sure how it would work with a radius search, but perhaps the process will be similiar?
#5
04/15/2004 (12:52 pm)
Hummm

I'll try it, thanks!