Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[2.0] Annoying Henry AI
#1
So with the recent changes to the AI, it's possible to rewrite the basic AI for characters as well. I present to you, the annoying henry AI. All it does is kite you around :p

Code:
void id(){
    // reset all inputs
    left(0,0);
    right(0,0);
    J(0,0);
    up(0,0);
    down(0,0);
    A(0,0);
    D(0,0);
    
    for (int i = 0; i < 400; i++)
    {
        if (loadTarget(i) == 0 && target.num != self.num)
            break;
    }
    
    int distance = abs(target.x - self.x);
    int zdistance = abs(target.z - self.z);
    bool jump = false;
    
    
    
    
    if(distance < 300 || self.state == 2 || (target.state == 2 && distance < 350))
    {
        jump = true;
        
        if (bg_width - self.x < 100)
        {
            left();
        }
        else if (self.x < 100)
        {
            right();
        }
        else if (target.x > self.x)
        {
            left();
        }
        else
        {
            right();
        }

        if(self.state == 2 && jump){J();}
    }
    else{
        if (target.x > self.x && self.facing)
        {
            right(1,1);
        }
        else if (target.x < self.x && !self.facing)
        {
            left(1,1);
        }
        
        if (target.blink == 0 && target.state != 6 && target.state != 12 && target.state != 14)
        {
            if (target.z > self.z && zdistance > 10)
            {
                down();
            }
            else if(target.z < self.z)
            {
                up();
            }
            
            if (distance < 473)
            {
                if (zdistance < 10)
                {
                    A();
                }
                else if (zdistance > 15 && zdistance < 40)
                {
                    if (target.z > self.z)
                    {
                        down(1,0);
                    }
                    else
                    {
                        up();
                    }
                    A();
                }
                
            }
        }
    }
}

Try beating it with template/bandit. It's easy to beat with characters with projectiles because it doesn't bother defending etc.
[Image: doty7Xn.gif]

10 ʏᴇᴀʀs sɪɴᴄᴇ ɪʀᴄ ɢᴏᴏᴅ.ɪ ᴡᴀʟᴋ ᴛʜʀᴏᴜɢʜ ᴛʜᴇ ᴇᴍᴘᴛʏ sᴛʀᴇᴇᴛs ᴛʀʏɪɴɢ ᴛᴏ ᴛʜɪɴᴋ ᴏғ sᴏᴍᴇᴛʜɪɴɢ ᴇʟsᴇ ʙᴜᴛ ᴍʏ ᴘᴀᴛʜ ᴀʟᴡᴀʏs ʟᴇᴀᴅs ᴛᴏ ᴛʜᴇ ɪʀᴄ. ɪ sᴛᴀʀᴇ ᴀᴛ ᴛʜᴇ sᴄʀᴇᴇɴ ғᴏʀ ʜᴏᴜʀs ᴀɴᴅ ᴛʀʏ ᴛᴏ sᴜᴍᴍᴏɴ ᴛʜᴇ ɢᴏᴏᴅ ɪʀᴄ. ɪ ᴡᴀᴛᴄʜ ᴏᴛʜᴇʀ ɪʀᴄ ᴄʜᴀɴɴᴇʟs ʙᴜᴛ ɪᴛ ɪs ɴᴏ ɢᴏᴏᴅ. ɪ ᴘᴇsᴛᴇʀ ᴢᴏʀᴛ ᴀɴᴅ ᴛʀʏ ᴛᴏ ʀᴇsɪsᴛ ʜɪs sᴇxɪɴᴇss ʙᴜᴛ ɪᴛ ɪs ᴀʟʟ ᴍᴇᴀɴɪɴɢʟᴇss. ᴛʜᴇ ᴇɴᴅ ɪs ɴᴇᴀʀ.ɪ ᴛʜᴇɴ ᴜsᴜᴀʟʟʏ ʀᴇᴀᴅ sᴏᴍᴇ ᴏʟᴅ ɪʀᴄ ʟᴏɢs ᴀɴᴅ ᴄʀʏ ᴍʏsᴇʟғ ᴛᴏ sʟᴇᴇᴘ.


Reply
Thanks given by: qwertz143 , Hero destroyer , A-Man , letoangt
#2
http://www.youtube.com/watch?v=IPKC4EapQAo&feature=plcp

Youtube video of henry AI owning most things.

DOUBLE POST WATCHA GONNA DO?

Silverthorn edited this post 07-13-2012 03:39 PM because:
WATCHA GONNA DO WHEN THEY COME FOR YOU ♫
[Image: doty7Xn.gif]

