IPB

Welcome Guest ( Log In | Register )

> Team Fortress 2
Venom
post Oct 12 2007, 11:51 AM
Post #1


Advanced Member
***

Group: Members
Posts: 82
Joined: 24-July 06
Member No.: 807



Hello,
Well i have been playing TF2 basicly since beta, having been release and after playing it for 3 or 4 weeks solid now, I would like to start to turn towards bot development. After previously working with the older HL version of RCbot on Natural Selection and modifing that bot to support different game types, I will be moving my efforts towards bot development with TF2.

Like all source games and mods, they all come with basic source bots any way. The only way to activate this in games like TF2, is to make sure that -console command is on before you launch the game, and simply type "sv_cheats 1" and then "bot_add". Due to the lack of development and customisation of these standard bots, the bots will not do anything even though they can be added to the game. So I will now be looking at RCBot2 to see if i can get bots into TF2.

I will keep you posted on my efforts, i am currently downloading the Windows version of the TF2 dedicated server, having a glimps at the RCbot2 forum, people seem to be having problems with dedicated server so i hope I am able to setup and install RCbots correctly.

Wish me luck

Venom
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
 
Reply to this topicStart new topic
Replies
Venom
post Oct 12 2007, 03:00 PM
Post #2


Advanced Member
***

Group: Members
Posts: 82
Joined: 24-July 06
Member No.: 807



do you have any of the source code which has been converted already? it will give me a head start.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Cheeseh
post Oct 12 2007, 09:47 PM
Post #3


Admin
*****

Group: Admin
Posts: 3,066
Joined: 11-September 03
From: uk
Member No.: 1



QUOTE(Venom @ Oct 12 2007, 04:00 PM) *

do you have any of the source code which has been converted already? it will give me a head start.


I only started with the bot modifications and base classes

I guess i can post them here, my ftp is no longer working i would have to upload it to the filebase or I can post my changes:

new: bot_fortress.h

CODE

#ifndef __BOT_FORTRESS_H__
#define __BOT_FORTRESS_H__

typedef enum
{
    TF_CLASS_SCOUT = 1,
    TF_CLASS_SNIPER = 2,
    TF_CLASS_SOLDIER = 3,
    TF_CLASS_DEMOMAN = 4,
    TF_CLASS_MEDIC = 5,
    TF_CLASS_HWGUY = 6,
    TF_CLASS_PYRO = 7,
    TF_CLASS_SPY = 8,
    TF_CLASS_ENGINEER = 9,
    TF_CLASS_CIVILIAN = 0,
}TF_Class;

enum
{
    TF_TEAM_SPEC = 0,
    TF_TEAM_BLUE = 1,
    TF_TEAM_RED = 2,
    TF_TEAM_GREEN = 3,
    TF_TEAM_YELLOW = 4
};

class CBotFortress : public CBot
{
public:
    virtual void init (bool bVarInit=false);
    // setup buttons and data structures
    virtual void setup ();

    virtual void died ( edict_t *pKiller );

    virtual void killed ( edict_t *pVictim );

    virtual int getTeam () = 0;

    virtual void modThink () = 0;

    void setLookAtTask ( eLookTask lookTask );

    virtual bool isEnemy ( edict_t *pEdict );

    virtual void getLookAtVector ();

    virtual void startGame ();

    virtual void spawnInit ();

    virtual void checkStuck ();

    virtual bool startedGame ();

    bool isTF () { return true; }

    virtual TF_Class getClass () = 0;

protected:
    virtual void selectTeam ();
    virtual void selectClass ();
};

class CBotTF2 : public CBotFortress
{
public:
    void init (bool bVarInit=false);
    // setup buttons and data structures
    void setup ();

    void spawnInit ();

    void died ( edict_t *pKiller );

    void killed ( edict_t *pVictim );

    int getTeam ();

    void modThink ();

    void setLookAtTask ( eLookTask lookTask );

    bool isEnemy ( edict_t *pEdict );

    void getLookAtVector ();

    void startGame ();

    void checkStuck ();

    bool startedGame ();

    bool isTF () { return true; }

    TF_Class getClass ();
protected:
    void selectTeam ();
    void selectClass ();
};

class CBotFF : public CBotFortress
{
public:
    void init (bool bVarInit=false);
    // setup buttons and data structures
    void setup ();

    void spawnInit ();

    void died ( edict_t *pKiller );

    void killed ( edict_t *pVictim );

    int getTeam ();

    void modThink ();

