2007-04-30 Yeah, ladders and more ..., one problem, need tips |
2007-04-30 Yeah, ladders and more ..., one problem, need tips |
Salvax |
Apr 30 2007, 04:50 PM
Post
#1
|
Advanced Member Group: Members Posts: 75 Joined: 14-February 07 Member No.: 1,034 |
___2007.04.30___
Fixed: BOTs don't always duck while attacking (this game is not counter-strike , LOL ) Added: Ladders can be used (need improvement) Randomly switch weapon while attacking (not only switch weapon while looping on waypoints) Randomly change firing speed Randomly fire @ wall while BOTs feel boring (no enemy in sight) a video about bot on ladder (not always working like this) File Name: Finally, BOTs USE Ladder_Salvax.wmv Size: 536KB Download Link: http://www.sendspace.com/file/tu8m04 latest .dll File Name: rcbot2_test_only_April30.rar Size: 320KB Download Link: http://www.sendspace.com/file/slk50z latest modified codes File Name: modified_rcbot2src_base_April30.rar Size: 107KB Download Link: http://www.sendspace.com/file/6jxv92 _________________________________________________________________________ the problem is how to let bot focus on one action , for example: in bot_waypoint.cpp CODE void CWaypointNavigator :: updatePosition () ... .. . m_pBot->speed(); m_pBot->Ladder(); m_pBot->Randomjump(); m_pBot->campwalk(); so if bot is running on a ladder, the bot also jumps even i set the jump action as a random action , then bot drops from the ladder. so it's with the campwalk action and sprint action, bot executes the 2 actions @ the same time even both are random actions , as i defined in bot.cpp : CODE void CBot :: campwalk () { float fHoldTimeCamp = RandomFloat(0.5,0.8); if ( RandomInt(300,400) > 389 && m_pButtons->canPressButton(IN_SPEED) && m_pButtons->canPressButton(IN_DUCK) && !m_pButtons->holdingButton(IN_SPEED) ) m_pButtons->holdButton(IN_DUCK,0.1/* time to press*/,fHoldTimeCamp/* hold time*/,0/*let go time*/); } void CBot :: speed () { float fHoldTimeSprint = RandomFloat(0.3,0.5); if ( RandomInt(1,10) < 5 && m_pButtons->canPressButton(IN_SPEED) && m_pButtons->canPressButton(IN_DUCK) && !m_pButtons->holdingButton(IN_DUCK) ) m_pButtons->holdButton(IN_SPEED,0/* time to press*/,fHoldTimeSprint/* hold time*/,0/*let go time*/); } it seems ( ! m_pButtons->holdingButton(IN_?????) ) is not working ? Thx Captain, and long to see ur reply ! |
Cheeseh |
Apr 30 2007, 06:06 PM
Post
#2
|
Admin Group: Admin Posts: 3,066 Joined: 11-September 03 From: uk Member No.: 1 |
you are putting things in the wrong place.
leave the WAypoint Navigator/Navigator stuff as it is, it is complete because it is just a class built on an abstract class and if you ad any specific code there they will not work if another sub-class object of the same super class calls the updatePosition function (e.g. CNavMesh::updatePosition()) which isn't implemented yet however, you can see that there will be code redundancy if you have to add this exact code in two different places. QUOTE the problem is how to let bot focus on one action That is the main purpose of CBotTasks and CBotSchedules. You should put the move speed stuff in CBot::doMove() makes sense huh? !! However you do not need to use IN_SPEED buttons you can just specify the movement speed you want the bot to run at e.g. m_fIdealMoveSpeed = 160; // (walk speed) in doMove you will find m_fIdealMoveSpeed, this is the move speed the bot wants to run at. You can either set that in the doMove function (with appropraite if statements) or set m_fIdealMoveSpeed in the appropriate BotTask that is currently being executed |
Salvax |
May 1 2007, 12:39 AM
Post
#3
|
Advanced Member Group: Members Posts: 75 Joined: 14-February 07 Member No.: 1,034 |
BotTask in bot_task.cpp, yeah, i got that . but it seems that the code only works while bot is attacking ,and updatePosition function in bot_waypoint.cpp is another status of BOT action while looping on waypoint. so if i wanna add some actions into the status of BOT looping , where should i put the codes ?
By the way, what value is the ideal speed of sprint ? I see it is already defined as m_fIdealMoveSpeed = 320 in bot.cpp still have no idea where to add sprint code in void CBot :: doMove () in bot.cpp CODE ... .. . m_fForwardSpeed = m_fIdealMoveSpeed * flMove; ... .. . so, do i need to set m_fIdealMoveSpeed as a Random value that it can be switched into run\walk\sprint speed ? |
Cheeseh |
May 3 2007, 05:12 PM
Post
#4
|
Admin Group: Admin Posts: 3,066 Joined: 11-September 03 From: uk Member No.: 1 |
the sprint code you have is probably ok, I didnt know if there was a seperate button for walking and sprinting. (And i still dont know--haven't checked)
the normal run speed is approximately 320 units/sec change ideal move speed in m_fIdealMoveSpeed Find Path Task the find path task is called every thinking frame that the bot is following a waypoint |
Salvax |
May 4 2007, 01:26 AM
Post
#5
|
Advanced Member Group: Members Posts: 75 Joined: 14-February 07 Member No.: 1,034 |
the sprint code you have is probably ok, I didnt know if there was a seperate button for walking and sprinting. (And i still dont know--haven't checked) the normal run speed is approximately 320 units/sec change ideal move speed in m_fIdealMoveSpeed Find Path Task the find path task is called every thinking frame that the bot is following a waypoint yes, the ALT key is used to move slowly. thank you for the tips. salvax, We tested the code today on one of the maps that I have waypointed recently (dm_slammer) and the bots now use the ladders! Great work m8. How did the exams go? Server still crashes when clients leave the game and we get a few random crashes..... but we can put up with that! Terminator_2 examzzzzzzzzzz are ok, thanks. and also thanks for the test of the new code, crashes...annoying |
MarD |
May 8 2007, 03:10 AM
Post
#6
|
RCBot Fan Group: Waypointers Posts: 139 Joined: 30-September 04 From: Canada EH? Member No.: 419 |
Heyyo,
Great stuff man. I've tried setting up the ladders like you have them setup, but they just kinda dangle at the bottom of the ladders, I updated the waypoints that I made before, so they are much better than the original waypoints included in the RCBot release, so if you want to do up some ladders and release it with your bot? give her a go, and then post back here so I can see exactly how you set them up. http://filebase.bots-united.com/index.php?...file&id=395 |
RR99i |
May 29 2007, 05:25 AM
Post
#7
|
Member Group: Members Posts: 25 Joined: 28-July 05 From: Indiana, USA Member No.: 608 |
Hi Salvax! I've noticed, since coming back to bots again. You've done a lot of work with the bots. I read the "Features" thread from Cheeseh, and had to check up what you've done. SendSpace has taken the .dll file down. If you or anyone could re-upload it, or to a different hosting site. That would be great!
I know I've been gone for a long while. But it's good to see Cheeseh and everyone, is still working with the bots. My brother will be really happy, he enjoys HL2: Deathmatch! |
Lo-Fi Version | Time is now: 22nd May 2024 - 10:28 AM |