Accessed None

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Darknigh+

New Member
Oct 19, 2003
113
0
0
www.cis.usouthal.edu
Yea I did. I couldn't really find anything relevent, but then again I am very tired. I will try again tommorrow and keep you posted. Man this Bots stuff is a real pain in the ___. Someone should write a Wiki page on it. If I figure it out I will for sure as I think this is one of the things that realy should have alot of documataion on, but yet I have found so little.
 

Sir_Brizz

Administrator
Staff member
Feb 3, 2000
26,021
86
48
and to be honest, if you don't have a basic knowledge of AI theory you'll be crapping bricks by the time you're done figuring it out.
 

NickR

New Member
Dec 27, 2002
65
0
0
UK
wiki.beyondunreal.com
Just trying to figure out where the bot code begins and ends is an adventure in itself! It took atleast a month to work out how to successfully remove EPICs original bot code and put my own in without the game crashing all around me. It doesn't help when most of the function names mean nothing about what they actually do. :rolleyes:
 

Darknigh+

New Member
Oct 19, 2003
113
0
0
www.cis.usouthal.edu
AI theory

It is not the AI Theory that I am worried about. I know about FSM, Genetic algorithms, Neural Nets....etc.I have that. It is more getting a hold of the bot so the game won't crash.

NickR - would you mind giving some pointers as to what all you had to do to get it to spawn correctly. (would you mind me looking at your code?)

Mychaeel - yea thats great theory material but there are little if non codeing examples. I am the type person that learns by looking a code and having it tell you what it is doing.

[SAS]Solid Snake - UScript programmer I will admit I am but I have found the language(syntax) not to be to terrible difficult. The sytax and stuff is similar to other languages I know. It is more find/figureing out what the functions do.

My thing is I don't see why someone hasn't written a how-to on wiki pages about how to spawn a bot(with code examples) as I see lots of people having problems with it.
 
Last edited:

[SAS]Solid Snake

New Member
Jun 7, 2002
2,633
0
0
41
New Zealand
www.digitalconfectioners.com
It is more find/figureing out what the functions do.
Nothing a little logging won't help out with. Also finding/figuring out what functions do is just an interpretation of the syntax or code.

My thing is I don't see why someone hasn't written a how-to on wiki pages about how to spawn a bot(with code examples) as I see lots of people having problems with it.
Well then, when you figure this all out you can feel free to write up a page.
 

Darknigh+

New Member
Oct 19, 2003
113
0
0
www.cis.usouthal.edu
I have comfirmed that it isn't my AI controlling the bot but xBot. When I us the log it says it is mine but when I type in showdebug on the console it says that xbot is the controller. I think this may have to do with how deathmatch spawns a bot. I have tried extending bot instead of just controller in my AI controller class, but I get access errors at HearNoise, SeePlayer. I don't understand why though because shouldn't if I don't define the function it looks to the parent class for the function definition? Why would this be happening? Because if I extend Bot and the function use a bot class instead of my AI then there shouldn't be a problem. Doen't make sense?
 

smattbac

Flak Monkey
Nov 28, 2000
185
0
0
Finland
www.multi.fi
Here's how I spawn my bot with custom controller and pawn:
Code:
function Bot SpawnBot(optional string botName)
{
local Bot NewBot;
local RosterEntry Chosen;
local UnrealTeamInfo BotTeam;

    BotTeam = GetBotTeam();
    Chosen = BotTeam.ChooseBotClass(botName);

    [b]Chosen.PawnClassName = "MyPackage.MyPawn";
    Chosen.PawnClass = class'MyPackage.MyPawn';
    
    [i]/*  if (Chosen.PawnClass == None)
            Chosen.Init(); //amb
        // log("Chose pawn class "$Chosen.PawnClass);
    */[/i][/b]
    
    NewBot = Bot(Spawn(Chosen.PawnClass.default.ControllerClass));
    
    if ( NewBot != None )
        InitializeBot(NewBot,BotTeam,Chosen);
    return NewBot;
}
I just copied the function and added the two first bold lines, commented out the next three lines (since PawnClass is already chosen), and in my pawn class I set the ControllerClass in the defaultproperties.

If this wasn't your problem, sorry. :)
 

NickR

New Member
Dec 27, 2002
65
0
0
UK
wiki.beyondunreal.com
Code:
class YourGame extends TeamGame; 

function Bot SpawnBot(optional string botName)
{
	local Bot NewBot;
	local RosterEntry Chosen;
	local UnrealTeamInfo BotTeam;

	BotTeam = GetBotTeam();
	Chosen = BotTeam.ChooseBotClass(botName);

	if (Chosen.PawnClass == None)
		Chosen.Init();

	NewBot = Spawn(class'YourPackage.YourAIController');

	if (NewBot != None)
		InitializeBot(NewBot, BotTeam, Chosen);

	return NewBot;
}

defaultproperties
{
	PlayerControllerClassName="YourPackage.YourPlayerController"
	DefaultPlayerClassName="YourPackage.YourPawn"
}
////////////////////////////

class YourAIController extends Controller;

function SetPawnClass(string inClass, string inCharacter)
{
	Super.SetPawnClass("YourPackage.YourPawn", inCharacter);
}

defaultproperties
{
	PawnClass=class'YourPackage.YourPawn'
}

////////////////////////////

class YourPlayerController extends Controller;

function SetPawnClass(string inClass, string inCharacter)
{
	Super.SetPawnClass("YourPackage.YourPawn", inCharacter);
}

defaultproperties
{
	PawnClass=class'YourPackage.YourPawn'
}

That's the jist of it, and it works for me! :D
 

Darknigh+

New Member
Oct 19, 2003
113
0
0
www.cis.usouthal.edu
Thanks NickR. That is good way to. Never thought of that. I think I am going to take your method and the one posted by smattbac and write a tutorial for this on unreal Wiki. As I know alot of people ask questions about how to spawn bots with customize AI controllers.

Also you wrote the AIController class twice I assume that was a typo and one should be the pawn class.

By the way downloaded your mod. It's cool. Just an Idea you should add networking capabilites because that would make for a great lan party game..:)

Thanks again.
 

NickR

New Member
Dec 27, 2002
65
0
0
UK
wiki.beyondunreal.com
I didn't make a typo. The second class is the custom PlayerController. I just put that in to show you that it's set up the same as the custom AIController.

A new version of QTDM is basically ready for release, which fixes all of the known problems of the last release. There's just one thing left to finish before I do though.