2016.06.2309:55

AI 双打部分浅谈

Episode 9 双打部分浅谈

一个比较完整的AI,是要包含双打部分的,里面的概念其实很好理解,队友被打了你看情况去救队友,其中比较远程的话可以大跳或者突进过去救,如果你有飞行道具就出飞行道具技能去救队友,再比如还有队友在打对面两个对手的时候,你去补刀,队友把两个敌人拉了个P2,你可以做一个蓄气的动作来给己方攒气,或者你也可以装逼出个嘲讽啥的,反正用法很多,自己按照实际来理解

下面切入正题,今天用到两个var来记录全部双打情况,var(51)和var(52),如果被占用了就换别的

;━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
; タッグ用 ;TAG(双打模式)下使用
;━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[State -3, 敵が1人] ;对手只有1个人的情况,有两种情况,对手有队友但是队友死了,也可能是本来就1个人
Type = VarSet
Trigger1 = NumEnemy != 2
Trigger2 = !(EnemyNear(0),Alive && EnemyNear(1),Alive)
V = 51
Value = 0

[State -3, 敵が2人かつ前方のみ] ;两个敌人都在你面前的情况
Type = VarSet
TriggerAll = NumEnemy = 2
TriggerAll = EnemyNear(0),Alive
TriggerAll = EnemyNear(1),Alive
Trigger1 = ifelse(Facing = 1,EnemyNear(0),Pos X - Pos X > 0,EnemyNear(0),Pos X - Pos X < 0)
Trigger1 = ifelse(Facing = 1,EnemyNear(1),Pos X - Pos X > 0,EnemyNear(1),Pos X - Pos X < 0)
V = 51
Value = 1

[State -3, 自分、パートナー、敵、敵] ;场上4人分布情况从左到右:自己,队友,两位敌人
Type = VarSet
TriggerAll = NumEnemy = 2
TriggerAll = NumPartner
TriggerAll = EnemyNear(0),Alive
TriggerAll = EnemyNear(1),Alive
TriggerAll = Partner,Alive
Trigger1 = ifelse(Facing = 1,EnemyNear(0),Pos X - Pos X > 0,EnemyNear(0),Pos X - Pos X < 0)
Trigger1 = ifelse(Facing = 1,EnemyNear(1),Pos X - Pos X > 0,EnemyNear(1),Pos X - Pos X < 0)
Trigger1 = ifelse(Facing = 1,EnemyNear(0),Pos X - Partner,Pos X > 0,EnemyNear(0),Pos X - Partner,Pos X < 0)
Trigger1 = ifelse(Facing = 1,EnemyNear(1),Pos X - Partner,Pos X > 0,EnemyNear(1),Pos X - Partner,Pos X < 0)
V = 51
Value = 2

[State -3, 自分、敵、パートナー、敵] ;分布情况:自己,敌人,队友,敌人,此时队友可能有危险,因为队友被两个敌人夹住了
Type = VarSet
TriggerAll = NumEnemy = 2
TriggerAll = NumPartner
TriggerAll = EnemyNear(0),Alive
TriggerAll = EnemyNear(1),Alive
TriggerAll = Partner,Alive
Trigger1 = ifelse(Facing = 1,EnemyNear(0),Pos X - Pos X > 0,EnemyNear(0),Pos X - Pos X < 0)
Trigger1 = ifelse(Facing = 1,EnemyNear(1),Pos X - Pos X > 0,EnemyNear(1),Pos X - Pos X < 0)
Trigger1 = ifelse(Facing = 1,EnemyNear(0),Pos X - Partner,Pos X < 0,EnemyNear(0),Pos X - Partner,Pos X > 0)
Trigger1 = ifelse(Facing = 1,EnemyNear(1),Pos X - Partner,Pos X > 0,EnemyNear(1),Pos X - Partner,Pos X < 0)
V = 51
Value = 3