    void setLookAtTask ( eLookTask lookTask );

    bool isEnemy ( edict_t *pEdict );

    void getLookAtVector ();

    void startGame ();

    void checkStuck ();

    bool startedGame ();

    bool isTF () { return true; }

    TF_Class getClass ();
protected:
    void selectTeam ();
    void selectClass ();
};

#endif


new : bot_fortress.cpp

CODE

/*
*    This file is part of RCBot.
*
*    RCBot by Paul Murphy adapted from Botman's HPB Bot 2 template.
*
*    RCBot is free software; you can redistribute it and/or modify it
*    under the terms of the GNU General Public License as published by the
*    Free Software Foundation; either version 2 of the License, or (at
*    your option) any later version.
*
*    RCBot is distributed in the hope that it will be useful, but
*    WITHOUT ANY WARRANTY; without even the implied warranty of
*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
*    General Public License for more details.
*
*    You should have received a copy of the GNU General Public License
*    along with RCBot; if not, write to the Free Software Foundation,
*    Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*
*    In addition, as a special exception, the author gives permission to
*    link the code of this program with the Half-Life Game Engine ("HL
*    Engine") and Modified Game Libraries ("MODs") developed by Valve,
*    L.L.C ("Valve").  You must obey the GNU General Public License in all
*    respects for all of the code used other than the HL Engine and MODs
*    from Valve.  If you modify this file, you may extend this exception
*    to your version of the file, but you are not obligated to do so.  If
*    you do not wish to do so, delete this exception statement from your
*    version.
*
*/
#include "bot.h"
#include "bot_fortress.h"
#include "bot_buttons.h"
#include "bot_globals.h"
#include "bot_profile.h"

#include "vstdlib/random.h" // for random functions


void CBotFortress :: init (bool bVarInit)
{
    CBot::init(bVarInit);
}

void CBotFortress :: setup ()
{
    CBot::setup();
}

bool CBotFortress :: startedGame ()
{
    return true;
}

void CBotFortress :: startGame()
{
    selectTeam();

    selectClass();
}

void CBotFortress :: killed ( edict_t *pVictim )
{
return;
}

void CBotFortress :: died ( edict_t *pKiller )
{
    spawnInit();

    if ( RandomInt(0,1) )
        m_pButtons->attack();
}

void CBotFortress :: spawnInit ()
{
    CBot::spawnInit();
}

bool CBotFortress :: isEnemy ( edict_t *pEdict )
{
    if ( pEdict == m_pEdict )
        return false;

    if ( !ENTINDEX(pEdict) || (ENTINDEX(pEdict) > CBotGlobals::maxClients()) )
        return false;

    if ( CBotGlobals::getTeamplayOn() )
    {
        if ( CBotGlobals::getTeam(pEdict) == getTeam() )
            return false;
    }

    return true;    
}


void CBotFortress :: modThink ()
{
    // dont use physcannon for now... switch to pistol
    if ( m_pPlayerInfo->GetWeaponName() && *(m_pPlayerInfo->GetWeaponName()) )
    {
        if ( !strcmp("weapon_physcannon",m_pPlayerInfo->GetWeaponName()) )
        {            
            m_pController->SetActiveWeapon("weapon_pistol");            
        }
        else if ( !FStrEq(m_pProfile->getWeapon(),"default") && !FStrEq(m_pProfile->getWeapon(),m_pPlayerInfo->GetWeaponName()))
        {
            m_pController->SetActiveWeapon(m_pProfile->getWeapon());
        }
    }
}

void CBotTF2 :: selectTeam ()
{
    
}

void CBotTF2 :: selectClass ()
{
}


void CBotFF :: selectTeam ()
{

}

void CBotFF :: selectClass ()
{
    
}

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

void CBotTF2 :: modThink ()
{
// mod specific think code here
}

void CBotTF2 :: init (bool bVarInit)
{
    CBot::init(bVarInit);
}

void CBotTF2 :: setup ()
{
    CBot::setup();
}

bool CBotTF2 :: startedGame ()
{
    return true;
}

void CBotTF2 :: startGame ()
{
    return;
}

void CBotTF2 :: killed (edict_t *pKiller)
{

}

void CBotTF2 :: died (edict_t *pKiller)
{
    spawnInit();

    // wait for respawn
}

void CBotTF2 :: spawnInit ()
{
    CBot::spawnInit();
}

