AIPlayer Client/GameConnection
by Mr Meikel · in Torque Game Engine · 02/19/2006 (11:01 am) · 2 replies
Hi,
I'm fiddling around with aiPlayer.cs, and have introduced characteristics for each bot to have (simulating sight, attentiveness, aggression etc), after a bit of thinking I have decided I would like players to "learn" how each bot plays, as you would with a normal non-AI player. To do this, I need to store my characteristic variables somewhere, as the AIPlayer is deleted when it dies, and the AIPlayer doesn't have a GameConnection.
This also means that a bot doesn't have a "score", and that the GameConnection::onDeath function behaves differently when you are killed by a bot (%sourceClient is 0, as AIPlayer doesn't have a client/GameConnection).
I just wondered if anyone had tackled this problem before, and any information people could share with me :)
I was thinking of just making some form of array in the AIManager scope that stores characteristics, name and score, and use an if statement in the onDeath statement to differentiate between the bots and normal players. Maybe there is a more elegant solution?
I'm fiddling around with aiPlayer.cs, and have introduced characteristics for each bot to have (simulating sight, attentiveness, aggression etc), after a bit of thinking I have decided I would like players to "learn" how each bot plays, as you would with a normal non-AI player. To do this, I need to store my characteristic variables somewhere, as the AIPlayer is deleted when it dies, and the AIPlayer doesn't have a GameConnection.
This also means that a bot doesn't have a "score", and that the GameConnection::onDeath function behaves differently when you are killed by a bot (%sourceClient is 0, as AIPlayer doesn't have a client/GameConnection).
I just wondered if anyone had tackled this problem before, and any information people could share with me :)
I was thinking of just making some form of array in the AIManager scope that stores characteristics, name and score, and use an if statement in the onDeath statement to differentiate between the bots and normal players. Maybe there is a more elegant solution?
Torque Owner Stefan Lundmark