Bot Bug in firing

Discussions about Coding and Scripting

Bot Bug in firing

Postby Gadavre » Sun Dec 11, 2016 11:24 am

I ask to help to fix lack of firing at the player in my Mutator
-----------------------------------------------------
VIDEO
https://youtu.be/H7J4HTZFmXs
-----------------------------------------------------
In the original game, bots can not shoot at the player at a very large distance. I put this line in my Mutator and bot began to see the player! Now we see the animation of aiming. But we don't see the shot. What can prevent firing at a great distance? Please help to fix!
Code: Select all
function ModifyPlayer(Pawn Other)   // called by GameInfo.RestartPlayer()
{
        Bot(Other).BaseAlertness = 2.000000;

        if ( NextMutator != None )
   NextMutator.ModifyPlayer(Other);
}
Last edited by Gadavre on Sun Dec 11, 2016 11:27 pm, edited 6 times in total.
User avatar
Gadavre
Experienced
 
Posts: 141
Joined: Sun Jan 18, 2015 7:55 am

Re: Bot Bug in firing

Postby sektor2111 » Sun Dec 11, 2016 11:58 am

Do you have a pain in wrapping your code ? If We all are players Will only spread Accessed Nones...
Code: Select all
if (Bot(Other) != None)
   Bot(Other).BaseAlertness = 2.000000;

else
Code: Select all
if (Other.IsA('Bot'))
   Bot(Other).BaseAlertness = 2.000000;
Because ModifyPlayer is NOT ONLY FOR BOT :loool: .
And then SightRadius goes at 5000 UU but... I cannot be sure if SeePlayer is being called at 100000 UU. When I was talking somewhere about an additional attached Bot Brain everybody doesn't have a clue why I was speaking about such things. Okay, keep going...
User avatar
sektor2111
Godlike
 
Posts: 3822
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Bot Bug in firing

Postby Gadavre » Sun Dec 11, 2016 12:47 pm

sektor2111
I tested your lines. They also don't work. I increased the variable Sight Radius to the value 10000 - 20000. It didn't help.
Increased visibility also did not help ( In original game by default 128).
Code: Select all
if (Other ! = None)
        Other.Visibility = 255;
User avatar
Gadavre
Experienced
 
Posts: 141
Joined: Sun Jan 18, 2015 7:55 am

Re: Bot Bug in firing

Postby sektor2111 » Sun Dec 11, 2016 2:01 pm

Visibility has nothing to do with SightRadius, see wiki before wasting more time.

Else it's normal to not work, but nobody is getting hurt if you WRAP codes properly - even if are not useful for this job.

Engine will lag itself at testing huge ranges, definitely this is not an answer...

Like I SAID, A.I. AKA Artificial Intelligence (stupidity) AKA BOT uses SeePlayer for detecting enemies. That crap is called by LORD ENGINE who need your help because he is wacky and poor.
User avatar
sektor2111
Godlike
 
Posts: 3822
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Bot Bug in firing

Postby OjitroC » Sun Dec 11, 2016 2:10 pm

You could have a look at the code for the TWFSightRadius Version 3 mutator, as "it allows the bots to spot another player at infinite distance", and see if it would help you (I use it playing with bots on large sniper maps and it certainly seems to work well, enabling the bots to spot the player at very long range and take shots - it does, though, throw up quite a few script warnings).
User avatar
OjitroC
Godlike
 
Posts: 1002
Joined: Sat Sep 12, 2015 8:46 pm

Re: Bot Bug in firing

Postby Gadavre » Sun Dec 11, 2016 2:58 pm

OjitroC wrote:You could have a look at the code for the TWFSightRadius Version 3 mutator, as "it allows the bots to spot another player at infinite distance", and see if it would help you (I use it playing with bots on large sniper maps and it certainly seems to work well, enabling the bots to spot the player at very long range and take shots - it does, though, throw up quite a few script warnings).
I tested this Mutator (TWFSightRadius Version 3) with Mutator Sniper Arena. The Bot also couldn't shoot at the player who was on the top platform with a SniperRifle (see my video above).
User avatar
Gadavre
Experienced
 
