Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
AI: Azriel vs YinYin
#1
So our Davis AI fight did take place live, even if probably no one saw it live. But that may be better that way because my streaming capabilities were so bad that I had to use Suriks FPS changer at max to recognize any action going on. You should be able to view it [here] once the processing is done. (edit: scroll down to the bottom of this post to get high quality recordings for each match) But better yet you copy our two AIs from below and let them fight locally for yourself (keep in mind to give them unused AIs as original AIs still use ranged moves):

Azriels Davis AI:
    C-Code:
if (self_frame == 281) {
            J();
            return 1;
    }
 
    if (self_frame == 292) {
            if (self_y > -25) {
                    A();
            }
            return 1;
    }
 
    if (self_state == 5) {
            A();
            return 1;
    }
 
    // caught move-breaker (doesn't work for davis)
    if (self_state == 10) {
            A();
            return 1;
    }
 
    // try to block hits
    if (self_state == 11 || self_state == 16) {
            D();
            return 1;
    }
 
    // close range
    if (abs(self_z - target_z) <= 16) {
 
            var limit = 50;
            if (self_weapon_type != 0) {
                    limit = 80;
            }
 
            if (self_x - target_x <= 0 && self_x - target_x > -limit) {
 
                    if (target_state == 8) { // broken defense
                            DdA();
                            return 1;
                    } else if (target_state == 16) { // DoP
                            if (self_x - target_x > -7) {
                                    left();
                                    return 1;
                            }
                            right();
                            return 1;
                    } else if (target_state == 10) { // caught
                            A();
                            return 1;
                    } else if (target_state == 11) { // injured
                            if (target_fall <= 40) {
                                    A();
                            } else {
                                    DdA();
                            }
                            return 1;
                    } else if (target_state == 12) { // falling
                            if (self_mp >= 225 && self_state <= 2) {
                                    DuA();
                                    return 1;
                            }
                    } else if (target_state <= 3 || target_mp >= 225 || target_DuA == 3) {
                            if (target_frame < 270 || target_frame > 282) {
 
                                    if (target_frame >= 303) {
 
                                            clr();
                                            print("avoided dragon punch from left");
 
                                            // attempt to counter dragon punch
                                            if (self_facing == 0) {
                                                    print("self facing right");
                                                    if (target_facing == 0) {
                                                            right(); // move towards target
                                                            print("target facing right; moving right");
                                                            if (self_mp >= 225) {
                                                                    DuA();
                                                                    print("using dragon punch");
                                                                    return 1;
                                                            } else if (self_mp >= 75) {
                                                                    DdA();
                                                                    print("using strafe");
                                                                    return 1;
                                                            }
                                                            return 1;
                                                    } else {
                                                            left(); // face same way as target
                                                            if (self_mp >= 225) {
                                                                    DuA();
                                                                    print("target facing left; move left; using dragon punch");
                                                                    return 1;
                                                            } else if (self_mp >= 75) {
                                                                    DdA();
                                                                    print("target facing left; move left; using strafe");
                                                                    return 1;
                                                            }
                                                            A();
                                                            print("target facing left; move left; punch");
                                                            return 1;
                                                    }
                                            } else {
                                                    print("self facing left");
                                                    if (target_facing == 0) {
                                                            right(); // move towards target
                                                            print("target facing right; moving right");
                                                            return 1;
                                                    } else {
                                                            if (self_mp >= 225) {
                                                                    DuA();
                                                                    print("target facing left; using dragon punch");
                                                                    return 1;
                                                            } else if (self_mp >= 75) {
                                                                    DdA();
                                                                    print("target facing left; using strafe");
                                                                    return 1;
                                                            }
                                                            A();
                                                            print("target facing left; punch");
                                                            return 1;
                                                    }
                                            }
 
                                    } else {
                                            if (self_facing == 0) {
                                                    if (target_facing == 0) {
                                                            A();
                                                            return 1;
                                                    } else {
                                                            D();
                                                            return 1;
                                                    }
                                            } else {
                                                    if (target_facing == 0) {
                                                            right(); // turn around
                                                            return 1;
                                                    } else {
                                                            // dodge
                                                            if (target_z > self_z) {
                                                                    up();
                                                            } else {
                                                                    down();
                                                            }
                                                            left();
                                                            return 1;
                                                    }
                                            }
                                    }
                            } else {
                                    right();
                                    D();
                                    return 1;
                            }
                    } else if (self_frame == 110 && self_shake > 0) {
                            DdA();
                            return 1;
                    } else if (target_state == 4) {
                            right();
                            A();
                            return 1;
                    }
 
            } else if (self_x - target_x >= 0 && self_x - target_x < limit) {
 
                    if (self_frame == 110 && self_shake > 0) {
                            DdA();
                            return 1;
                    }
 
                    if (target_state == 8) { // broken defense
                            DdA();
                            return 1;
                    } else if (target_state == 16) { // DoP
                            if (self_x - target_x < 7) {
                                    right();
                                    return 1;
                            }
                            left();
                            return 1;
                    } else if (target_state == 10) { // caught
                            A();
                            return 1;
                    } else if (target_state == 11) { // injured
                            if (target_fall <= 40) {
                                    A();
                            } else {
                                    DdA();
                            }
                            return 1;
                    } else if (target_state == 12) { // falling
                            if (self_mp >= 225 && self_state <= 2) {
                                    DuA();
                                    return 1;
                            }
                    } else if (target_state <= 3 || target_mp >= 225 || target_DuA == 3) {
                            if (target_frame < 270 || target_frame > 282) {
                                    if (target_frame >= 303) {
 
                                            clr();
                                            print("avoided dragon punch from right");
 
                                            // attempt to counter dragon punch
                                            if (self_facing == 1) {
                                                    print("self facing left");
                                                    if (target_facing == 1) {
                                                            left(); // move towards target
                                                            print("target facing left; moving left");
                                                            if (self_mp >= 225) {
                                                                    DuA();
                                                                    print("using dragon punch");
                                                                    return 1;
                                                            } else if (self_mp >= 75) {
                                                                    DdA();
                                                                    print("using strafe");
                                                                    return 1;
                                                            }
                                                            return 1;
                                                    } else {
                                                            right(); // face same way as target
                                                            if (self_mp >= 225) {
                                                                    DuA();
                                                                    print("target facing right; move right; using dragon punch");
                                                                    return 1;
                                                            } else if (self_mp >= 75) {
                                                                    DdA();
                                                                    print("target facing right; move right; using strafe");
                                                                    return 1;
                                                            }
                                                            A();
                                                            print("target facing right; move right; punch");
                                                            return 1;
                                                    }
                                            } else {
                                                    print("self facing left");
                                                    if (target_facing == 1) {
                                                            left(); // move towards target
                                                            print("target facing left; moving left");
                                                            return 1;
                                                    } else {
                                                            if (self_mp >= 225) {
                                                                    DuA();
                                                                    print("target facing right; move right; using dragon punch");
                                                                    return 1;
                                                            } else if (self_mp >= 75) {
                                                                    DdA();
                                                                    print("target facing right; move right; using strafe");
                                                                    return 1;
                                                            }
                                                            A();
                                                            print("target facing right; move right; punch");
                                                            return 1;
                                                    }
                                            }
 
                                    } else {
                                            if (self_facing == 1) {
                                                    if (target_facing == 1) {
                                                            A();
                                                            return 1;
                                                    } else {
                                                            D();
                                                            return 1;
                                                    }
                                            } else {
                                                    if (target_facing == 1) {
                                                            left(); // turn around
                                                            return 1;
                                                    } else {
                                                            // dodge
                                                            if (target_z > self_z) {
                                                                    up();
                                                            } else {
                                                                    down();
                                                            }
                                                            right();
                                                            return 1;
                                                    }
                                            }
                                    }
                            } else {
                                    left();
                                    D();
                                    return 1;
                            }
                    } else if (target_state == 4) { // normal
                            left();
                            A();
                            return 1;
                    }
 
            }
 
    }
 
    return 0;


