Welcome, Guest. Please login or register.

What openbor you prefer: Double dragon,battletoads or final fight !? by lirexpatrio
[December 07, 2012, 07:15:27 pm]


what are your favorite games OpenBOR?! by lirexpatrio
[December 07, 2012, 07:09:46 pm]


Post Some Awesome Videos by maxman
[December 07, 2012, 05:51:39 pm]


Can @cmd playmusic "aaaa" 1 also increse music sound ? by BeasTie
[December 07, 2012, 05:24:38 pm]


Streets of Rage: Silent Storm by mtrain
[December 07, 2012, 03:45:05 pm]


Site will be down for maintenance on 12/8/2012 thru 12/10/2012 by Damon Caskey
[December 07, 2012, 07:42:42 am]


Cancelled SOR 3d Remake by riccochet
[December 07, 2012, 03:58:33 am]


Dungeon Fighter: B.O.R. by msmalik681
[December 07, 2012, 03:24:27 am]


[TUTORIAL] How to create 4 Games of OpenBOR in 1 CD (650 MB) by magggas
[December 06, 2012, 09:46:25 pm]


custknife by Bloodbane
[December 06, 2012, 09:34:09 pm]


blockfx help by B.Kardi
[December 06, 2012, 04:09:14 pm]


street of age 4 hd by corradlo
[December 06, 2012, 01:41:36 pm]


ClaFan - Classic Fantasy ver 1.17 by soniczxblade
[December 06, 2012, 05:01:20 am]


Bug Archive by Bloodbane
[December 06, 2012, 02:00:44 am]


"Bio-Doom" and "Gears of Doom" by BulletBob
[December 05, 2012, 10:07:21 pm]


Contra Locked 'N' Loaded v2 by Bloodbane
[December 05, 2012, 09:39:43 pm]


Downloadable OpenBoR Manual by BeasTie
[December 05, 2012, 08:31:24 pm]


Having trouble testing changes by B.Kardi
[December 05, 2012, 03:05:53 pm]


DragonBall Absalon by msmalik681
[December 05, 2012, 02:52:13 pm]


[Hi-Res] Swamp by Vibrant
[December 05, 2012, 10:47:14 am]


  • Dot Guests: 172
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.



Author Topic: Enemy AI Grab  (Read 396 times)

0 Members and 1 Guest are viewing this topic.

Offline Damon Caskey

  • Hero Member
  • *****
  • Posts: 5335
    • The Gorge
Enemy AI Grab
« on: November 10, 2012, 11:38:38 am »
@utunnels

When you coded the more advanced AI grappling behavior (i.e. choosing randomly which grab action to do and sometimes just letting go), did you happen to include a model switch to disable the "let go" behavior? If there is one I can't find it.

In my own projects the letting go behavior happens more than I would like, especially if the model only has slams/throws and no GRABATTACK. For certain types of characters it is visually jarring. I could hack around it but for design standard and simplicity would rather avoid doing so.

DC
« Last Edit: November 10, 2012, 11:43:07 am by Damon Caskey »
OpenBOR Wiki.

Coming Soon:
Spoiler
Fatal Fury Chronicals


Offline utunnels

  • Developer
  • Hero Member
  • *****
  • Posts: 2713
Re: Enemy AI Grab
« Reply #1 on: November 10, 2012, 12:50:49 pm »
The behavior is controled by releasetime, which should be easy to add as an entity property.

For example: changeentityproperty(ent, "releasetime", openborvariant("elapsed_time") + 99999);


Or a model header command like grabstall, but the function is limited so perhaps not worthy.

Offline Bloodbane

  • Hero Member
  • *****
  • Posts: 7113
  • Dark Dragon
Re: Enemy AI Grab
« Reply #2 on: November 11, 2012, 01:23:47 am »
 I agree that this feature should be added in. Capcom beat'm ups have time limit on grab that's why almost no enemies have SPECIAL to break free.
