Author Topic: Zombie AI reloading?  (Read 431 times)

0 Members and 1 Guest are viewing this topic.

EoceneMiacid

  • Jr. Member
  • **
  • Posts: 74
  • Karma: +4/-15
  • Doom Newbie
    • View Profile
Zombie AI reloading?
« on: June 14, 2016, 07:43:01 PM »
Hi,

My mod will primarily feature combat against armed human opponents, who may or may not be zombified.

While their default AI isn't too bad (I'm impressed to see how well they understand the map they're in, and how to navigate it), I feel it could do with a few tweaks to make the combat more interesting.

I'm mostly bothered by the fact they never need to reload, and have infinite ammo.
Ideally, they would need to reload, just like you do - and if they'd be really smart, they'd try to find cover first. H

Has this been done before, and if not, how far fetched is this?
As far as I know, their models do not have the requisite animations, but maybe those from Doomguy could be applied to them?


0x29a

  • PD3 Beta Testers
  • Jr. Member
  • *
  • Posts: 51
  • Karma: +3/-19
  • Doom Newbie
    • View Profile
Re: Zombie AI reloading?
« Reply #1 on: June 15, 2016, 03:49:06 PM »
I don't believe so. Different number of joints, different names. But the idea is very neat. I'll try to do the logic behind this and I'll see if there's an animation that would fit the bill.

Edit: Here's what I've found so far:

Code: [Select]

   anim reload                     models/md5/monsters/zcc/chaingun_reload.md5anim {
        frame 9                         sound_body monster_zombie_commando_cgun_reload
    }


Unfortunately, when I performed recursive grep on def directory it was the only dedicated anim that popped up
« Last Edit: June 15, 2016, 03:51:51 PM by 0x29a »

VGames

  • PD3 Beta Testers
  • Hero Member
  • *
  • Posts: 754
  • Karma: +17/-69
    • View Profile
Re: Zombie AI reloading?
« Reply #2 on: June 15, 2016, 03:55:36 PM »
It would be easy to get this to work script wise. But you'll need an animation for sure. In the script make a variable to keep track of the number of times fired such as "float i". In the animation section for shooting add "i++;" to the beginning of the animations code. That way it will add 1 to "i" every time he fires. Then in the shooting animation code body set up an if statement that won't allow the animation to continue if "i == 30" or whatever number you want for the clip size. When it does equal the max clip size make the monster do his reload animation state and in there set "i" to 0  so that it starts over and then tell the monster to go back to his idle state. Easy stuff.
Get the latest on Perfected Doom 3 here - http://www.moddb.com/mods/perfected-doom-3-version-500

0x29a

  • PD3 Beta Testers
  • Jr. Member
  • *
  • Posts: 51
  • Karma: +3/-19
  • Doom Newbie
    • View Profile
Re: Zombie AI reloading?
« Reply #3 on: June 15, 2016, 03:59:58 PM »
Yeah, and lack of dedicated animations is definitely a problem here... I certainly won't do this, as I'm completely talentless when it comes to animation. Especially when it comes to characters - to make it believable it's one hard job. Long hours if not days of work, or quite expensive motion capture.

As an afterthought it could be realised by combination of lower and aim animations - other thing is how it would really look in the game... 

VGames

  • PD3 Beta Testers
  • Hero Member
  • *
  • Posts: 754
  • Karma: +17/-69
    • View Profile
Re: Zombie AI reloading?
« Reply #4 on: June 15, 2016, 06:53:45 PM »
Yeah that's the main issue. I can do weapons but not characters.

Maybe if EoceneMiacid can get something going code wise with a filler animation for the reloading somebody around here could whip up a quick reloading animation.
Get the latest on Perfected Doom 3 here - http://www.moddb.com/mods/perfected-doom-3-version-500

EoceneMiacid

  • Jr. Member
  • **
  • Posts: 74
  • Karma: +4/-15
  • Doom Newbie
    • View Profile
Re: Zombie AI reloading?
« Reply #5 on: June 16, 2016, 09:06:31 AM »
Sure.

I'm kinda surprised that applying a doomguy animation to a zombie model isn't straightforward, since they share both human forms.

Making it look convincing is important, but not the first priority - we can look into that once the behavior is finished.

I'll see what I can do.

VGames

  • PD3 Beta Testers
  • Hero Member
  • *
  • Posts: 754
  • Karma: +17/-69
    • View Profile
Re: Zombie AI reloading?
« Reply #6 on: June 16, 2016, 10:07:51 AM »
Well they may look the same but doomguy has more bones.
Get the latest on Perfected Doom 3 here - http://www.moddb.com/mods/perfected-doom-3-version-500

EoceneMiacid

  • Jr. Member
  • **
  • Posts: 74
  • Karma: +4/-15
  • Doom Newbie
    • View Profile
Re: Zombie AI reloading?
« Reply #7 on: June 22, 2016, 12:52:18 AM »
I didn't get around to looking into animations yet, but I did manage to get a non-functional bot mod working and learned how the AI system works in the progress. Now I've got functional bots of my own, which I'm very pleased with.

Next step: restricting their ammo.