My Davis AI:
    C-Code:
//define variables
var sfac = 2*self_facing-1              //own direction (-1: left, 1: right)
var tfac = 2*target_facing-1           //target direction (-1: left, 1: right)
var bfac = self_facing+target_facing-1//both facing (-1: left, 0: against, 1: right)
var stxd = self_x-target_x           //x distance (left > 0 > right)
var styd = self_y-target_y          //y distance (above > 0 > below)
var stzd = abs(self_z-target_z)    //z distance
var dist = stxd*sfac              //directional distance
var test = 0 //0: no testing, 1: defensive, 2: open, 3: offensive, 4: passive
 
//no mp combo
if (dist >= 0 && target_state == 12 && styd > 60 && styd < 90){
 if (self_state <= 1){if (stxd > 0){left()}else {right()};return 1}//run
 else if (self_state == 2){A();return 1}                           //attack
}
//combo breaker
if (test != 4 && stzd < 10 && dist < 75 && dist >= -5 && target_y == 0 && (self_frame == 111 || self_state == 8 || self_state == 11 || self_state == 16)){
 if (self_mp >= 225 && self_frame != 111){DuA()}else if (self_mp >= 75 && self_frame == 111){DdA()}else if (test <= 1){D()};return 1
}//flip
else if ((self_frame == 182 || self_frame == 188) && test != 4){
 if (target_frame == 301 || target_frame == 290 || target_frame == 291 || target_frame == 292 || target_frame == 75){J()}
}//dash, roll
else if (self_frame == 215 && self_bdefend >= 20 && test != 4){
 if (dist > 0){J()}else {D()}
}
 
