IPB

Welcome Guest ( Log In | Register )

> Added some codes of AUX Power for BOT (Not perfect), latest DLL & Modified Source uploaded, need ur test!
Salvax
post Feb 22 2007, 10:41 AM
Post #1


Advanced Member
***

Group: Members
Posts: 75
Joined: 14-February 07
Member No.: 1,034



___feb 25th 2007___
added: bot can randomly switch weapon (weapon picked up, pistol, grenade and SMG. and Be SURE in bot profile, weapon = default ).

improved: bot can sprint randomly (not ONLY attacking or under attack).

_____OLD LOG ______
added: bot can sprint.
added: bot can have secondary attack mode (SMG Grenade, AR2 Ball, Shotgun, S.L.A.M, Grenade).

You can download the latest modified source code and test only [HPB_bot2.dll] here:

rcbot2_test_only_feb25.rar (test map included, load test map:salvax, and tpye exec rcbot2 in console.)
http://www.sendspace.com/file/tyxlae

modified_rcbot2src_base_feb25.rar
http://www.sendspace.com/file/vodflz

You can also search "salvax" to check the modified source code. Thank You Again, Captain Cheeseh !!!


********************************************************************************
********
PLZ test it, Captain ! (U can downlaod below ,ALL latest modified source and DLL uploaded)

