View unanswered posts | View active topics It is currently Thu Nov 28, 2024 8:24 am



Reply to topic  [ 8 posts ] 
 Making AI more "relentless" 
Author Message
User avatar

Joined: Mon Oct 11, 2010 1:15 pm
Posts: 594
Location: Finlandia
Reply with quote
Post Making AI more "relentless"
The current AI isn't very good at pushing towards enemy, and relies a lot on having a weapon to fire from a distance while standing still. This makes implementing AI-compatible melee weapons really difficult.

The diggers-only one man army activity is a good example how the AI gets confused with using the digger as an offensive weapon. Actors can eventually figure out how to charge the player, but until then they just stand still. I'm looking for the same relentlessness as the "default" hardcoded AI has (when walking towards the brain without a weapon), but I want to include the pathfinding of the new AI.

I fear that there's nobody left around here to look into this so I'll have to do it myself, just looking to see if someone would have thought about this too.


Thu Aug 16, 2018 12:15 pm
Profile

Joined: Fri Sep 10, 2010 1:48 am
Posts: 666
Location: Halifax, Canada
Reply with quote
Post Re: Making AI more "relentless"
I'd be surprised if you find too much, the ai is a big, complex and kind of messy set of code and most people don't want to delve too far in. I'm trying to remember cases of this sort of stuff but not much comes to mind. Here's what I got though:

xenoargh's Cortex Command reloaded may be of some help: viewtopic.php?t=31342

There's also the post by clunatic about it which suggests a possible solution (there's some code partway down the page and I think this probably the most straightforward way to do things): viewtopic.php?f=73&t=45284

There may be more too that I'm missing, but aside from whatever you can find through searching you're probably on your own.


Thu Aug 16, 2018 10:20 pm
Profile
User avatar

Joined: Mon Oct 11, 2010 1:15 pm
Posts: 594
Location: Finlandia
Reply with quote
Post Re: Making AI more "relentless"
Yeah, thanks anyway. The AI files are ass to read thoroughly so I've been trying to just strip away any AI functions that might be keeping it from advancing, since I'm aiming for a relatively dumb AI with the simple goal of getting to the enemy brain and destroying it. (read: zombie)

I'm going to delve into the two topics and see if I can find anything.


Fri Aug 17, 2018 1:50 pm
Profile

Joined: Fri Sep 10, 2010 1:48 am
Posts: 666
Location: Halifax, Canada
Reply with quote
Post Re: Making AI more "relentless"
Haha well I can at least say that I very much know your pain. I took a brief stab at that exact thing with the DayZ mod, but never got past the same stripping it down stage before the mod was abandoned.
Good luck with it, hope you can keep at it.


Sat Aug 18, 2018 3:12 am
Profile
User avatar

Joined: Mon Oct 11, 2010 1:15 pm
Posts: 594
Location: Finlandia
Reply with quote
Post Re: Making AI more "relentless"
It's like I'm using lobotomy to fix the issue... lmao

I've used enough time to create a pretty rad zombie actor, so I really wanna finish this "project" and turn it into an activity. I'm aiming for a simple zombie defense + possibly a campaign-ish activity with tasks.

The zombie actor is packed with following features:

  • Rises up through the ground (in the activity, as of now)
  • Can climb up walls and other zombies (CC48's script)
  • Can deal some rough melee damage through scratching and biting
  • Flails its arms and head (like a proper zombie)
  • Hunches and staggers while walking (like a proper zombie)
  • Can "fake" its' death by getting knocked out only to rise back up a few seconds after (remember to double-tap!)
  • Can survive without a head for about a second (with proper blood gushing effects)

To-do:
  • Ability to sever limbs
  • Ability to grab the player / carry them around while dealing damage
  • Different zombie types, of course

EDIT: I managed to poke the right spot in the AI. Huzzah.

The part that stopped the script was at the end of HumanBehaviors.BrainSearch.
Code:
         
         --Owner:ClearAIWaypoints()         -- this part freezes the script when facing the brain
         
         if MovableMan:IsActor(ClosestBrain) then
            Owner:ClearAIWaypoints()      -- moving the function here fixes it
            Owner:AddAIMOWaypoint(ClosestBrain)
            AI:CreateGoToBehavior(Owner)
         else
            return true   -- the brain we found died while we where searching, restart this behavior next frame
         end

The AI doesn't seem freeze the actors in their place anymore. I also did some further edits that help legless actors without jetpacks move by crawling. They could still be better at traversing terrain though.


Sat Aug 18, 2018 11:32 am
Profile

Joined: Fri Sep 10, 2010 1:48 am
Posts: 666
Location: Halifax, Canada
Reply with quote
Post Re: Making AI more "relentless"
Hey that sounds awesome, the double tap rule and headless chicken-ing sound particularly cool.

Hmm, I'd guess your scene doesn't have a brain actor and all the zombies are in brainhunt mode? It looks like that part wouldn't cause problems if they have a brain to search for, but otherwise they'd get stuck running the function and returning constantly without actually doing anything. Keep in mind I haven't looked at lua, much less CC's ai, in ages and may be way off base haha


Tue Aug 21, 2018 1:46 am
Profile
User avatar

Joined: Mon Oct 11, 2010 1:15 pm
Posts: 594
Location: Finlandia
Reply with quote
Post Re: Making AI more "relentless"
It's probably caused by the fact that the "brain" actor in One Man Army isn't exactly a brain to begin with but rather just a regular unit that has been given brain status. It likely caused an extra step for the AI to get over, making it too clumsy.

I also implemented clunatic's melee weapon thing and it was pretty straightforward and functional. I'm not sure yet if it's mandatory to replace the Base.rte AI for it to work, however it's not like it *removes* any features.


Tue Aug 21, 2018 11:11 am
Profile

Joined: Fri Sep 10, 2010 1:48 am
Posts: 666
Location: Halifax, Canada
Reply with quote
Post Re: Making AI more "relentless"
Ah yeah that might give problems for the check.

And cool stuff about melee weapon script, hope everything else goes so smoothly.


Tue Aug 21, 2018 11:41 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 8 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.057s | 13 Queries | GZIP : Off ]