//facing
if (bfac != 0 && self_state == 7 && stzd < 10 && target_y == 0 && test != 4){//defense
 if (sfac < 0){left()}else {right()}//turn
}
else if (stzd < 10 && dist < 0 && self_state != 1 && self_state != 7 && test != 4){//normal
 if (stxd > 0){left()}else {right()}//turn
}
 
//defending
if (stzd < 10 && self_state != 7 && target_state == 3 && abs(dist) < 100 && target_y == 0 && test <= 1){
 D()
}//combos
else if (stzd < 10 && dist < 70 && dist >= -5 && test != 4){
 if (target_hp > 0 && target_hp <= 114 && self_mp >= 225 && target_state != 12 && target_state != 7){DuA();return 1}//finisher
 else if (self_frame == 39 && target_state == 12){J();return 1}                                                     //super combo
 else if ((self_frame == 278 || self_frame == 279) && target_mp >= 225 && target_shake > 0){DuA();return 1}         //safe combo
 else if (target_state == 16 && self_mp >= 210 && self_state == 0 && dist > 40){if (stxd > 0){left()}else {right()};return 1}//grab
 else if ((target_state == 16 || target_state == 8) && self_mp >= 150){DdA();return 1}                              //starter
 else if ((self_frame == 281 || self_frame == 282) && target_state == 12){if (self_mp >= 450){DuA();return 1}       //doubleDstart
  else if (self_mp >= 100){J();return 1}else if (stxd > 0){left()}else {right()};return 1}                          //low mp start
 else if (target_hp > 0 && target_state == 12 && styd > 90 && self_frame == 215 && self_mp >= 225){DuA();return 1}  //double dragon
 else if ((target_frame == 181 || target_frame == 187) && target_hp > 0 && self_mp >= 225){DuA();return 1}          //fall dragon
}
 
//opportunities
if (self_state == 5 || self_state == 9 || (self_frame == 292 && styd < 7)){//dash,grab,leap attack
 if (target_hp <= 138 && self_state == 9 && self_mp >= 300){DuA()}         //finisher
 else if (target_hp <= 114 && self_state == 9 && self_mp >= 225){DuA()}    //finisher
 else {A()};return 1}                                                      //attack
else if (self_frame == 292 || self_frame == 87){return 1}                  //wait
 
//void unwanted inputs
if (self_DrA >= 2 || self_DlA >= 2 || self_DuA >= 2 || self_DdA >= 2 || self_DuJ >= 2){
 if (self_z - target_z < 0){down()}else {up()}
}
//test control
if (test == 1 || test == 2 || test == 4){//defensive, open, passive
 if (stzd > 5){if (self_z - target_z < 0){down()}else {up()}}  //zfollow
 if (abs(stxd) > 100){if (stxd > 0){left()}else {right()}}     //xfollow
 else if (self_state == 2){if (stxd < 0){left()}else {right()}}//stop
 return 1
}
else if (test == 3){                                      //offensive
 if (self_state == 0){A()}                                //attack
 if (self_state == 2){if (stxd < 0){left()}else {right()}}//stop
 return 1
}
else {return 0}//free


