Trying to understand GameConnection, AI, and team game play...
by John Kabus (BobTheCBuilder) · in Torque Game Engine · 07/08/2003 (10:35 am) · 4 replies
Trying to understand GameConnection, AI, and team game play...
I noticed that some team code already exists in the engine for things like the team hud chat. The team variable is on the %client object and seems to work for masking chat and for team scores. I also see that the %client object is setup initially in the GameConnection's onConnect (?). The question I have is this:
Is a GameConnection created for each player (including AIPlayer that seems to be derived from GameConnection, seems like a yes to me)? If so why don't the AIPlayers show up in the list of connected clients? Is it because there are multiple GameConnections but only one client?
Basically I'm trying to get my AIPlayers to show up as a player in the player hud list and team stats. Oh and also to be on different teams, if the relationship of GameConnections to clients is not 1:1 (ie one client) then the existing code will have to go.
Thanks...
John.
I noticed that some team code already exists in the engine for things like the team hud chat. The team variable is on the %client object and seems to work for masking chat and for team scores. I also see that the %client object is setup initially in the GameConnection's onConnect (?). The question I have is this:
Is a GameConnection created for each player (including AIPlayer that seems to be derived from GameConnection, seems like a yes to me)? If so why don't the AIPlayers show up in the list of connected clients? Is it because there are multiple GameConnections but only one client?
Basically I'm trying to get my AIPlayers to show up as a player in the player hud list and team stats. Oh and also to be on different teams, if the relationship of GameConnections to clients is not 1:1 (ie one client) then the existing code will have to go.
Thanks...
John.
#2
Thanks for the quick response. I do have head from about two weeks ago. I'll keep an eye out for isAIControlled (could be some of the problem), but the issue seems to be that the AIPlayers are not making it into the ClientGroup (have confirmed this), like you said.
Am I right in thinking that if I have 4 AIPlayers, that I should have 5 GameConnections (including myself), and 5 clients? If so I need to look into why I can't get to them all through ClientGroup (or better where I can).
John.
07/08/2003 (11:13 am)
Hey badguy,Thanks for the quick response. I do have head from about two weeks ago. I'll keep an eye out for isAIControlled (could be some of the problem), but the issue seems to be that the AIPlayers are not making it into the ClientGroup (have confirmed this), like you said.
Am I right in thinking that if I have 4 AIPlayers, that I should have 5 GameConnections (including myself), and 5 clients? If so I need to look into why I can't get to them all through ClientGroup (or better where I can).
John.
#3
if you have the head code
then AIPlayer does not derive from GameConnection
so you dont have a GameConnection for the ai.
you instead have AIPlayer -> Player
what I suggest you do is create a new named group
AIGroup
and add the ai to it (onAdd is a good place)
(might need to write that)
then use that group to get thru your ai.
and you can use the ClientGroup for real players.
if you work them together it should be all good.
07/08/2003 (11:41 am)
Negative,if you have the head code
then AIPlayer does not derive from GameConnection
so you dont have a GameConnection for the ai.
you instead have AIPlayer -> Player
what I suggest you do is create a new named group
AIGroup
and add the ai to it (onAdd is a good place)
(might need to write that)
then use that group to get thru your ai.
and you can use the ClientGroup for real players.
if you work them together it should be all good.
#4
Many thanks...
John.
07/08/2003 (12:25 pm)
Ahhh, that's cool. Actually that may make things a lot easier to deal with.Many thanks...
John.
Torque Owner Badguy
and in your code (which is not the latest)
you have a GameConnection for each ai
possibly the code wont show the bots cause as they anwer to
isAIControlled == true
so check the Player list code to see if it excludes bots using this method.
as well I think AIPlayers are not in the ClientGroup..
tho I could be wrong its been a while.
so it could be that as well.
you should update to head, these bots are a little heavy due to this inheritance..
they do not need to be GameConnection's