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!
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!
#2
04/02/2004 (9:23 am)
Ok, thanks, I'll dig into that LocalConnectionGroup.
#3
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!
04/15/2004 (8:36 am)
HumThere 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
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?
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?
Associate Kyle Carter
If you read the C++ source you will find a LocalConnectionGroup or something similar in which all local ghosted objects reside.