[State -3, 自分、敵、敵、パートナー] ;分布情况:自己,两位敌人,队友,此时为优势
Type = VarSet
TriggerAll = NumEnemy = 2
TriggerAll = NumPartner
TriggerAll = EnemyNear(0),Alive
TriggerAll = EnemyNear(1),Alive
TriggerAll = Partner,Alive
Trigger1 = ifelse(Facing = 1,EnemyNear(0),Pos X - Pos X > 0,EnemyNear(0),Pos X - Pos X < 0)
Trigger1 = ifelse(Facing = 1,EnemyNear(1),Pos X - Pos X > 0,EnemyNear(1),Pos X - Pos X < 0)
Trigger1 = ifelse(Facing = 1,EnemyNear(0),Pos X - Partner,Pos X < 0,EnemyNear(0),Pos X - Partner,Pos X > 0)
Trigger1 = ifelse(Facing = 1,EnemyNear(1),Pos X - Partner,Pos X < 0,EnemyNear(1),Pos X - Partner,Pos X > 0)
V = 51
Value = 4

[State -3, 背後に敵有り] ;这个就比较尴尬了,背后有敌人的情况,通常背后有敌人的情况就代表你前面还有一个敌人,也就是说你被两位敌人卡住了(苦笑)
Type = VarSet
TriggerAll = NumEnemy = 2
TriggerAll = EnemyNear(0),Alive
TriggerAll = EnemyNear(1),Alive
Trigger1 = ifelse(Facing = 1,EnemyNear(0),Pos X - Pos X < 0,EnemyNear(0),Pos X - Pos X > 0)
Trigger2 = ifelse(Facing = 1,EnemyNear(1),Pos X - Pos X < 0,EnemyNear(1),Pos X - Pos X > 0)
V = 51
Value = 5

;---------------------------------------------------------------------------
[State -3, パートナー不在] ;双打模式,但是队友不在或者队友已经死亡
Type = VarSet
TriggerAll = TeamMode = Simul
Trigger1 = !NumPartner
Trigger2 = !Partner,Alive
V = 52
Value = 0

[State -3, パートナー後衛] ;双打模式下队友在你后面当后卫
Type = VarSet
TriggerAll = TeamMode = Simul
TriggerAll = NumPartner
TriggerAll = Partner,Alive
Trigger1 = ifelse(Facing = 1,Partner,Pos X - Pos X < 0,Partner,Pos X - Pos X > 0)
V = 52
Value = 1

[State -3, パートナー前衛] ;双打模式队友给你当前锋
Type = VarSet
TriggerAll = TeamMode = Simul
TriggerAll = NumPartner
TriggerAll = Partner,Alive
Trigger1 = ifelse(Facing = 1,Partner,Pos X - Pos X > 0,Partner,Pos X - Pos X < 0)
V = 52
Value = 2

[State -3, パートナー被ダメージ] ;双打模式下队友被打,而且这里代表的是普通的被打或者被打防御的状态,可以救
Type = VarSet
TriggerAll = TeamMode = Simul
TriggerAll = NumPartner
TriggerAll = Partner,Alive
TriggerAll = Partner,MoveType = H
TriggerAll = ifelse(Facing = 1,Partner,Pos X - Pos X > 0,Partner,Pos X - Pos X < 0)
Trigger1 = Partner,StateNo = [5000,5100)
Trigger2 = Partner,StateNo = [120,159]
V = 52
Value = 3

[State -3, パートナー攻撃中] ;队友在打敌人的情况,近敌显示被打
Type = VarSet
TriggerAll = TeamMode = Simul
TriggerAll = NumPartner
TriggerAll = Partner,Alive
TriggerAll = Partner,MoveType = A
TriggerAll = Partner,MoveType != H
TriggerAll = EnemyNear(var(58)),MoveType = H
TriggerAll = ifelse(Facing = 1,Partner,Pos X - Pos X > 0,Partner,Pos X - Pos X < 0)
Trigger1 = EnemyNear(var(58)),StateNo = [5000,5100)
V = 52
Value = 4