10 ʏᴇᴀʀs sɪɴᴄᴇ ɪʀᴄ ɢᴏᴏᴅ.ɪ ᴡᴀʟᴋ ᴛʜʀᴏᴜɢʜ ᴛʜᴇ ᴇᴍᴘᴛʏ sᴛʀᴇᴇᴛs ᴛʀʏɪɴɢ ᴛᴏ ᴛʜɪɴᴋ ᴏғ sᴏᴍᴇᴛʜɪɴɢ ᴇʟsᴇ ʙᴜᴛ ᴍʏ ᴘᴀᴛʜ ᴀʟᴡᴀʏs ʟᴇᴀᴅs ᴛᴏ ᴛʜᴇ ɪʀᴄ. ɪ sᴛᴀʀᴇ ᴀᴛ ᴛʜᴇ sᴄʀᴇᴇɴ ғᴏʀ ʜᴏᴜʀs ᴀɴᴅ ᴛʀʏ ᴛᴏ sᴜᴍᴍᴏɴ ᴛʜᴇ ɢᴏᴏᴅ ɪʀᴄ. ɪ ᴡᴀᴛᴄʜ ᴏᴛʜᴇʀ ɪʀᴄ ᴄʜᴀɴɴᴇʟs ʙᴜᴛ ɪᴛ ɪs ɴᴏ ɢᴏᴏᴅ. ɪ ᴘᴇsᴛᴇʀ ᴢᴏʀᴛ ᴀɴᴅ ᴛʀʏ ᴛᴏ ʀᴇsɪsᴛ ʜɪs sᴇxɪɴᴇss ʙᴜᴛ ɪᴛ ɪs ᴀʟʟ ᴍᴇᴀɴɪɴɢʟᴇss. ᴛʜᴇ ᴇɴᴅ ɪs ɴᴇᴀʀ.ɪ ᴛʜᴇɴ ᴜsᴜᴀʟʟʏ ʀᴇᴀᴅ sᴏᴍᴇ ᴏʟᴅ ɪʀᴄ ʟᴏɢs ᴀɴᴅ ᴄʀʏ ᴍʏsᴇʟғ ᴛᴏ sʟᴇᴇᴘ.


Reply
Thanks given by:
#3
A-MAN to the rescue!!!
Trying it now. I will post the results once i am done.

Well thats....ThatS.....ThATs......THATS THE MOST ANNOYING THING I HAVE EVER WITNESSED.
Wen i try to go near him, he keeps shooting arrows. When i finally go near him enough to punch. He dashes back amazingly to the open side. When i walk up, he walks up. When i walk down, he walks down. Though he doesn't use any special move, he still beats me like hell. I couldn't damage him more than a quarter of his hp.

So silva made something crazy, and somebody have to defeat it.
KEVIIIIIIN!!ZOOOOORT!!ALL YO LFE FIGHTERS, HERE IS A REAL CHALLENGE FOR YAH! seriously no joking.

some hints for u:
1- He is alway open when he is holding a box,cuz he doesn't throw it.
2- He is also open when he is holding a milk or a beer, cuz he doesn't throw it.
[Image: signature.png]
A-Engine: A new beat em up game engine inspired by LF2. Coming soon

A-Engine Dev Blog - Update #8: Timeout

Reply
Thanks given by:
#4
There are a lot of bugs. If you just shoot projectiles from a distance you'll win. There is also a bug where if you stand exactly in the right place he'll just dash back and forth. It's no where near perfect, just a demonstration of the instant dash powers :p
[Image: doty7Xn.gif]

10 ʏᴇᴀʀs sɪɴᴄᴇ ɪʀᴄ ɢᴏᴏᴅ.ɪ ᴡᴀʟᴋ ᴛʜʀᴏᴜɢʜ ᴛʜᴇ ᴇᴍᴘᴛʏ sᴛʀᴇᴇᴛs ᴛʀʏɪɴɢ ᴛᴏ ᴛʜɪɴᴋ ᴏғ sᴏᴍᴇᴛʜɪɴɢ ᴇʟsᴇ ʙᴜᴛ ᴍʏ ᴘᴀᴛʜ ᴀʟᴡᴀʏs ʟᴇᴀᴅs ᴛᴏ ᴛʜᴇ ɪʀᴄ. ɪ sᴛᴀʀᴇ ᴀᴛ ᴛʜᴇ sᴄʀᴇᴇɴ ғᴏʀ ʜᴏᴜʀs ᴀɴᴅ ᴛʀʏ ᴛᴏ sᴜᴍᴍᴏɴ ᴛʜᴇ ɢᴏᴏᴅ ɪʀᴄ. ɪ ᴡᴀᴛᴄʜ ᴏᴛʜᴇʀ ɪʀᴄ ᴄʜᴀɴɴᴇʟs ʙᴜᴛ ɪᴛ ɪs ɴᴏ ɢᴏᴏᴅ. ɪ ᴘᴇsᴛᴇʀ ᴢᴏʀᴛ ᴀɴᴅ ᴛʀʏ ᴛᴏ ʀᴇsɪsᴛ ʜɪs sᴇxɪɴᴇss ʙᴜᴛ ɪᴛ ɪs ᴀʟʟ ᴍᴇᴀɴɪɴɢʟᴇss. ᴛʜᴇ ᴇɴᴅ ɪs ɴᴇᴀʀ.ɪ ᴛʜᴇɴ ᴜsᴜᴀʟʟʏ ʀᴇᴀᴅ sᴏᴍᴇ ᴏʟᴅ ɪʀᴄ ʟᴏɢs ᴀɴᴅ ᴄʀʏ ᴍʏsᴇʟғ ᴛᴏ sʟᴇᴇᴘ.