bool CBotTF2 :: isEnemy ( edict_t *pEdict )
{
    if ( pEdict == m_pEdict )
        return false;

    if ( !ENTINDEX(pEdict) || (ENTINDEX(pEdict) > CBotGlobals::maxClients()) )
        return false;

    if ( CBotGlobals::getTeam(pEdict) == getTeam() )
        return false;

    return true;    
}


patch : bot_mods.cpp

CODE

void CBotMods :: readMods()
{
    m_Mods.push_back(new CCounterStrikeSourceMod());
    m_Mods.push_back(new CHalfLifeDeathmatchMod());

    m_Mods.push_back(new CCounterStrikeSourceModDedicated());
    m_Mods.push_back(new CHalfLifeDeathmatchModDedicated());

    m_Mods.push_back(new CFortressForeverMod());
    m_Mods.push_back(new CFortressForeverModDedicated());

    m_Mods.push_back(new CTeamFortress2Mod());
    m_Mods.push_back(new CTeamFortress2ModDedicated());
}


patch : bot_mods.h

CODE

class CFortressForeverMod : public CBotMod
{
public:
    CFortressForeverMod()
    {
        setup("FortressForever","SourceMods",MOD_FF);
    }
private:

};

class CFortressForeverModDedicated : public CBotMod
{
public:
    CFortressForeverModDedicated()
    {
        setup("FortressForever","source dedicated server",MOD_FF);
    }
private:

};

class CTeamFortress2Mod : public CBotMod
{
public:
    CTeamFortress2Mod()
    {
        setup("tf","team fortress 2",MOD_TF2);
    }
private:

};

class CTeamFortress2ModDedicated : public CBotMod
{
public:
    CTeamFortress2ModDedicated()
    {
        setup("tf","source dedicated server",MOD_TF2);
    }
private:

};


patch bot_const.h

CODE