[State -3, パートナー被ステート奪取] ;这个比较危险,因为是队友被抓了个P2,这个时候如果你有波的话就发波吧,最好别靠近对手,说不定你也会被卷进去
Type = VarSet
TriggerAll = TeamMode = Simul
TriggerAll = NumPartner
TriggerAll = Partner,Alive
TriggerAll = Partner,MoveType = H
TriggerAll = ifelse(Facing = 1,Partner,Pos X - Pos X > 0,Partner,Pos X - Pos X < 0)
Trigger1 = Partner,StateNo != [5000,5500]
Trigger1 = Partner,StateNo != [120,159]
V = 52
Value = 5

[State -3, パートナーステート奪取] ;队友给别人拉了个P2,此时为近敌被拉P2的状态
Type = VarSet
TriggerAll = TeamMode = Simul
TriggerAll = NumPartner
TriggerAll = Partner,Alive
TriggerAll =(Partner,StateNo = [2000,4999]) || Partner,StateNo > 5500
Trigger1 = EnemyNear(var(58)),MoveType = H
Trigger1 = EnemyNear(var(58)),StateNo != [5000,5500]
Trigger1 = EnemyNear(var(58)),StateNo != [120,159]
V = 52
Value = 6

好了先记下来这么多,接下来要怎么用呢

举个例子:比如说你要装逼对吧,我们就说195,挑衅这个动作,什么时候用呢?

考虑下情况,肯定是两个对手都被打,而且都被拉了P2,首先要考虑到的肯定是var(52) = 6的情况

;装逼装逼装逼
[State -3, Taunt]
Type = ChangeState
Value = 195
TriggerAll = var(59) = 1
TriggerAll = StateNo != 195 && PrevStateNo != 195 ;因为有些人195是带ctrlset的,而且不要和前一个动作重复
TriggerAll = RoundState = 2 && EnemyNear(var(58)),Life > 0
TriggerAll = Random <= 150 ;概率你可以自己定,这里是15%概率装个逼
TriggerAll = StateType != A
TriggerAll =!Enemy,NumProj ;对面没有飞行道具
TriggerAll =!InGuardDist && !Helper(31000+ID),InGuardDist ;确保是InGuarddist
TriggerAll = Ctrl || (StateNo = [20,22]) || (StateNo = [100,101]) || (StateNo = [120,149])
Trigger1 = var(52) = 6 && var(51) < 5 ;确定对手是被P2了而且不能被两位队友夹住
Trigger1 = EnemyNear(0),MoveType = H && (EnemyNear(0),StateNo != [120,159]) && (EnemyNear(0),StateNo != [5000,5100))
Trigger1 = EnemyNear(1),MoveType = H && (EnemyNear(1),StateNo != [120,159]) && (EnemyNear(1),StateNo != [5000,5100)) ;上面的2行,因为要同时确保两位敌人同时被打,近敌和远敌,分别代表0,1
Trigger1 = Abs(EnemyNear(var(58)),Pos X - Pos X) > 120; (大概距离可以自己定,Abs(EnemyNear(var(58)),Pos X - Pos X)与P2BodyDist X的换算标准是前者比后者大32)

除了装逼之外,你有可以帮助对手的东西也可以用,比如蓄气,这个换个状态号就行了,不多讲

不要成天只知道装逼,学着点去救队友和自救

先说,比如发个波去辅助队友,或者去营救