After the secondary attack code, i added some new codes of AUX Power for bot,(of cause my new code is based on bot button again, this time i think it 's not as good as i thought, because bot only use AUX power to rush when he wants to kill an enemy or he is under attack. I think let bot rushing is a random thing, so i need time to try if i can change the bot button thing to random bot action.

Now i bring u a small problem:

i think these code below make bot stand and jump on one point to shoot his enemy, would u plz adjust the time value so the bot can be standing there for a short time. then bot can take more time to use AUX power to rush and flank. (i tried a whole day to adjust the time value, but in vain)

bot.cpp

QUOTE
void CBot :: jump ()
{
if ( m_pButtons->canPressButton(IN_JUMP) )
{
m_pButtons->holdButton(IN_JUMP,0/* time to press*/,0.5/* hold time*/,0.5/*let go time*/);
// do the trademark jump & duck
m_pButtons->holdButton(IN_DUCK,0.2/* time to press*/,0.3/* hold time*/,0.5/*let go time*/);
}
}

void CBot :: duck ( bool hold )
{
if ( hold || m_pButtons->canPressButton(IN_DUCK) )
m_pButtons->holdButton(IN_DUCK,0.0/* time to press*/,1.0/* hold time*/,0.5/*let go time*/);
}


____________________________________________
Great many thx to Captain Cheeseh!!!

rcbot2_for_test_only_feb22.rar (*You can test secondary attack mode and AUX Power in the test MAP:salvax*)
http://www.sendspace.com/file/ufsh77

rcbot2_modified_source.rar (*You can search string "salvax" to see the added codes.*)
http://www.sendspace.com/file/a5uhn0
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
 
Reply to this topicStart new topic
Replies
Salvax
post Feb 24 2007, 03:55 AM
Post #2


Advanced Member
***

Group: Members
Posts: 75
Joined: 14-February 07
Member No.: 1,034



donot know if it right, plz check, thx. and by the way, which is better , FindPath task or in the WaypointNavigator::updateposition ?

**************************************
bot_waypoint.cpp
____________________________________________

QUOTE
void CWaypointNavigator :: updatePosition ()
{
static Vector vWptOrigin;

if ( m_iCurrentWaypoint == -1 ) // invalid
{
m_pBot->stopMoving();
return;
}

CWaypoint *pWaypoint = CWaypoints::getWaypoint(m_iCurrentWaypoint);

if ( pWaypoint == NULL )
return;

vWptOrigin = pWaypoint->getOrigin();

if ( pWaypoint->touched(m_pBot->getOrigin()) )
{
pWaypoint->botTouch(m_pBot);

if ( m_currentRoute.IsEmpty() ) // reached goal!!
{
m_iCurrentWaypoint = -1;

if ( m_pBot->getSchedule()->hasSchedule(SCHED_RUN_FOR_COVER) )
m_pBot->reachedCoverSpot();
}
else
{
m_iCurrentWaypoint = m_currentRoute.Pop();

if ( m_iCurrentWaypoint != -1 )
{
vWptOrigin = CWaypoints::getWaypoint(m_iCurrentWaypoint)->getOrigin();
}
}
}

if ( pWaypoint->hasFlag(CWaypointTypes::W_FL_CROUCH) )
{
m_pBot->duck(true);
}

if ( (m_pLastEnemy != NULL) && (currentWaypoint() == -1) ) // Sprint for BOT by Salvax
{
m_pButtons->speed();
}


m_pBot->setMoveTo(vWptOrigin);
}


**************************************************
bot_task.cpp
__________________________________________________
QUOTE
void CFindPathTask :: init ()
{
m_bNoInterruptions = false;
m_bGetPassedVector = false;
m_iInt = 0;

//setFailInterrupt(CONDITION_SEE_CUR_ENEMY);
}

void CFindPathTask :: execute ( CBot *pBot, CBotSchedule *pSchedule )
{
bool bFail = false;

if ( pSchedule->hasPassVector() )
{
m_vVector = pSchedule->passedVector();
pSchedule->clearPass();
}

if ( (m_iInt == 0) || (m_iInt == 1) )
{
if ( pBot->getNavigator()->workRoute(pBot->getOrigin(),m_vVector,&bFail,(m_iInt==0),m_bNoInterruptions) )
m_iInt = 2;
else
m_iInt = 1;
}

if ( bFail )
fail();
else if ( m_iInt == 2 )
{
if ( m_bNoInterruptions )
m_pButtons->speed(); // Sprint for BOT by Salvax
complete(); // ~fin~

if ( !pBot->getNavigator()->hasNextPoint() )
m_pButtons->speed(); // Sprint for BOT by Salvax
complete(); // reached goal
else
{
if ( pBot->moveFailed() )
fail();

// running path
pBot->setLookAtTask(LOOK_WAYPOINT);
}
}
}


PS:I think it is far more to go sad.gif
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Cheeseh
post Feb 24 2007, 01:37 PM
Post #3


Admin
*****

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



inside the waypoint navigator is probably better,

and you would be better changing the CFindPathTask code back, you've messed it up tongue.gif Because you didn't encapsulate the if statements with two or more lines in curly brackets.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Posts in this topic
Salvax   Added some codes of AUX Power for BOT (Not perfect)   Feb 22 2007, 10:41 AM
Cheeseh   The bot only moves if it has a valid path, To obta...   Feb 22 2007, 01:23 PM
Salvax   if i delet the codes above, what would happen ? BO...   Feb 22 2007, 03:39 PM
Cheeseh   If you remove jump and duck codes, this will do no...   Feb 22 2007, 04:08 PM
Salvax   THX, hmmm if i don't like the bot to stop, can...   Feb 23 2007, 10:10 AM
Cheeseh   no doing that removes the essence of game programm...   Feb 23 2007, 12:33 PM
Salvax   yep, i did add the AUX power Sprint key for bot, b...   Feb 23 2007, 01:40 PM
Cheeseh   yep, i did add the AUX power Sprint key for bot, ...   Feb 23 2007, 10:03 PM
Salvax   donot know if it right, plz check, thx. and by the...   Feb 24 2007, 03:55 AM
Cheeseh   inside the waypoint navigator is probably better, ...   Feb 24 2007, 01:37 PM
Salvax   ok, we choose navigator waypoint, but i got some e...   Feb 24 2007, 02:07 PM
Cheeseh   ok, we choose navigator waypoint, but i got some ...   Feb 24 2007, 02:15 PM
Salvax   shouldn't it be m_pBot->speed() , not butt...   Feb 24 2007, 02:52 PM
Cheeseh   it doesn't matter, it that function is being c...   Feb 24 2007, 08:30 PM
SuperHebbe   ___feb 25th 2007___ Hi.. I'm running your ver...   Feb 25 2007, 07:21 PM
Salvax   just thank Captain Cheeseh, i did nothing :)   Feb 27 2007, 04:55 AM
SuperHebbe   Well... Running this version might be the cause of...   Mar 2 2007, 11:51 PM
Loki   No thoughts yet Salvax?? - apart from the "fr...   Mar 9 2007, 03:48 AM
Salvax   thx for ur feedback, for the crashing problem ,i r...   Mar 31 2007, 12:13 PM
SuperHebbe   thx for ur feedback, for the crashing problem ,i ...   Mar 31 2007, 05:29 PM


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

 



- Lo-Fi Version Time is now: 21st August 2025 - 09:17 PM