A little explanation on those two:
While I had basically worked all week on mine Azriel only took the last day for it, that's why mine pretty much gets straight wins all the time. However mine still has about 4 flaws left and is only optimized for fighting another Davis (I have yet to make it counter other characters and maybe even do some crowd control and tactic running away so it can maybe get through some stages on its own).

Have fun with those! Write your own!

LF2 Recordings of the 5 Matches:
Reply
Thanks given by:
#2
that was cool, esp the discussion. gonna keep working on it tonight, and try to get an ai that can actually fight close range =d, and also gonna try make the code look neater.



Azriel~
Reply
Thanks given by:
#3
im sorry but the quality was too bad and screen kept buffering that i didnt have the patience to watch :P
[Image: Blaze340.gif]
Reply
Thanks given by:
#4
Either YinYin or I will reupload it to youtube or something. YinYin is noob at streaming :p.

I didn't bother watching it either :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: LutiChris
#5
hm, there's no forum for ai, (maybe this be in a new thread in lf2 general) but anyways, reworked my ai, and pitted it against itself. this is what i got:




Azriel~
Reply
Thanks given by: Alblaka , mfc
#6
When is the original video going to be uploaded in watchable quality?
I'm highly interested in this, but unfortunately I don't have the software to try this out myself right now :(By the way, YinYin really must really be awful at streaming. Besides having like 0,02 fps, the video also just shows each fiftieth frame or so. :DAzriel, what makes the red Davis suddenly change his behavior?
Reply
Thanks given by:
#7
>> Azriel, what makes the red Davis suddenly change his behavior?
the distance limit must've changed (went past 275 pixels? i think). otherwise it was the original ai that pressed the jump

btw, my new ai for davis (compatible up to version 0.6). works much better than the old one.
    C-Code:
// === classifiers === //
var CLOSE_RANGE = 0;
var MID_RANGE = 1;
var LONG_RANGE = 2;
var OUT_OF_RANGE = 3;
 
// === environment === //
var xRange = self_x - target_x;
var yRange = self_y - target_y;
var zRange = self_z - target_z;
var facingSameDir = (self_facing == target_facing);
var facingTarget; // whether self is facing the target
 
// === function pointers === //
var approachTargetX;
var departTargetX;
var approachXKeyState;
var departXKeyState;
 
var approachTargetZ;
var departTargetZ;
 
var moveForward;	// if facing right, right();
var moveBackward;	// if facing right, left();
 
// === setup environment === //
if ((self_facing == 0 && xRange < 0) || (self_facing == 1 && xRange > 0)) {
	// facing right and standing to the left of target OR
	// facing left and standing to the right of target
	facingTarget = true;
} else { 
	facingTarget = (self_facing == target_facing);
}
 
// === setup functions === //
// setup x commands
if (xRange <= 0) {
	approachTargetX = right;
	departTargetX = left;
	approachXKeyState = self_right;
	departXKeyState = self_left;
} else {
	approachTargetX = left;
	departTargetX = right;
	approachXKeyState = self_left;
	departXKeyState = self_right;
}
 
// setup z commands
if (zRange <= 0) {
	approachTargetZ = down;
	departTargetZ = up;
} else {
	approachTargetZ = up;
	departTargetZ = down;
}
 
// setup forward/backward
if (self_facing == 0) { // facing right
	moveForward = right;
	moveBackward = left;
} else {
	moveForward = left;
	moveBackward = right;
}
 
// === utility functions === //
def classifyXDistance(xDistance) {
	var absXDistance = abs(xDistance);
	if (absXDistance < 50) { return 0; }
	if (absXDistance < 150) { return 1; }
	if (absXDistance < 275) { return 2; }
	return 3;
}
 
def classifyZDistance(zDistance) {
	var absZDistance = abs(zDistance);
	if (absZDistance <= 16) { return 0; }
	if (absZDistance <= 27) { return 1; }
	if (absZDistance <= 45) { return 2; }
	return 3;
}
 
def isDragonPunchProbable(targetMp, targetState, targetFrame) {
	if (targetMp < 225) {
		return false;
	}
	if (targetState == 11 || targetState == 16 || targetFrame == 300) {
		return true;
	}
	return false;
}
 
// === low level ai functions === //
// walkApproachTargetX(approachTargetX, approachXKeyState);
def walkApproachTargetX(approachXFunction, xKeyState) {
	if (xKeyState == 0) {
		approachXFunction();
	}
}
 
// walkDepartTargetX(departTargetX, departXKeyState);
def walkDepartTargetX(departXFunction, xKeyState) {
	if (xKeyState == 0) {
		departXFunction();
	}
}
 
// runApproachTargetX(approachTargetX, approachXKeyState);
def runApproachTargetX(approachXFunction, xKeyState) {
	if (xKeyState == 0) {
		approachXFunction();
	}
}
 
// runApproachTarget(approachTargetX, approachXKeyState, approachTargetZ);
def runApproachTarget(approachXFunction, xKeyState, approachZFunction) {
	runApproachTargetX(approachXFunction, xKeyState);
	approachZFunction();
}
 
// runDepartTargetX(departTargetX, departXKeyState);
def runDepartTargetX(departXFunction, xKeyState) {
	if (xKeyState == 0) {
		departXFunction();
	}
}
 
// dashApproachTargetX(approachTargetX, approachXKeyState, self_state);
def dashApproachTargetX(approachXFunction, xKeyState, char_state) {
	runApproachTargetX(approachXFunction, xKeyState);
	if (char_state == 2) {
		J();
	}
}
 
// dashDepartTargetX(departTargetX, departXKeyState, self_state);
def dashDepartTargetX(departXFunction, xKeyState, char_state) {
	runDepartTargetX(departXFunction, xKeyState);
	if (char_state == 2) {
		J();
	}
}
 
// dashApproachTarget(approachTargetX, approachXKeyState, approachTargetZ, self_state);
def dashApproachTarget(approachXFunction, xKeyState, approachZFunction, char_state) {
	runApproachTargetX(approachXFunction, xKeyState);
	approachZFunction();
	if (char_state == 2) {
		J();
		return 1;
	}
	return 0;
}
 
// dashDepartTarget(departTargetX, departXKeyState, departTargetZ, self_state);
def dashDepartTarget(departXFunction, xKeyState, departZFunction, char_state) {
	runDepartTargetX(departXFunction, xKeyState);
	departZFunction();
	if (char_state == 2) {
		J();
		return 1;
	}
	return 0;
}
 
// === mid level ai functions === //
// selectiveApproachTargetX(approachTargetX, approachXKeyState, self_state, xRange);
def selectiveApproachTargetX(approachXFunction, xKeyState, char_state, xDistance) {
	var xDistanceClass = classifyXDistance(xDistance);
	if (xDistanceClass <= 1) { return 0; } //walkApproachTargetX(approachXFunction, xKeyState);
	else if (xDistanceClass == 2) { runApproachTargetX(approachXFunction, xKeyState); }
	else { dashApproachTargetX(approachXFunction, xKeyState, char_state); }
}
 
// selectiveApproachTarget(approachTargetX, approachTargetZ, approachXKeyState, self_state, xRange, zRange);
def selectiveApproachTarget(approachXFunction, approachZFunction, xKeyState, char_state, xDistance, zDistance) {
	selectiveApproachTargetX(approachXFunction, xKeyState, char_state, xDistance);
	approachZFunction();
}
 
// === mid-high level ai functions === //
// runAttackTarget(approachTargetX, approachXKeyState, approachTargetZ, self_state);
def runAttackTarget(approachXFunction, xKeyState, approachZFunction, char_state) {
	if (char_state == 3) {
		return 1;
	}
	runApproachTarget(approachXFunction, xKeyState, approachZFunction);
	if (char_state == 2) {
		A();
		return 1;
	}
	return 0;
}
 
// runSelectiveAttackTarget(approachTargetX, approachXKeyState, approachTargetZ, self_state, xRange, self_mp);
def runSelectiveAttackTarget(approachXFunction, xKeyState, approachZFunction, char_state, char_mp, xDistance, needsEvasion) {
	if (char_state == 3) {
		return 1;
	}
	runApproachTarget(approachXFunction, xKeyState, approachZFunction);
	if (char_state == 2) {
		if (xDistance <= 80) {
			if (char_mp >= 225) {
				DuA();
			} else if (char_mp >= 75 && needsEvasion == false) {
				DdA();
			} else {
				D();
			}
		}		
		else {
			if (char_mp < 150) {
				A();
			}
 
			// otherwise we wait so we can do a special move
		}
 
		return 1;
	}
	return 0;
}
 
// dashAttackTarget(approachTargetX, approachXKeyState, approachTargetZ, self_state);
def dashAttackTarget(approachXFunction, xKeyState, approachZFunction, char_state) {
	if (char_state == 5) {
		approachXFunction();
		approachZFunction();
		A();
		return 1;
	}
	return dashApproachTarget(approachXFunction, xKeyState, approachZFunction, char_state);
}
 
// === variables === //
/* 
 * Commands
 * 0 means no input for that command has been issued.
 */
var defensiveCommand = 0;
var xRangeClass = classifyXDistance(xRange);
var zRangeClass = classifyZDistance(zRange);
var probableDragonPunch = isDragonPunchProbable(target_mp, target_state, target_frame);
 
// === attack chains === //
// ending frame of strafe
if (self_frame == 281) {
	if (target_state == 12 && target_frame >= 180) {
		J();
		return 1;
	}
}
 
// jump_hit (D^J) frame
if (self_frame == 292) {
	// make sure they are not "rowing"
	if ( (target_state != 6 && target_y - 12 > self_y) || self_y > -25) {
		A();
	}
	return 1;
}
 
// === evasion/defensive === //
// caught move-breaker (doesn't work for davis since his jump attack takes so long)
if (self_state == 10) {
	// A();
	// return 1;
}
 
// try to block hits
if (self_state == 11 || self_state == 16) {
	if (self_mp >= 225) {
		DuA();
	} else if (self_mp >= 75) {
		DdA();
	} else {
		D();
	}
}
 
// close range
if (zRangeClass == 0 && xRangeClass == 0) {
 
	if (self_frame == 110 && self_shake > 0) {
		DdA();
		return 1;
	}
 
	if (self_weapon_type == 6) {
		if (self_state == 17) {
			D();
			return 1;
		} else {
			return dashAttackTarget(approachTargetX, approachXKeyState, approachTargetZ, self_state);
		}
	}
 
	if (target_state == 8) { // broken defense
		DdA();
		return 1;
	} else if (target_state == 16) { // DoP
		if (abs(xRange) < 7) {
			departTargetX();
		} else {
			approachTargetX();
		}
		return 1;
	} else if (target_state == 10) { // caught
		A();
		return 1;
	} else if (target_state == 11) { // injured
		if (target_mp >= 225) {
			DuA();
		} else if (target_fall <= 40) {
			A();
		} else {
			DdA();
		}
		return 1;
	} else if (target_state == 12) { // falling
		if (self_mp >= 225 && self_state <= 2) {
			DuA();
			return 1;
		}
	} else if (target_state <= 3 || target_mp >= 225 || target_DuA == 3) {
		if (target_frame < 270 || target_frame > 282) {
 
			if (target_frame >= 303 && self_state != 12) {
 
				// attempt to counter dragon punch
				if (self_facing == target_facing) {
					moveForward();
					if (self_mp >= 225) {
						DuA();
						return 1;
					} else if (self_mp >= 75 && target_frame >= 304) {
						DdA();
						return 1;
					}
					return runSelectiveAttackTarget(approachTargetX, approachXKeyState, approachTargetZ, self_state, self_mp, xRange, false);
				} else {
					moveBackward(); // face same way as target
					return 1;
				}
			} else {
				if (self_facing == target_facing) {
					approachTargetX();
					if (self_frame < 85 && self_frame >= 90) { // not run attack
						A();
					}
					return 1;
				} else {
					if (facingTarget) {
						if (target_state == 3 || probableDragonPunch) {
							D();
						} else {
							// attack only if not already attacking (don't want to cancel run attack)
							if (self_state != 3) {
								A();
							} else if (self_state == 2) {
								return runSelectiveAttackTarget(approachTargetX, approachXKeyState, approachTargetZ, self_state, self_mp, xRange, probableDragonPunch);
							}
						}
					} else {
						if (probableDragonPunch) {
							approachTargetX();
							D();
						} else {
							// dodge
							departTargetZ();
							departTargetX();
						}
					}
					return 1;
				}
			}
		} else {
			dashDepartTarget(departTargetX, departXKeyState, departTargetZ, self_state);
			D();
			return 1;
		}
	} else if (target_state == 4) {
		return runSelectiveAttackTarget(approachTargetX, approachXKeyState, approachTargetZ, self_state, self_mp, xRange, false);
	}
} else if (zRangeClass == 0 && xRangeClass == 1) {
	if (target_frame >= 303 && self_state != 12) {
 
		// attempt to counter dragon punch
		if (self_facing == target_facing) {
			moveForward();
			if (self_mp >= 225) {
				DuA();
				return 1;
			} else if (self_mp >= 75 && target_frame >= 304) {
				DdA();
				return 1;
			}
			runSelectiveAttackTarget(approachTargetX, approachXKeyState, approachTargetZ, self_state, self_mp, xRange, false);
		} else {
			moveBackward(); // face same way as target
			return 1;
		}
	} else {
 
		if (self_weapon_type == 6) {
			if (self_state == 17) {
				D();
				return 1;
			} else {
				return dashAttackTarget(approachTargetX, approachXKeyState, approachTargetZ, self_state);
			}
		}
 
		if (self_facing == target_facing) {
			approachTargetX();
			if (self_frame < 85 && self_frame >= 90) { // not run attack
				A();
			}
			return 1;
		} else {
			if (facingTarget) {
				if (target_state == 3) {
					D();
				} else {
					return runSelectiveAttackTarget(approachTargetX, approachXKeyState, approachTargetZ, self_state, self_mp, xRange, probableDragonPunch);
					//runAttackTarget(approachTargetX, approachXKeyState, approachTargetZ, self_state);
				}
			} else {
				if (probableDragonPunch) {
					approachTargetX();
					D();
				} else {
					// dodge
					departTargetZ();
					departTargetX();
				}
			}
			return 1;
		}
	}
} else if ( zRangeClass == 1 && (xRangeClass == 1 || xRangeClass == 2)) {
	if (self_weapon_type == 6) {
		if (self_state == 17) {
			D();
			return 1;
		} else {
			return dashAttackTarget(approachTargetX, approachXKeyState, approachTargetZ, self_state);
		}
	}
	return dashAttackTarget(approachTargetX, approachXKeyState, approachTargetZ, self_state);
} else if (zRangeClass <= 2 && xRangeClass >= 2) {
	//runApproachTargetX(approachTargetX, approachXKeyState);
	approachTargetX();
	departTargetZ();
} else {
	selectiveApproachTarget(approachTargetX, approachTargetZ, approachXKeyState, self_state, xRange, zRange);
}
 
return 0;




Azriel~
Reply
Thanks given by:
#8
I blame the bad quality on the sh**** software
it just isn't made for streaming games i guess (or my graphics card doesn't like it)
because notice how smooth all mouse and window movement actions are ... - while the game screen only updates every 10 seconds!
gosh
and this when i even told the screen recorder to only capture the lf2 application

anyway both my computer and upload speed should not be the problem as i can easily record gameplay at full resolution and the stream of my screen was fluent as you can see from the mouse movement ...

i got about 3 other programs to try, maybe they will do the job better next time
if not we really need someone else to stream these matches (+ have a poll beforehand to find out at what time most would actually watch this live - it didnt seem like we had many/any watching my fail stream as it was getting recorded)

i don't really have the time and patience to re record the matches soon so i send the files to silva

... and now its time to see how much your AI has improved azzy :D
edit: hell yes, lots of dash attacks - thats what i expected from you on the first match
these matches are much more thrilling - still i think yours isnt better than mine yet
you actually sometimes waste a dragon punch directly from running when the opponent isnt even close enough

edit: a tip for your isDragonPunchProbable:
if (self_hp <= 114 && target_mp >= 225) {
return true;
}
because my davis is an opportunistic a**hole
Reply
Thanks given by:
#9
They are getting uploaded very slowly 1 by one. They'll be here:

http://www.youtube.com/watch?v=Xc01ZY0sK...e=youtu.be (thats the link to the first one then just go and look through my other videos for the other fights)

[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:
#10
okay i included all 5 matches in the first post
Reply
Thanks given by:




Users browsing this thread: 2 Guest(s)