;地波
[State -3, Proj]
Type = ChangeState
Value = (地波状态号,如果你有强弱地波的话按照距离选择强弱,远了就强,稍微近一点就弱)
TriggerAll = var(59) = 1
TriggerAll = var(52) = [2,3] ; var(52) = 2代表队友给你当前锋,3代表队友在被普通的攻击
TriggerAll = var(51) < 5 ;首先要确保自己的安全,不能被夹住
TriggerAll = RoundState = 2 && EnemyNear(var(58)),life > 0
TriggerAll = Random <= 100 ;10%概率,自己可以改
TriggerAll = StateType != A
TriggerAll = NumProjID(1000) = 0
TriggerAll = EnemyNear(var(58)),StateType != A
TriggerAll = Ctrl || (StateNo = [20,22]) || (StateNo = [100,101]) || (StateNo = [120,149])
Trigger1 = P2BodyDist X >= 200 ;多远出,自己算好距离

还有一点,就是你被两位对手夹住了怎么办,如果有闪避或者AB之类的技能赶紧闪出去,因为对你来说是大劣势,以AB为例
,尽量以耗气后AB或者无敌闪避技能为主,比如原版KOF的后AB是有挺大责任的,但耗1气防御下AB就是无敌的话,那么

[State -3, 後転]
Type = ChangeState
Value = (后AB状态)
TriggerAll = var(59) = 1
TriggerAll = var(51) = 5 && (var(52) > 0 || Power >= 1000) ;你队友在的时候或者有气就AB出去,没有的话你就认命吧
TriggerAll = RoundState = 2
TriggerAll = StateType != A
Trigger1 = Ctrl || (StateNo = [20,22]) || (StateNo = [100,101]) || (StateNo = [120,149])
Trigger1 = Abs(EnemyNear(var(58)),Pos X - Pos X) <= 100 ;保持一定距离
Trigger1 = EnemyNear(var(58)),StateNo >= 1000 && !EnemyNear(var(58)),Ctrl ;对手攻击状态,通常1000以上为必杀,趁这个时候赶紧跑掉
Trigger1 = var(52) = 5 && BackEdgeBodyDist >= 40 (你和队友都被夹了,此时队友被P2了,你赶紧跑远了,别卖了自己)
Trigger2 = StateNo = 150 || StateNo = 152 ;消耗1气赶紧跑出去,不要管太多
Trigger2 = Power >= 1000 && var(42) >= 120 && BackEdgeBodyDist >= 20 ;自己背离墙角有一段距离
Trigger2 = ifelse(Facing = 1,(EnemyNear(0),Pos X - Pos X = [-100,0]),(EnemyNear(0),Pos X - Pos X = [0,100])) ;记得算好距离,facing = 1表示脸朝右边看,-1表示脸朝左边
Trigger2 = EnemyNear(0),BackEdgeBodyDist >= 40 ;敌人背离墙角有一段距离,不然你AB出不去的,AB完了还是被卡住
Trigger2 = EnemyNear(0),Facing = Facing ;背对敌人
Trigger3 = StateNo = 150 || StateNo = 152 ;同上面的道理
Trigger3 = Power >= 1000 && var(42) >= 120 && BackEdgeBodyDist >= 20
Trigger3 = ifelse(Facing = 1,(EnemyNear(1),Pos X - Pos X = [-100,0]),(EnemyNear(1),Pos X - Pos X = [0,100]))
Trigger3 = EnemyNear(1),BackEdgeBodyDist >= 40
Trigger3 = EnemyNear(1),Facing = Facing

这里提一下,enemynear,或者你用enemynear(var())这种的,只能指定近敌的动作,而不能代表2位敌人,所以判断2位敌人要用到enemynear(0)和enemynear(1),0代表近的那位,1代表远的那位

除了这些外,双打的想法还有很多的,比如创造人工墙角,可以配合相应的队友做出相应的反应,比如你知道你指定的队友哪个动作做出来了,比如知道是可以追打的P2StateNo,而且两位敌人同时被打,赶紧大跳或者闪避到对手后面去用2A点对面,总之好墙角自己造嘛蛤蛤蛤

好了,今天的课就先到这,如果您有什么问题的话可以私信我,我会第一时间给您答复,或者把问题发到我的邮箱

mizore@kotori.moe, 谢谢大家!

发表留言

秘密留言

アクセス

オンライン