| 
		
	
	
	
		
	Posts: 1,823Threads: 20
 Joined: Jun 2010
 
	
	
		ac_bot.cpp, line 27 goes like m_pMyEnt->nextprimary = 2 + rnd(5); // 2011jan18:ft: 2 == GUN_RIFLE, GUN_SHOTGUN, GUN_SUBGUN, GUN_SNIPER, GUN_ASSAULT - if CPISTOL is activated this needs a FIXME to rnd(6)
However, this used to be rnd(4) in 1.0 and it seemed to work fine, didn't it?
 
Then looking at the rnd function (ln 61, tools.cpp):
 #define rnd(x) ((int)(randomMT()&0xFFFFFF)%(x))
Then looking at randomMT
 uint randomMT(void){
 uint y;
 if(--left < 0) return(reloadMT());
 y  = *next++;
 y ^= (y >> 11);
 y ^= (y <<  7) & 0x9D2C5680U;
 y ^= (y << 15) & 0xEFC60000U;
 return(y ^ (y >> 18));
 }
The problem is, tools.h was changed, specifically the part with random numbers. eihrul changed the function , but I can't tell what it does exactly  I'm uber C++ noob. Then, thinking that rnd(6) would now be required for weapon numbers 2 3 4 5 6 7, I did that and compiled an SVN client with the change.
 
I found bots with ARs.  ![[Image: 20110313121339acdouzebd.jpg]](http://img148.imageshack.us/img148/2007/20110313121339acdouzebd.jpg)  
I also found bots with no weapon.  ![[Image: 20110313121354acdouzebd.jpg]](http://img87.imageshack.us/img87/7270/20110313121354acdouzebd.jpg)  
???? 
save us, eihrul!
	
		
	 
	
	
	
		
	Posts: 865Threads: 35
 Joined: Dec 2010
 
	
	
		could the bot with no weapon be caused by it trying to give a bot weapon number 7, which doesn't exist yet?
	 
		
	 
	
	
	
		
	Posts: 3,462Threads: 72
 Joined: Jun 2010
 
	
	
		Gibstick, see what giving them weapon number 1 is. 2 3 4 5 6 7 you forgot 1.Also make sure they are not trying to use the cpistol.
 
		
	 
	
	
	
		
	Posts: 865Threads: 35
 Joined: Dec 2010
 
	
		
		
		13 Mar 11, 08:17PM 
(This post was last modified: 13 Mar 11, 08:18PM by Lantry.)
		
	 
		iirc, 1 is the pistol. the normal one, not the cpistol (which is 7 i think)
	 
		
	 
	
	
	
		
	Posts: 1,823Threads: 20
 Joined: Jun 2010
 
	
	
		We'll have to test out the rnd function a bit more to understand. If 2 + rnd(5) doesn't give ARs but 2+ rnd(6) gives AR and combat pistol, there must be something funky going on.
	 
		
	 
	
	
	
		
	Posts: 3,780Threads: 33
 Joined: Jun 2010
 
	
		
		
		14 Mar 11, 03:14AM 
(This post was last modified: 14 Mar 11, 03:16AM by V-Man.)
		
	 
		Weapon index numbers: 0 knife1 pistol
 2 carbine
 3 shotgun
 4 SMG
 5 sniper
 6 AR
 7 (combat pistol)
 8 nades
 9 akimbo
Some of those may be bots trying to use cpistol/nades? 
lol 
But remember at the start of 1.1? People were remarking how funny it was to watch bots rifle-sprint themselves across the map like little grasshoppers -- using the AR.
	
		
	 
	
	
	
		
	Posts: 586Threads: 24
 Joined: Jun 2010
 
	
	
		Gibstick: just for my sanity's sake: you are testing this in SVN, yes? Because I distinctly remember doing some work on weapon-selection end of last year. One good testing variant we could establish would be a force-bots-to-use-weapon-X switch.
 
		
	 
	
	
	
		
	Posts: 3,462Threads: 72
 Joined: Jun 2010
 
	
		
		
		15 Mar 11, 12:38AM 
(This post was last modified: 15 Mar 11, 10:10AM by Ronald_Reagan.)
		
	 
		Flow, that may of been for the carbine?*sigh*: may've - may have. Not "may of", that's only "5th of May":"Cinco de Mayo" ;-P
 :( I have been really tired though out the week :'(  Please forgive me?
 
		
	 
	
	
	
		
	Posts: 1,823Threads: 20
 Joined: Jun 2010
 
	
	
		I am testing this in SVN.
	 
		
	 
	
	
	
		
	Posts: 2,331Threads: 45
 Joined: Feb 2011
 
	
	
		Combat Pistol should come to fruition so the bot isn't holding an invisigun :(
	 
		
	 
	
	
	
		
	Posts: 3,780Threads: 33
 Joined: Jun 2010
 
	
	
		Odd that it allowed the bot to "select" combat pistol (if we're sure that's what it is) at all.
	 
		
	 
	
	
	
		
	Posts: 865Threads: 35
 Joined: Dec 2010
 
	
		
		
		15 Mar 11, 09:00PM 
(This post was last modified: 15 Mar 11, 09:05PM by Lantry.)
		
	 
		 (13 Mar 11, 01:23PM)Gibstick Wrote:  Then, thinking that rnd(6) would now be required for weapon numbers 2 3 4 5 6 7, I did that and compiled an SVN client with the change. 
Wouldn't you want rnd(5) for 2 3 4 5 6? because including 7 would make it create a bot with combatpistol (if i understand this correctly, i haven't tested anything and i know very little about how it works)
 
EDIT: doh, i just looked at ac_bot.cpp and this is what it is currently at, with a note to change it to rnd(6) if cpistol is added
	 
		
	 
	
	
	
		
	Posts: 523Threads: 6
 Joined: Dec 2010
 
	
		
		
		15 Mar 11, 09:29PM 
(This post was last modified: 16 Mar 11, 12:09AM by VenteX.)
		
	 
		How about we finish balancing (EDIT: letting collect dust) that dang Combat Pistol and enable it! >_<
 * VenteX wants to play with the friggin' Combat Pistol
 
		
	 
	
	
	
		
	Posts: 3,462Threads: 72
 Joined: Jun 2010
 
	
	
		AFAIK they aren't "balancing" it. They are letting it collect dust.
	 
		
	 
	
	
	
		
	Posts: 2,331Threads: 45
 Joined: Feb 2011
 
	
	
		 (15 Mar 11, 09:29PM)VenteX Wrote:  How about we finish balancing (EDIT: letting collect dust) that dang Combat Pistol and enable it! >_<
 * VenteX wants to play with the friggin' Combat Pistol
 
I also wish this :( 
	 
		
	 
	
	
	
		
	Posts: 586Threads: 24
 Joined: Jun 2010
 
	
	
		wrong thread - quick answer, we thought balance first, new weapon later.
	 
		
	 
	
	
	
		
	Posts: 523Threads: 6
 Joined: Dec 2010
 
	
	
		Not what happened with the carbine xP
	 
		
	 
	
	
	
		
	Posts: 586Threads: 24
 Joined: Jun 2010
 
	
	
		VenteX: because it's usage was clear, it's not with the CombatPistol - as I've mentioned before - please let's stick to the topic though.
	 
		
	 |