typedef enum
{
    MOD_UNSUPPORTED = 0,
    MOD_HLDM2,
    MOD_CSS,
    MOD_FF,
    MOD_TF2,
    MOD_ANY,
    MOD_MAX
}eModId;
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Posts in this topic
Venom   Team Fortress 2   Oct 12 2007, 11:51 AM
Cheeseh   Ok, bear in mind i'm doing it on and off mysel...   Oct 12 2007, 02:38 PM
Venom   do you have any of the source code which has been ...   Oct 12 2007, 03:00 PM
Cheeseh   do you have any of the source code which has been...   Oct 12 2007, 09:47 PM
Venom   If you would like, i can still provide you with FT...   Oct 13 2007, 08:02 AM
Cheeseh   I also forgot one thing though, patch in bot.cpp ...   Oct 13 2007, 11:01 AM
Venom   The reason you see some TF2 servers with 32 player...   Oct 13 2007, 05:29 PM
Cheeseh   thanks for the ftp I've uploaded my latest ve...   Oct 13 2007, 07:59 PM
Venom   thanks for the ftp I've uploaded my latest v...   Oct 13 2007, 09:06 PM
Cheeseh   I have work tomorrow morning, but tomorrow aftern...   Oct 13 2007, 10:55 PM
Venom   Yeh, i thought that it should not go in with eithe...   Oct 14 2007, 12:29 PM
Cheeseh   might need to change the TF2 mod class so it looks...   Oct 14 2007, 01:01 PM
Venom   First inital impression is that in order to code, ...   Oct 14 2007, 04:36 PM
Cheeseh   The usual SDK install is to use steam tools and ex...   Oct 14 2007, 06:25 PM
Venom   Error 3 error LNK2001: unresolved external sy...   Oct 15 2007, 03:25 PM
Cheeseh   as I mentioned there are no bodies for the fortres...   Oct 15 2007, 05:01 PM
Venom   Just playing around with the bots which came with ...   Oct 16 2007, 07:36 AM
Venom   I have sent you Cheeseh additional source code to ...   Oct 17 2007, 01:17 PM
Cheeseh   Most of these files are interesting , but I've...   Oct 17 2007, 05:02 PM
Venom   Ok, i understand :) so we can continue to develop ...   Oct 17 2007, 05:56 PM
Venom   Hello, Just wanted to give an update, i have comme...   Oct 25 2007, 10:58 AM
LordSkitch   if i ran a tf2 server id help out with the code......   Oct 25 2007, 06:04 PM
Venom   If you like i can provide you with access to my TF...   Oct 27 2007, 01:09 PM
LordSkitch   oh ive already got the orange box and beat ep2 and...   Oct 28 2007, 07:20 PM
Venom   would you like to use my server? or would you rath...   Oct 29 2007, 11:58 AM
LordSkitch   lol if you want like a 95% downtime   Oct 30 2007, 02:16 AM
Venom   its not a successful server atm any way :P   Oct 30 2007, 03:55 PM
Cheeseh   before devleoping on TF2 the SDK files need to be ...   Oct 31 2007, 06:53 PM
Vazh3r   Just wondering on what is the status with RCbot2 f...   Nov 8 2007, 05:56 PM
Cheeseh   Just wondering on what is the status with RCbot2 ...   Nov 10 2007, 01:07 PM
Vazh3r   So what does that mean and is TF2 bots possible?   Nov 10 2007, 02:14 PM
Medieval Warrior   So what does that mean and is TF2 bots possible? ...   Nov 11 2007, 03:52 AM
Cheeseh   the latest source SDK does not support orange box ...   Nov 11 2007, 02:28 PM
Cheeseh   basically the source SDK Tools for TF2 and so on m...   Nov 12 2007, 04:09 PM
Venom   yeh i noticed that Cheeseh, i am still waiting for...   Nov 12 2007, 05:10 PM
Venom   Orange Box SDK has been released.   Nov 14 2007, 05:10 PM
Cheeseh   Orange Box SDK has been released. steam still wo...   Nov 14 2007, 08:27 PM
LordSkitch   its true! while i was in class it kept popping...   Nov 15 2007, 07:12 AM
Medieval Warrior   *bump* So, uh...is anything new happening with th...   Dec 12 2007, 09:16 PM
LordSkitch   not unless they release a new SDK... well i mean ...   Dec 14 2007, 08:12 PM
Vazh3r   That really sucks. I wish they release it soon. An...   Dec 16 2007, 12:09 PM
LordSkitch   probably because theres money to be made elsewhere...   Dec 17 2007, 04:06 PM
Venom   Just wanted to let you all know that the beta SDK ...   Mar 4 2008, 04:32 PM
KrX   Just wanted to let you all know that the beta SDK...   Mar 8 2008, 07:45 AM
Venom   I am looking at the code, but i expect Cheeseh wil...   Mar 21 2008, 09:24 AM
Cheeseh   I am looking at the code, but i expect Cheeseh wi...   Mar 21 2008, 07:28 PM
Venom   I know how you feel cheeseh, i just started a new ...   Mar 21 2008, 11:27 PM
Cheeseh   Well I've compiled a version of rcbot2 which c...   Mar 24 2008, 07:28 PM
Venom   If you like, i could give it a try. I think you go...   Mar 25 2008, 07:38 AM
Cheeseh   If you like, i could give it a try. I think you g...   Mar 25 2008, 11:55 AM
Venom   Going to download the RCBOT now and will have a bi...   Mar 26 2008, 07:31 AM
Cheeseh   The nav mesh stuff, I think requires a bit of a ha...   Mar 26 2008, 11:24 AM
Venom   Intresting reading, thanks for the link, CountFloy...   Mar 26 2008, 12:50 PM
Venom   I think i found what the problem may be when you a...   Mar 26 2008, 07:27 PM
Venom   Something very strange happened today, i decided t...   May 6 2008, 07:34 PM
Cheeseh   Something very strange happened today, i decided ...   May 7 2008, 09:11 AM
Venom   As i mentioned before, i was a medic, there was se...   May 7 2008, 05:42 PM
Cheeseh   As i mentioned before, i was a medic, there was s...   May 7 2008, 07:08 PM
Venom   sorry, i didnt make it clear :( it was the source ...   May 8 2008, 04:53 PM
Cheeseh   sorry, i didnt make it clear :( it was the source...   Jul 6 2008, 01:47 PM
Venom   OK, so if we do not need to worry about adding bot...   Jul 24 2008, 05:06 PM
Cheeseh   its still a problem though hopefully will be solve...   Jul 24 2008, 08:53 PM
Venom   Thanks for the link Cheeseh. Strange how Omni-bot...   Jul 27 2008, 12:13 PM
Cheeseh   its because somehow he knows soemone working with ...   Jul 27 2008, 06:08 PM
Venom   Yeh, that is rather annoying. I take it Omni-bot p...   Aug 6 2008, 06:17 AM
Cheeseh   Yeh, that is rather annoying. I take it Omni-bot ...   Aug 9 2008, 10:35 PM


Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 19th July 2025 - 12:27 AM