Posts: 141
Joined: Sun Jan 18, 2015 7:55 am

Re: Bot Bug in firing

Postby OjitroC » Sun Dec 11, 2016 4:48 pm

So, as you say, the problem is not that the bot does not see the player but that the bot does not fire at the player. Does it happen with ALL/ANY bots on THIS map? Does it happen on other maps? Is it to do with the bot skills settings (skills, accuracy, combat style etc)?
User avatar
OjitroC
Godlike
 
Posts: 1002
Joined: Sat Sep 12, 2015 8:46 pm

Re: Bot Bug in firing

Postby Gadavre » Sun Dec 11, 2016 5:17 pm

OjitroC wrote:So, as you say, the problem is not that the bot does not see the player but that the bot does not fire at the player. Does it happen with ALL/ANY bots on THIS map? Does it happen on other maps? Is it to do with the bot skills settings (skills, accuracy, combat style etc)?
Right!
User avatar
Gadavre
Experienced
 
Posts: 141
Joined: Sun Jan 18, 2015 7:55 am

Re: Bot Bug in firing

Postby Gadavre » Sun Dec 11, 2016 5:24 pm

I think the code of this function from original class"Bot" prevents the shoot at the player. What do you think?

Spoiler: show
function Killed(pawn Killer, pawn Other, name damageType)
{
local Pawn aPawn;

if ( Killer == self )
Other.Health = FMin(Other.Health, -11); // don't let other do stagger death

if ( Health <= 0 )
return;

if ( OldEnemy == Other )
OldEnemy = None;

if ( Enemy == Other )
{
bFire = 0;
bAltFire = 0;
bReadyToAttack = ( skill > 3 * FRand() );
EnemyDropped = Enemy.Weapon;
Enemy = None;
if ( (Killer == self) && (OldEnemy == None) )
{
for ( aPawn=Level.PawnList; aPawn!=None; aPawn=aPawn.nextPawn )
if ( aPawn.bIsPlayer && aPawn.bCollideActors
&& (VSize(Location - aPawn.Location) < 1600)
&& CanSee(aPawn) && SetEnemy(aPawn) )
{
GotoState('Attacking');
return;
}

MaybeTaunt(Other);
}
else
GotoState('Attacking');
}
else if ( Level.Game.bTeamGame && Other.bIsPlayer
&& (Other.PlayerReplicationInfo.Team == PlayerReplicationInfo.Team) )
{
if ( Other == Self )
return;
else
{
if ( (VSize(Location - Other.Location) < 1400)
&& LineOfSightTo(Other) )
SendTeamMessage(None, 'OTHER', 5, 10);
if ( (Orders == 'follow') && (Other == OrderObject) )
PointDied = Level.TimeSeconds;
}
}
}
User avatar
Gadavre
Experienced
 
Posts: 141
Joined: Sun Jan 18, 2015 7:55 am

Re: Bot Bug in firing

Postby sektor2111 » Sun Dec 11, 2016 5:36 pm

I think default sniper rifle has 4096 range, the rest is a myth at this weapon regarding to 5000 Sight triggered by a DefencePoint, LOL.

Above code is for picking next enemy from a closer horde and not for tracing a 10000 UU sphere space.

And here you came at my point. I did not loved Bot, so I did MBot - now it's your turn to make your own Bots and leave alone EPIC because is a waste of time.
User avatar
sektor2111
Godlike
 
Posts: 3822
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Bot Bug in firing

Postby Chamberly » Sun Dec 11, 2016 10:04 pm

Now the question is, do you have the code to make the bot fire at target? Since if it only see you... there is no other command telling it to shoot?

Btw, I think you are coding into a custom sniper rifle?
Image
Image
Image
User avatar
Chamberly
Godlike
 
