.:: 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
Well , just a small question
Old
  (#1)
Rifleman
This user broke our rules and has been BANNED
 
Status: Offline
Posts: 128
Join Date: Sep 2004
Location: Mars
Default Well , just a small question - 25-12-2004

I am currently experimenting POD 2.6 src , I am curious why sometimes the bot wont shoot ? Perhaps some pod l33t could help me ...


[NEW]
I am frustated of getting this buffer overrun error ...

Code:
Buffer overrun detected
 
D:\valve\hl.exe
 
A buffer overrun has been detected which has corrupted the program's internal state. The program cannot safely continue execution and must now be terminated
WTH ??!

Last edited by Rifleman; 25-12-2004 at 11:04..
  
Reply With Quote
Re: Well , just a small question
Old
  (#2)
dub
Member
 
dub's Avatar
 
Status: Offline
Posts: 89
Join Date: Aug 2004
Location: UK
Default Re: Well , just a small question - 25-12-2004

one bad pointer crash i know of could help (very common crash bug)
Code:
 // Enemy behind Obstacle ? Bot wants to fire ?
 	if (pBot->iStates & STATE_SUSPECTENEMY && pBot->bWantsToFire)
 	{
 		int iTask = pBot->pTasks->iTask;
 		// Don't allow shooting through walls when camping 
 		if(iTask == TASK_PAUSE || iTask == TASK_CAMP)
 			pBot->bWantsToFire = FALSE;
 	}
should be

Code:
 // Enemy behind Obstacle ? Bot wants to fire ?
 	if (pBot->iStates & STATE_SUSPECTENEMY && pBot->bWantsToFire)
 	{
 		int iTask = BotGetSafeTask (pBot)->iTask;
 		// Don't allow shooting through walls when camping 
 		if(iTask == TASK_PAUSE || iTask == TASK_CAMP)
 			pBot->bWantsToFire = FALSE;
 	}
  
Reply With Quote
Re: Well , just a small question
Old
  (#3)
Whistler
Summoner
 
Whistler's Avatar
 
Status: Offline
Posts: 1,499
Join Date: Feb 2004
Location: Mist Village
Default Re: Well , just a small question - 25-12-2004

"buffer overrun" means this:
PHP Code:
#include <string.h>
main()
{
   
char sz[5];
   
strcpy(sz"abcdefghijklmnopqrstuvwxyz"); // buffer overrun

  
Reply With Quote
Re: Well , just a small question
Old
  (#4)
Rifleman
This user broke our rules and has been BANNED
 
Status: Offline
Posts: 128
Join Date: Sep 2004
Location: Mars
Default Re: Well , just a small question - 25-12-2004

thanks guys ! The problem comes from my A* modification and now its fixed ! thanks again !
  
Reply With Quote
Re: Well , just a small question
Old
  (#5)
Whistler
Summoner
 
Whistler's Avatar
 
Status: Offline
Posts: 1,499
Join Date: Feb 2004
Location: Mist Village
Default Re: Well , just a small question - 26-12-2004

I fail to see how A* is related to shooting...
  
Reply With Quote
Re: Well , just a small question
Old
  (#6)
@$3.1415rin
Council Member, Author of JoeBOT
 
@$3.1415rin's Avatar
 
Status: Offline
Posts: 1,381
Join Date: Nov 2003
Location: Germany
Default Re: Well , just a small question - 26-12-2004

when having wrong pointers somewhere, you might often get error in nonrelated code ...


  
Reply With Quote
Re: Well , just a small question
Old
  (#7)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,620
Join Date: Jul 2004
Location: Bulgaria
Default Re: Well , just a small question - 26-12-2004

I wont to ask question to.
Is this thinks are same
Code:
  int iTask = pBot->pTasks->iTask;
and
Code:
  int iTask = BotGetSafeTask (pBot)->iTask;
?
  
Reply With Quote
Re: Well , just a small question
Old
  (#8)
Rifleman
This user broke our rules and has been BANNED
 
Status: Offline
Posts: 128
Join Date: Sep 2004
Location: Mars
Default Re: Well , just a small question - 26-12-2004

no , I didn't say it is related to the combat code...
  
Reply With Quote
Re: Well , just a small question
Old
  (#9)
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: Well , just a small question - 26-12-2004

this
Code:
int iTask = pBot->pTasks->iTask;
returns a pointer to the iTask element in the structure pointed to by pTasks. But this code will crash if pTasks is NULL, i.e. points to no tasks structure. This however
Code:
int iTask = BotGetSafeTask (pBot)->iTask;
will always return a valid pTasks pointer (even if it points to an empty task structure, what I'd call a "failsafe pointer"). This way iTask is always guaranteed to be accessible and the code won't crash.



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)
 

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