Reply
Thanks given by:
#5
Yeah, I defeated it with davis using his energy balls only. But i really couldn't with Bandit or template, not even with Deep. I dunno, maybe sometime when i have some time. I will try to make an invincible AI for Davis. And btw did u figure a way to randomize yet? this would be pretty useful. I was watching Azriel's same AI vs same AI on you tube. Randomization could have stopped that loop in run attacks and sprinting.
[Image: signature.png]
A-Engine: A new beat em up game engine inspired by LF2. Coming soon

A-Engine Dev Blog - Update #8: Timeout

Reply
Thanks given by:
#6
(07-13-2012, 06:23 PM)A-MAN Wrote:  Yeah, I defeated it with davis using his energy balls only. But i really couldn't with Bandit or template, not even with Deep. I dunno, maybe sometime when i have some time. I will try to make an invincible AI for Davis. And btw did u figure a way to randomize yet? this would be pretty useful. I was watching Azriel's same AI vs same AI on you tube. Randomization could have stopped that loop in run attacks and sprinting.

We've had randomization since the 2nd or 3rd update. It's just not used because it would f*** with replays.
[Image: doty7Xn.gif]

10 ʏᴇᴀʀs sɪɴᴄᴇ ɪʀᴄ ɢᴏᴏᴅ.ɪ ᴡᴀʟᴋ ᴛʜʀᴏᴜɢʜ ᴛʜᴇ ᴇᴍᴘᴛʏ sᴛʀᴇᴇᴛs ᴛʀʏɪɴɢ ᴛᴏ ᴛʜɪɴᴋ ᴏғ sᴏᴍᴇᴛʜɪɴɢ ᴇʟsᴇ ʙᴜᴛ ᴍʏ ᴘᴀᴛʜ ᴀʟᴡᴀʏs ʟᴇᴀᴅs ᴛᴏ ᴛʜᴇ ɪʀᴄ. ɪ sᴛᴀʀᴇ ᴀᴛ ᴛʜᴇ sᴄʀᴇᴇɴ ғᴏʀ ʜᴏᴜʀs ᴀɴᴅ ᴛʀʏ ᴛᴏ sᴜᴍᴍᴏɴ ᴛʜᴇ ɢᴏᴏᴅ ɪʀᴄ. ɪ ᴡᴀᴛᴄʜ ᴏᴛʜᴇʀ ɪʀᴄ ᴄʜᴀɴɴᴇʟs ʙᴜᴛ ɪᴛ ɪs ɴᴏ ɢᴏᴏᴅ. ɪ ᴘᴇsᴛᴇʀ ᴢᴏʀᴛ ᴀɴᴅ ᴛʀʏ ᴛᴏ ʀᴇsɪsᴛ ʜɪs sᴇxɪɴᴇss ʙᴜᴛ ɪᴛ ɪs ᴀʟʟ ᴍᴇᴀɴɪɴɢʟᴇss. ᴛʜᴇ ᴇɴᴅ ɪs ɴᴇᴀʀ.ɪ ᴛʜᴇɴ ᴜsᴜᴀʟʟʏ ʀᴇᴀᴅ sᴏᴍᴇ ᴏʟᴅ ɪʀᴄ ʟᴏɢs ᴀɴᴅ ᴄʀʏ ᴍʏsᴇʟғ ᴛᴏ sʟᴇᴇᴘ.


Reply
Thanks given by: A-Man
#7
What version does it need? I have tried 2.1 and 2.0 (release) but it don't work. It don't even run that dos window.

This challenge attracted me.
Reply
Thanks given by:
#8
(07-13-2012, 09:23 PM)empirefantasy Wrote:  What version does it need? I have tried 2.1 and 2.0 (release) but it don't work. It don't even run that dos window.

This challenge attracted me.
2.1
Simple steps:
1. Download the dll here: http://www.mediafire.com/?pxd026nqoqgw0
2. put the dll in the lf2 folder (i.e. /lf2/ddraw.dll).
3. make a folder "ai" in the lf2 folder (i.e. /lf2/ai)
4. in this ai folder, any [id].as files ([id] being the id of ur char) will be used as an ai script for ur char, so you'll have 13.as for an id 13: char. (so in our case, Henry got id 4. So save the script above as "4.as" and put it into the "ai" folder.
[Image: signature.png]
A-Engine: A new beat em up game engine inspired by LF2. Coming soon

A-Engine Dev Blog - Update #8: Timeout

Reply
Thanks given by: empirefantasy
#9
(07-14-2012, 03:28 AM)A-MAN Wrote:  [id].as files

Thanks. I was still using .CHAI.Sorry for making you to write so long.


I beat him with Freeze in HKC.
attack 670
HP Lost 120

And I was attacking him only in close distance.
Reply
Thanks given by:
#10
i declare to beat this with an AI for a different character!
on HKC at least
Reply
Thanks given by:




Users browsing this thread: 3 Guest(s)