.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Developer's Farm > General Bot Coding
General Bot Coding See what a pain it is to get those little mechs shooting around

Reply
 
Thread Tools
Why bots need this?
Old
  (#1)
KWo
Developer of PODBot mm
 
KWo's Avatar
 
Status: Offline
Posts: 3,425
Join Date: Apr 2004
Default Why bots need this? - 28-03-2005

Since I'm not a bot coder and I know almost nothing about C++ and HL SDK, I can't answer to T(+)rget what can be a reason to using some special management in code for bots.
A lot of times I saw some bots or players as ghosts on the server (also noticed by other people at this and other forums) when there is AMX or AMX MOD X. I've asked him why it's not working correctly (not resetted at player's respawn) some function set_user_rendering. T(+)rget told me it is resetted in FUN module and he was surprised a bit if it doesn't work correctly for bots. But he asked me about something I can't answer. Maybe someone of You guys can give more light to explain the problem.

Quote:
Originally Posted by T(+)rget
Code:
// Don't ask, bots need this for reinitialising :/
void ClientUserInfoChanged_Post(edict_t *pEntity, char *infobuffer) {
	CPlayer *pPlayer = GET_PLAYER_POINTER(pEntity);
	if(pPlayer->IsBot()) {
  pPlayer->bot = true;
  pPlayer->PutInServer();
	}

	RETURN_META(MRES_IGNORED);
}
I had problems with VexdUM when I killed bots with my damage natives, if I didn't code the above then the round wouldn't end because the server didn't notice the bot die.

I don't understand the full reason behind this, might be better to ask 1 of the bot authors they should be able to elabrate upon it some more.

It sounds like a similar problem/bug which you've noticed.

If you have AMX 0.9.9b installed I can send you a test Fun version to try.

-Targ
  
Reply With Quote
Re: Why bots need this?
Old
  (#2)
Cheeseh
[rcbot]
 
Cheeseh's Avatar
 
Status: Offline
Posts: 361
Join Date: Dec 2003
Location: China
Default Re: Why bots need this? - 28-03-2005

I never had to use that code before for my own bot, and I haven't seen it used in other bots...

What MOD is it for?
What Bot is using it?

I'm guessing that the bot doesn't fully support the mod or simply hasn't got the correct code for them to join the server properly. The code above just makes the bot join the game, where the bot should have done that code itself in it's creation function.
  
Reply With Quote
Re: Why bots need this?
Old
  (#3)
KWo
Developer of PODBot mm
 
KWo's Avatar
 
Status: Offline
Posts: 3,425
Join Date: Apr 2004
Default Re: Why bots need this? - 28-03-2005

The mod it's AMX and the bot it's AMXBOT (T(+)rget's one) and it should work for CS. More info here:
http://forums.bots-united.com/showthread.php?t=3102
  
Reply With Quote
Re: Why bots need this?
Old
  (#4)
T(+)rget
AMX Dev Team
 
T(+)rget's Avatar
 
Status: Offline
Posts: 28
Join Date: Dec 2004
Location: UK
Default Re: Why bots need this? - 28-03-2005

Well like I mentioned to KWo the bot needed reinitialising:
Code:
static cell AMX_NATIVE_CALL create_bot(AMX *amx, cell *params) {
    int iLen;
    char* botname = GET_AMXSTRING(amx, params[1], 0, iLen);
    edict_t* pEdict = CREATE_FAKE_CLIENT(botname);

    if(!pEdict) {
        AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
        return 0;
    }

    pEdict->v.flags |= FL_FAKECLIENT;
    CPlayer *pPlayer = GET_PLAYER_POINTER(pEdict);
    pPlayer->id = ENTINDEX(pEdict);
    pPlayer->pEdict = pEdict;
    CALL_GAME_ENTITY(PLID, "player", VARS(pPlayer->pEdict));
    char *sInfoBuffer = GET_INFOKEYBUFFER(pPlayer->pEdict);
    SET_CLIENT_KEYVALUE(pPlayer->id, sInfoBuffer, "rate", "3500");
    SET_CLIENT_KEYVALUE(pPlayer->id, sInfoBuffer, "cl_updaterate", "20");
    SET_CLIENT_KEYVALUE(pPlayer->id, sInfoBuffer, "cl_lw", "1");
    SET_CLIENT_KEYVALUE(pPlayer->id, sInfoBuffer, "cl_lc", "1");
    SET_CLIENT_KEYVALUE(pPlayer->id, sInfoBuffer, "cl_dlmax", "128");
    SET_CLIENT_KEYVALUE(pPlayer->id, sInfoBuffer, "_vgui_menus", "0");
    SET_CLIENT_KEYVALUE(pPlayer->id, sInfoBuffer, "_ah", "0");
    SET_CLIENT_KEYVALUE(pPlayer->id, sInfoBuffer, "dm", "0");
    SET_CLIENT_KEYVALUE(pPlayer->id, sInfoBuffer, "tracker", "0");
    SET_CLIENT_KEYVALUE(pPlayer->id, sInfoBuffer, "friends", "0");
    char szRejectReason[128];
    MDLL_ClientConnect(pPlayer->pEdict, botname, "127.0.0.1", szRejectReason);
    MDLL_ClientPutInServer(pPlayer->pEdict);
    RUNPLAYERMOVE(pPlayer->pEdict, pPlayer->pEdict->v.v_angle, 0.0, 0.0, 0, 0, 0, 76);

    return 1;
}
Don't think there is any problems with the above? Only occurs whilst using the damage natives I created ie outside influence.

-Targ

Last edited by T(+)rget; 28-03-2005 at 23:33..
  
Reply With Quote
Re: Why bots need this?
Old
  (#5)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Why bots need this? - 29-03-2005

This may be caused because you lack client-side code for your bot. Your bot needs to know how to handle the VGUI network message the server sends it (like for example for choosing team and class). CS has a bug where it is possible to force a player to "play" even though the team and class have not been selected correctly, however as soon as this player dies, problems arise which resemble the one you mentioned (if I remember well).



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com