Forum

ASSIST, AMERICA'S ARMY COMMUNITY - RELIVE THE GLORY DAYS OF AMERICA'S ARMY 2.5

Author Topic: When OpFor invade your empty server (AKA LEEFFM's AI Mod)  (Read 21716 times)

0 Members and 1 Guest are viewing this topic.

Offline TICUS

  • Full Member
  • ***
  • Posts: 57
    • View Profile
Re: When OpFor invade your empty server (AKA LEEFFM's AI Mod)
« Reply #30 on: Friday, September 02, 2016, 10:04:08 AM »
Good job! LEEFFM keep it up. The bot looks like he was on rollerblades! :D
« Last Edit: Monday, September 05, 2016, 17:44:09 PM by TICUS »

Offline LEEFFM

When OpFor invade your empty server (AKA LEEFFM's AI Mod)
« Reply #31 on: Sunday, December 25, 2016, 13:36:37 PM »
Ive been working more on the AI Mod, the AI now uses some Path finding to patrol the PathNode network i have setup while patrolling if they see a player they will follow you using path finding so if you run from one building to the next they will attempt to follow you even if they cant see you anymore and they will shoot at you, they are really accurate and will fire full-auto at you.

the reason when the AI kill you the deathmessage says "YourPlayerName has been shot by someone" is because in class AGP_DeathMessage if the controller whether it be a HumanController or a AIController doesnt have a PlayerReplicationInfo Class (in this case its the AIController that doesnt have a PlayerReplicationInfo class).

Code Snippet from AGP_DeathMessage.uc:
Code: [Select]
var localized string KilledString, SomeoneString;

static function string GetString(
optional int Switch,
optional PlayerReplicationInfo RelatedPRI_1,
optional PlayerReplicationInfo RelatedPRI_2,
optional Object OptionalObject,
optional string ExtraText
)
{
local string KillerName, VictimName;

if (Class<DamageType>(OptionalObject) == None){
return "";
}

if (RelatedPRI_2 == None)
VictimName = Default.SomeoneString;
else
VictimName = RelatedPRI_2.PlayerName;

if ( Switch == 1 )
{
// suicide
return class'GameInfo'.Static.ParseKillMessage(
VictimName,
VictimName,
Class<DamageType>(OptionalObject).Static.SuicideMessage(RelatedPRI_2) );
}

if (RelatedPRI_1 == None)
KillerName = Default.SomeoneString;
else
KillerName = RelatedPRI_1.PlayerName;

return class'GameInfo'.Static.ParseKillMessage(
KillerName,
VictimName,
Class<DamageType>(OptionalObject).Static.DeathMessage(RelatedPRI_1, RelatedPRI_2) );
}

defaultproperties
{
     KilledString="was killed by"
     SomeoneString="someone"
}

Spanky will be posting a new video to show the AI's new behavior.

Offline Koden

  • Cogito Ergo Khodohn
  • Global Moderator
  • Epic Poster
  • *
  • Posts: 2,333
  • Hmmm rainbows.
    • View Profile
Re: When OpFor invade your empty server (AKA LEEFFM's AI Mod)
« Reply #32 on: Sunday, December 25, 2016, 14:01:05 PM »
Ive been working more on the AI Mod, the AI now uses some Path finding to patrol the PathNode network i have setup while patrolling if they see a player they will follow you using path finding so if you run from one building to the next they will attempt to follow you even if they cant see you anymore and they will shoot at you, they are really accurate and will fire full-auto at you.

the reason when the AI kill you the deathmessage says "YourPlayerName has been shot by someone" is because in class AGP_DeathMessage if the controller whether it be a HumanController or a AIController doesnt have a PlayerReplicationInfo Class (in this case its the AIController that doesnt have a PlayerReplicationInfo class).

Code Snippet from AGP_DeathMessage.uc:
Code: [Select]
var localized string KilledString, SomeoneString;

static function string GetString(
optional int Switch,
optional PlayerReplicationInfo RelatedPRI_1,
optional PlayerReplicationInfo RelatedPRI_2,
optional Object OptionalObject,
optional string ExtraText
)
{
local string KillerName, VictimName;

if (Class<DamageType>(OptionalObject) == None){
return "";
}

if (RelatedPRI_2 == None)
VictimName = Default.SomeoneString;
else
VictimName = RelatedPRI_2.PlayerName;

if ( Switch == 1 )
{
// suicide
return class'GameInfo'.Static.ParseKillMessage(
VictimName,
VictimName,
Class<DamageType>(OptionalObject).Static.SuicideMessage(RelatedPRI_2) );
}

if (RelatedPRI_1 == None)
KillerName = Default.SomeoneString;
else
KillerName = RelatedPRI_1.PlayerName;

return class'GameInfo'.Static.ParseKillMessage(
KillerName,
VictimName,
Class<DamageType>(OptionalObject).Static.DeathMessage(RelatedPRI_1, RelatedPRI_2) );
}

defaultproperties
{
     KilledString="was killed by"
     SomeoneString="someone"
}

Spanky will be posting a new video to show the AI's new behavior.

That's a really cool addition, nice job!

Offline LEEFFM

Re: When OpFor invade your empty server (AKA LEEFFM's AI Mod)
« Reply #33 on: Sunday, December 25, 2016, 14:32:14 PM »
Thanks!, i have now made it so my AIController now has a PlayerReplicationInfo class and i have set the Playername to Assist_bot, now they shoot at eachother as they are not assigned to any team so i see deathmessages that say "Assist_Bot was shot by Assist_bot, and when they kil me ".neXus[LEEFFM] was shot by Assist_bot"

this addition will not be included in the video.
« Last Edit: Sunday, December 25, 2016, 14:53:22 PM by LEEFFM »

Offline Koden

  • Cogito Ergo Khodohn
  • Global Moderator
  • Epic Poster
  • *
  • Posts: 2,333
  • Hmmm rainbows.
    • View Profile
Re: When OpFor invade your empty server (AKA LEEFFM's AI Mod)
« Reply #34 on: Sunday, December 25, 2016, 15:18:50 PM »
Thanks!, i have now made it so my AIController now has a PlayerReplicationInfo class and i have set the Playername to Assist_bot, now they shoot at eachother as they are not assigned to any team so i see deathmessages that say "Assist_Bot was shot by Assist_bot, and when they kil me ".neXus[LEEFFM] was shot by Assist_bot"

this addition will not be included in the video.
That must be funny to look at...did you work on any map in particular, in order to set the pathfinding?

Offline LEEFFM

Re: When OpFor invade your empty server (AKA LEEFFM's AI Mod)
« Reply #35 on: Sunday, December 25, 2016, 15:21:10 PM »
I have setup Pathnodes on Urban Assault and renamed it to UrbanAI for testing purposes. the pathfinding itself is done by using native functions from Controller.uc

Code Snippet from Controller.uc
Code: [Select]
native(517) final function Actor FindPathToward(actor anActor, optional bool bWeightDetours);

native(502) final latent function MoveToward(actor NewTarget, optional Actor ViewFocus, optional float DestinationOffset, optional bool bUseStrafing, optional bool bShouldWalk);
« Last Edit: Sunday, December 25, 2016, 15:25:22 PM by LEEFFM »

Offline Spanky

  • <?php echo $opinion .' is better.'; ?>
  • Administrator
  • Posts like a Spanky!
  • *
  • Posts: 10,893
    • View Profile
    • NatesComp.com
  • AA: tigobitties
Re: When OpFor invade your empty server (AKA LEEFFM's AI Mod)
« Reply #36 on: Monday, December 26, 2016, 13:19:24 PM »
Little late but here's the first video (might upload a second):
It's like shaving your pubes to make your junk look bigger.
Might look bigger, but it aint.....

Offline Ganja

Re: When OpFor invade your empty server (AKA LEEFFM's AI Mod)
« Reply #37 on: Monday, December 26, 2016, 13:35:37 PM »
AI 1 - 0 Spanky :D

Offline Koden

  • Cogito Ergo Khodohn
  • Global Moderator
  • Epic Poster
  • *
  • Posts: 2,333
  • Hmmm rainbows.
    • View Profile
Re: When OpFor invade your empty server (AKA LEEFFM's AI Mod)
« Reply #38 on: Monday, December 26, 2016, 14:12:26 PM »
It still looks kind of funny because of the lack of animations for the AI, and it also makes it harder to predict which action they're performing (although I guess they only walk, right?), but overall it is definitely working.

Offline LEEFFM

Re: When OpFor invade your empty server (AKA LEEFFM's AI Mod)
« Reply #39 on: Monday, December 26, 2016, 15:32:49 PM »
Actually they have animations if you spawn them using a command i added "summonmercenary", but the ones placed in the map editor dont seem to have/use animations.

I think i need to make the path node network better because bots seem to work best in the middle building where you could see 4 of them wandering, after killing those i can spawn more using "summonmercenary" and they start wandering/patroling but if i use "summonmercenary" in other places like around the 2 spawn areas for example they just stand there and cant find a path to the movetarget whis is set to be a random pathnode in the pathnode network but if they see an enemy they are supposed to follow/shoot but the path to the enemy cannot be found and i get errors in the log file say pawn accessed none still working out the issues, i put thoose issues to the side as im now trying to get them to spawn at the beginning of the match to play in place of human players untill human players join the game.

At this point the Bots have a default state named Busy which checks to see if the pawn has a weapon and if it does not it gives the pawn a weapon, then it tells the bot to go to state MPatorl (a state for of course patrolling the pathnode network) in that state it picks a random pathnode attempt to find  a path to it and then moves to the first pathnode towards the Destination pathnode.

While the bot is in state Mpatrol if he sees a player he will set the player as his movetarget and enemy, then he will go to state Follow where the Destionation is the player that was seen, the bot wil try to find a path to the enemy then it will move toward the first pathnode towards the enemy and will shoot at the enemy player.

When the Enemy the bot saw dies the bot will stop shooting and go back to state busy to start the process over again.
« Last Edit: Monday, December 26, 2016, 15:39:36 PM by LEEFFM »

Offline Ganja

Re: When OpFor invade your empty server (AKA LEEFFM's AI Mod)
« Reply #40 on: Monday, December 26, 2016, 17:51:18 PM »
Very impressive and neat :)

 

Download Assist

×

Download Game Client

Important: Battletracker no longer exists. However, old Battletracker accounts may still work. You can create a new 25Assist account here

Download Server Manager