OpenBoR Manual

Basic OpenBoR Tutorials

OpenBoR Tricks & Tutorials

"The more often enemies attack, the more open they are to counter attacks"

Offline utunnels

  • Developer
  • Hero Member
  • *****
  • Posts: 2713
Re: Enemy AI Grab
« Reply #3 on: November 12, 2012, 12:37:55 am »
Since AI does grab attacks randomly, there's no real strategy they can follow.
So a script solution for throw/slam is adding performattack logic at the end of the grab animation and use grabfinish switch to force the animation to continue.

I have added script acess to releasetime though, you can try it to see how well it works.

Code: [Select]
anim grab
@script
    if(frame==1)
    {
        changeentityproperty(getlocalvar("self"), "releasetime", openborvariant("elapsed_time") + 99999);
    }
@end_script
    delay 100
    frame data/chars/dude/grab1.gif


Offline Damon Caskey

  • Hero Member
  • *****
  • Posts: 5335
    • The Gorge
Re: Enemy AI Grab
« Reply #4 on: November 12, 2012, 10:05:42 am »
Gave this a try, but it does not prevent the AI from choosing to let go. The above suggestion only forces the AI to hold on until their grab animation delay runs out.

What I was hoping for was a switch that forces the AI to always perform some grab action if it can. Basically, to remove "let go of my target" from the list of options it is randomly picking from.

DC
OpenBOR Wiki.

Coming Soon:
Spoiler
Fatal Fury Chronicals


Offline utunnels

  • Developer
  • Hero Member
  • *****
  • Posts: 2713
Re: Enemy AI Grab
« Reply #5 on: November 12, 2012, 07:05:50 pm »
Are you sure you changed releasetime in grab animation? Because the let-go logic is like this:

Code: [Select]
if(time > self->releasetime)
{
if(rnum < 12)
{
// Release
self->takeaction = NULL;
ent_unlink(self);
set_idle(self);
return;
}
else self->releasetime = time + (GAME_SPEED/2);
}


So in theory if you give a long enough releasetime this is never executed.

Offline Damon Caskey

  • Hero Member
  • *****
  • Posts: 5335
    • The Gorge
Re: Enemy AI Grab
« Reply #6 on: November 13, 2012, 03:25:32 pm »
Yes. And it did make a difference.

Without it, the AI would grab and instantly release. The effect was to have a quick but jarring pause when the two entities passed each other. With your script suggestion the AI is less apt to let go, but still does. They just hold on for however long the delay in GRAB animation happens to be.

Just to see what would happen I also tried making GRAB a looped animation with your script; that simply made the AI never do anything at all. They would always grab and hold on forever without taking any action.

One thing I haven't tried is an extra long delay instead of a loop. Will report back.

DC
« Last Edit: November 13, 2012, 03:28:13 pm by Damon Caskey »
OpenBOR Wiki.

Coming Soon:
Spoiler
Fatal Fury Chronicals


Offline utunnels

  • Developer
  • Hero Member
  • *****
  • Posts: 2713
Re: Enemy AI Grab
« Reply #7 on: November 13, 2012, 07:23:00 pm »
Yeah, there seems to be some problem I don't recognize. Maybe you can post your txt for further investigation.

BTW, if you want to use a looping or extra long grab animation, just don't use grabfinish 1, otherwise they will wait for the animation to finish, forever.

Offline Damon Caskey

  • Hero Member
  • *****
  • Posts: 5335
    • The Gorge
Re: Enemy AI Grab
« Reply #8 on: November 13, 2012, 07:58:29 pm »
Tried the long delay (not grabfinish 1). Same as before. The AI will still sometimes choose to do nothing but let go - in which case it hangs on until the GRAB animation delay runs out.

DC
OpenBOR Wiki.

Coming Soon:
Spoiler
Fatal Fury Chronicals


 



 0%




mighty
SimplePortal 2.3.3 © 2008-2010, SimplePortal