Posts: 1643
Joined: Sat Sep 17, 2011 4:32 pm
Location: TN, USA
Personal rank: Dame. Vandora

Re: Bot Bug in firing

Postby Gadavre » Sun Dec 11, 2016 11:19 pm

Chamberly wrote:Now the question is, do you have the code to make the bot fire at target? Since if it only see you... there is no other command telling it to shoot?

Btw, I think you are coding into a custom sniper rifle?
I have no such code. The bot shoots as it is specified to him in the original game. yes, i m coding into a custom sniper rifle. But bots do not shoot at long range
with a standart sniperrifle.My SniperRifle does not affect the behavior of the bot.

I suggest community to fix it. I don't know what to do.
User avatar
Gadavre
Experienced
 
Posts: 141
Joined: Sun Jan 18, 2015 7:55 am

Re: Bot Bug in firing

Postby Chamberly » Sun Dec 11, 2016 11:52 pm

Gadavre wrote:I have no such code. The bot shoots as it is specified to him in the original game. yes, i m coding into a custom sniper rifle. But bots do not shoot at long range
with a standart sniperrifle.My SniperRifle does not affect the behavior of the bot.

I suggest community to fix it. I don't know what to do.


Funny that you suggested the community to fix it (like really? Not all of us can do it!). It's a lot more complicated than that. Coding is beyond the simplification of getting things up and running in easy mode, and, a lot of time to learn to learn to code properly and how to work on some progress to build up.
Just like planning a house, you'd need knowledge and specific requirements, the tools, and your own design in mind.

So to resume, I can tell that you're simply lying that you said you have no such code. The code you posted up there in beginning of the thread, IS part of a code...

Not sure what you rather wanting to do with the sniper, so we have no idea what's going on without the full context of details of what you are trying to do.

But there can be errors in the code you are trying to work on already so we don't know where to look if you modify something else already in full source.

So tbh, if you wanting to make your own sniper rifle in custom, look at some that are already made. No need to modify anything else to swap the engine into trouble and errors by modifying bots and everything else.

Just my 2 cent.
Image
Image
Image
User avatar
Chamberly
Godlike
 
Posts: 1643
Joined: Sat Sep 17, 2011 4:32 pm
Location: TN, USA
Personal rank: Dame. Vandora

Re: Bot Bug in firing

Postby EvilGrins » Mon Dec 12, 2016 12:01 am

Gadavre wrote:In the original game, bots can not shoot at the player at a very large distance

That depends on your bot...
Image
...I was never a fan of the default settings.

If you hype up a bot's skill, alertness, & accuracy (not necessarily as high as that above but more than the medium) it will not only shoot at you from very far away, it will often kill you without you having a clue where it was.

I'm not a coder, I go with the initial basics and customize all my bots individually.
http://unreal-games.livejournal.com/
Image
medor wrote:Replace Skaarj with EvilGrins :mrgreen:
User avatar
EvilGrins
Godlike
 
Posts: 6146
Joined: Thu Jun 30, 2011 8:12 pm
Location: Palo Alto, CA
Personal rank: God of Fudge

Re: Bot Bug in firing

Postby OjitroC » Mon Dec 12, 2016 12:55 am

I agree with EG - I think it could well be down to your bot skill settings (as EG indicates and as I suggested earlier) - I've certainly not had your problem with bots (I do use a lot of MBots, which you could try out to see if there is any difference in behaviour, and TSFSightRadius; I have not experienced any problems with bots not firing at long range). The bot in your video seems to avoid combat rather than seek it, as should be the case, so what combat style setting are you using for your bots and what base skill setting in the Start Practice Session menu?
User avatar
OjitroC
Godlike
 
Posts: 1002
Joined: Sat Sep 12, 2015 8:46 pm

Next

Return to Coding, Scripting

Who is online

Users browsing this forum: No registered users and 3 guests