翔鹰帝国网|帝国时代论坛|帝国时代系列|神话时代
 找回密码
 注册翔鹰会员(昵称)
搜索
查看: 2866|回复: 28

[交流] 我发现HD版有个大BUG!

[复制链接]

11

主题

4

精华

6914

积分

国王

耕战
755
鹰币
402254
天龙币
0
回帖
223

翔鹰建站十周年纪念章

附庸关系0
 楼主| 发表于 2019-5-2 19:59:03 | 显示全部楼层 |阅读模式
本帖最后由 凌果 于 2019-10-2 01:29 编辑

该说是游戏的BUG呢,还是AI的BUG呢?
简单而言就是up-jump-rule 负数,其效果跟up-jump-rule 正数是一样的!
也就是(up-jump-rule -1)等效于(up-jump-rule 1)
(up-jump-rule -2)等效于(up-jump-rule 2),以此类推。
原本up-jump-rule负数应该是循环/重复执行上面的规则才正确,然而现在变成了向下跳过规则。

拜这个BUG所赐,AI也就有问题。以HD的默认AI,Promisory.per2为例。
Promisory.per2共有3处up-jump-rule 负数,都与sn-focus-player-number有关,从而导致这三处本该循环的规则仅执行了sn-focus-player-number == 1的部分。且更重要的是使得这三处以外绝大部分的sn-focus-player-number都固定为2。

从而数百条应用focus-player这个百搭参数的条目都仅针对玩家2。(只有少部分例外,约5000~15000行和约30000行后的sn-focus-player-number有被重新赋值)

本帖18楼有HD版的默认AI修正文件,含大量修正项目及列表
19楼有Notepad++用的帝国2AI编辑语法高亮方案
_(¦3[_])_
回复

使用道具 举报

11

主题

4

精华

6914

积分

国王

耕战
755
鹰币
402254
天龙币
0
回帖
223

翔鹰建站十周年纪念章

附庸关系0
 楼主| 发表于 2019-5-2 20:02:44 | 显示全部楼层
本帖最后由 凌果 于 2019-10-2 01:22 编辑

除了这个BUG以外,我还发现Promisory.per2有不少小BUG。那些都还算比较好修复。

顺便一提,即使有这个BUG存在,Promisory.per2的AI表现大部分情况下还算正常,如果不是我在玩的过程中碰到一些情况我也许都没能发现。
_(¦3[_])_
回复

使用道具 举报

29

主题

0

精华

3429

积分

公爵

耕战
347
鹰币
4043
天龙币
0
回帖
1136
附庸关系0
发表于 2019-5-2 23:02:53 | 显示全部楼层
Promi本来就是基于UserPatch编写的,移植到HD版后,官方又不好意思完全兼(chao)容(xi)UP的高级AI命令,难道对不兼容命令的处理都是这样直接跳过的?难怪HD早期版本AI经常犯傻
帝国2决定版懒人MOD+征服者1.5窃取特色单位MOD
http://www.hawkaoe.net/bbs/thread-139689-1-1.html
回复

使用道具 举报

688

主题

30

精华

8万

积分

教皇

耕战
10902
鹰币
542472
天龙币
512
回帖
7008

翔鹰建站十周年纪念章翔鹰十周年帝国Online纪念章特级帝国勋章特级翔鹰勋章特级嘉禾勋章特级皇家勋章鹰之王者雄鹰勋章第四届火箭筒杯最佳战役第五届火箭筒杯最佳战役第九届火箭筒杯最佳战役第二届战鹰杯单人赛季军第八届战鹰杯单人赛季军鸽子勋章

附庸关系12
发表于 2019-5-3 19:01:15 | 显示全部楼层
只能说HD被UP完全比下去了…照葫芦画瓢都能画错也是没谁了…
回复

使用道具 举报

21

主题

0

精华

673

积分

伯爵

耕战
29
鹰币
591
天龙币
0
回帖
238
附庸关系0
发表于 2019-5-4 20:15:02 | 显示全部楼层
本帖最后由 chifeiyen 于 2019-5-4 22:26 编辑

HD官方AI是有不少问题,我在创意工坊上发布了个修改的Mod如下:
因为本人对AI不太懂,目前主要修改了以下几项:
1.楼上大大wongyuhua对投降条件的修改,让AI不会轻易投降;
2.AI远程单位不会放风筝走位;
3.AI不会再把一群兵围绕在一个建筑周围一圈发呆(这是个Bug,非洲DLC还没有的,蛮王DLC才有,原因是蛮王开始sn-gather-defense-units策略值设置成了1,我改成0就好了)。

除了楼主说的Bug外,还有以下希望修正的问题我不知如何实现:
1.柏柏尔从来不出骆驼射手;
2.印加从来不出投石兵;
3.缅甸和马来极少出象兵;
4.意大利从不出佣兵(反而维京马里哥特会出佣兵);
5.无法让AI会用步兵驻扎进冲车(AOC原版AI是会的);
6.坐中的AI在坐边盟友被攻击时不及时给予支援。

如果各位大大有兴趣,希望可以订阅我发布的AI试着修改修改,小弟懂得不多有点力不能及。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册翔鹰会员(昵称)

x
回复

使用道具 举报

11

主题

4

精华

6914

积分

国王

耕战
755
鹰币
402254
天龙币
0
回帖
223

翔鹰建站十周年纪念章

附庸关系0
 楼主| 发表于 2019-5-4 21:47:16 | 显示全部楼层
本帖最后由 凌果 于 2019-5-4 22:53 编辑

关于1楼说到的BUG,我的修正方案是既然不能用循环,那就将其摊开来写。本应循环8次(1至8),我就分开8段来写。
总共三处有问题的地方,以下是第一处有问题的地方的原代码:
  1. (defrule
  2.         (up-timer-status one-minute-timer != timer-running)
  3. =>
  4.         (up-modify-goal math-goal s:= sn-focus-player-number)
  5.         (set-strategic-number sn-focus-player-number 1)
  6.         (set-goal allies 0)
  7.         (set-goal enemies 0))
  8. (defrule; end neg jump
  9.         (up-timer-status one-minute-timer != timer-running)
  10. (or        (players-stance focus-player ally)
  11.         (stance-toward focus-player ally))
  12.         (player-in-game focus-player)
  13. =>
  14.         (up-modify-goal allies c:+ 1))
  15. (defrule
  16.         (up-timer-status one-minute-timer != timer-running)
  17. (nor        (players-stance focus-player ally)
  18.         (stance-toward focus-player ally))
  19.         (player-in-game focus-player)
  20. =>
  21.         (up-modify-goal enemies c:+ 1))
  22. (defrule
  23.         (up-timer-status one-minute-timer != timer-running)
  24.         (strategic-number sn-focus-player-number < 8)
  25. =>
  26.         (up-modify-sn sn-focus-player-number c:+ 1)
  27.         (up-jump-rule -3))
  28. (defrule
  29.         (up-timer-status one-minute-timer != timer-running)
  30. =>
  31.         (up-modify-sn sn-focus-player-number g:= math-goal)
  32.         (up-modify-sn teambalance g:= allies)
  33.         (up-modify-sn teambalance g:- enemies)
  34.         (up-modify-sn teambalance c:max -1)
  35.         (up-modify-sn teambalance c:min 1))
复制代码

以下是我的修正方案:
  1. (defrule;改修正向上跳转第一处开始
  2.         (up-timer-status one-minute-timer == timer-running)
  3. =>
  4.         (up-jump-rule 18)
  5. )
  6. (defrule
  7.         (up-timer-status one-minute-timer != timer-running)
  8. =>
  9. ;        (up-modify-goal math-goal s:= sn-focus-player-number)
  10. ;        (set-strategic-number sn-focus-player-number 1)
  11.         (set-goal allies 0)
  12.         (set-goal enemies 0))
  13. (defrule
  14. ;        (up-timer-status one-minute-timer != timer-running)
  15. (or        (players-stance 1 ally)
  16.         (stance-toward 1 ally))
  17.         (player-in-game 1)
  18. =>
  19.         (up-modify-goal allies c:+ 1))
  20. (defrule
  21. ;        (up-timer-status one-minute-timer != timer-running)
  22. (nor        (players-stance 1 ally)
  23.         (stance-toward 1 ally))
  24.         (player-in-game 1)
  25. =>
  26.         (up-modify-goal enemies c:+ 1))
  27. ;(defrule
  28. ;        (up-timer-status one-minute-timer != timer-running)
  29. ;        (strategic-number sn-focus-player-number < 8)
  30. ;=>
  31. ;        (up-modify-sn sn-focus-player-number c:+ 1)
  32. ;        (up-jump-rule -3)
  33. ;)
  34. (defrule
  35. (or        (players-stance 2 ally)
  36.         (stance-toward 2 ally))
  37.         (player-in-game 2)
  38. =>
  39.         (up-modify-goal allies c:+ 1))
  40. (defrule
  41. (nor        (players-stance 2 ally)
  42.         (stance-toward 2 ally))
  43.         (player-in-game 2)
  44. =>
  45.         (up-modify-goal enemies c:+ 1))

  46. (defrule
  47. (or        (players-stance 3 ally)
  48.         (stance-toward 3 ally))
  49.         (player-in-game 3)
  50. =>
  51.         (up-modify-goal allies c:+ 1))
  52. (defrule
  53. (nor        (players-stance 3 ally)
  54.         (stance-toward 3 ally))
  55.         (player-in-game 3)
  56. =>
  57.         (up-modify-goal enemies c:+ 1))

  58. (defrule
  59. (or        (players-stance 4 ally)
  60.         (stance-toward 4 ally))
  61.         (player-in-game 4)
  62. =>
  63.         (up-modify-goal allies c:+ 1))
  64. (defrule
  65. (nor        (players-stance 4 ally)
  66.         (stance-toward 4 ally))
  67.         (player-in-game 4)
  68. =>
  69.         (up-modify-goal enemies c:+ 1))

  70. (defrule
  71. (or        (players-stance 5 ally)
  72.         (stance-toward 5 ally))
  73.         (player-in-game 5)
  74. =>
  75.         (up-modify-goal allies c:+ 1))
  76. (defrule
  77. (nor        (players-stance 5 ally)
  78.         (stance-toward 5 ally))
  79.         (player-in-game 5)
  80. =>
  81.         (up-modify-goal enemies c:+ 1))

  82. (defrule
  83. (or        (players-stance 6 ally)
  84.         (stance-toward 6 ally))
  85.         (player-in-game 6)
  86. =>
  87.         (up-modify-goal allies c:+ 1))
  88. (defrule
  89. (nor        (players-stance 6 ally)
  90.         (stance-toward 6 ally))
  91.         (player-in-game 6)
  92. =>
  93.         (up-modify-goal enemies c:+ 1))

  94. (defrule
  95. (or        (players-stance 7 ally)
  96.         (stance-toward 7 ally))
  97.         (player-in-game 7)
  98. =>
  99.         (up-modify-goal allies c:+ 1))
  100. (defrule
  101. (nor        (players-stance 7 ally)
  102.         (stance-toward 7 ally))
  103.         (player-in-game 7)
  104. =>
  105.         (up-modify-goal enemies c:+ 1))

  106. (defrule
  107. (or        (players-stance 8 ally)
  108.         (stance-toward 8 ally))
  109.         (player-in-game 8)
  110. =>
  111.         (up-modify-goal allies c:+ 1))
  112. (defrule
  113. (nor        (players-stance 8 ally)
  114.         (stance-toward 8 ally))
  115.         (player-in-game 8)
  116. =>
  117.         (up-modify-goal enemies c:+ 1))

  118. (defrule;改修正向上跳转第一处结束
  119.         (up-timer-status one-minute-timer != timer-running)
  120. =>
  121. ;        (up-modify-sn sn-focus-player-number g:= math-goal)
  122.         (up-modify-sn teambalance g:= allies)
  123.         (up-modify-sn teambalance g:- enemies)
  124.         (up-modify-sn teambalance c:max -1)
  125.         (up-modify-sn teambalance c:min 1))
复制代码


第二处有问题的地方:
  1. (defrule
  2.         (true)
  3. =>
  4.         (set-goal assistance no)
  5.         (up-modify-goal math-goal s:= sn-focus-player-number)
  6.         (set-strategic-number sn-focus-player-number 1))
  7. (defrule
  8.         (player-in-game focus-player); valid
  9.         (stance-toward focus-player ally)
  10.         (strategic-number sn-focus-player-number != my-player-number)
  11.         (up-allied-sn focus-player sn-target-player-number s:== sn-target-player-number)
  12.         (up-allied-goal focus-player team-coordination-goal == 1); attacking
  13.         (strategic-number sn-target-player-number >= 1)
  14.         (strategic-number sn-target-player-number <= 8)
  15. =>
  16.         (set-goal assistance yes))
  17. (defrule
  18.         (up-compare-goal assistance != yes)
  19.         (strategic-number sn-focus-player-number < 8)
  20. =>
  21.         (up-modify-sn sn-focus-player-number c:+ 1)
  22.         (up-jump-rule -2))
  23. (defrule
  24.         (true)
  25. =>
  26.         (up-modify-sn sn-focus-player-number g:= math-goal))
复制代码

修正方案:
  1. (defrule;改修正向上跳转第二处开始
  2.         (true)
  3. =>
  4.         (set-goal assistance no)
  5. ;        (up-modify-goal math-goal s:= sn-focus-player-number)
  6. ;        (set-strategic-number sn-focus-player-number 1)
  7. )
  8. (defrule
  9.         (player-in-game 1)
  10.         (stance-toward 1 ally)
  11. ;        (strategic-number sn-focus-player-number != my-player-number)
  12.         (up-compare-const my-player-number != 1)
  13.         (up-allied-sn 1 sn-target-player-number s:== sn-target-player-number)
  14.         (up-allied-goal 1 team-coordination-goal == 1)
  15.         (strategic-number sn-target-player-number >= 1)
  16.         (strategic-number sn-target-player-number <= 8)
  17. =>
  18.         (set-goal assistance yes)
  19.         (up-jump-rule 7)
  20. )
  21. (defrule
  22.         (player-in-game 2)
  23.         (stance-toward 2 ally)
  24.         (up-compare-const my-player-number != 2)
  25.         (up-allied-sn 2 sn-target-player-number s:== sn-target-player-number)
  26.         (up-allied-goal 2 team-coordination-goal == 1)
  27.         (strategic-number sn-target-player-number >= 1)
  28.         (strategic-number sn-target-player-number <= 8)
  29. =>
  30.         (set-goal assistance yes)
  31.         (up-jump-rule 6)
  32. )
  33. (defrule
  34.         (player-in-game 3)
  35.         (stance-toward 3 ally)
  36.         (up-compare-const my-player-number != 3)
  37.         (up-allied-sn 3 sn-target-player-number s:== sn-target-player-number)
  38.         (up-allied-goal 3 team-coordination-goal == 1)
  39.         (strategic-number sn-target-player-number >= 1)
  40.         (strategic-number sn-target-player-number <= 8)
  41. =>
  42.         (set-goal assistance yes)
  43.         (up-jump-rule 5)
  44. )
  45. (defrule
  46.         (player-in-game 4)
  47.         (stance-toward 4 ally)
  48.         (up-compare-const my-player-number != 4)
  49.         (up-allied-sn 4 sn-target-player-number s:== sn-target-player-number)
  50.         (up-allied-goal 4 team-coordination-goal == 1)
  51.         (strategic-number sn-target-player-number >= 1)
  52.         (strategic-number sn-target-player-number <= 8)
  53. =>
  54.         (set-goal assistance yes)
  55.         (up-jump-rule 4)
  56. )
  57. (defrule
  58.         (player-in-game 5)
  59.         (stance-toward 5 ally)
  60.         (up-compare-const my-player-number != 5)
  61.         (up-allied-sn 5 sn-target-player-number s:== sn-target-player-number)
  62.         (up-allied-goal 5 team-coordination-goal == 1)
  63.         (strategic-number sn-target-player-number >= 1)
  64.         (strategic-number sn-target-player-number <= 8)
  65. =>
  66.         (set-goal assistance yes)
  67.         (up-jump-rule 3)
  68. )
  69. (defrule
  70.         (player-in-game 6)
  71.         (stance-toward 6 ally)
  72.         (up-compare-const my-player-number != 6)
  73.         (up-allied-sn 6 sn-target-player-number s:== sn-target-player-number)
  74.         (up-allied-goal 6 team-coordination-goal == 1)
  75.         (strategic-number sn-target-player-number >= 1)
  76.         (strategic-number sn-target-player-number <= 8)
  77. =>
  78.         (set-goal assistance yes)
  79.         (up-jump-rule 2)
  80. )
  81. (defrule
  82.         (player-in-game 7)
  83.         (stance-toward 7 ally)
  84.         (up-compare-const my-player-number != 7)
  85.         (up-allied-sn 7 sn-target-player-number s:== sn-target-player-number)
  86.         (up-allied-goal 7 team-coordination-goal == 1)
  87.         (strategic-number sn-target-player-number >= 1)
  88.         (strategic-number sn-target-player-number <= 8)
  89. =>
  90.         (set-goal assistance yes)
  91.         (up-jump-rule 1)
  92. )
  93. (defrule
  94.         (player-in-game 8)
  95.         (stance-toward 8 ally)
  96.         (up-compare-const my-player-number != 8)
  97.         (up-allied-sn 8 sn-target-player-number s:== sn-target-player-number)
  98.         (up-allied-goal 8 team-coordination-goal == 1)
  99.         (strategic-number sn-target-player-number >= 1)
  100.         (strategic-number sn-target-player-number <= 8)
  101. =>
  102.         (set-goal assistance yes)
  103. )
  104. ;(defrule
  105. ;        (up-compare-goal assistance != yes)
  106. ;        (strategic-number sn-focus-player-number < 8)
  107. ;=>
  108. ;        (up-modify-sn sn-focus-player-number c:+ 1)
  109. ;        (up-jump-rule -2)
  110. ;)
  111. ;(defrule;改修正向上跳转第二处结束
  112. ;        (true)
  113. ;=>
  114. ;        (up-modify-sn sn-focus-player-number g:= math-goal))
复制代码


第三处有问题的地方:
  1. (defrule; auto-tribute - what a time to be alive
  2. (or        (building-type-count market < 1)
  3. (or        (not        (player-in-game any-ally))
  4. ;(or        (strategic-number sn-current-age < imperial)
  5. (or        (and        (food-amount < 2400)
  6.                 (and        (wood-amount < 2400)
  7.                         (gold-amount < 2400)))
  8. (or        (up-compare-goal under-attack-goal >= 1)
  9.         (up-research-status c: ri-banking < research-complete)))));)
  10. =>
  11.         (up-jump-rule 6)); 7
  12. (defrule
  13.         (true)
  14. =>
  15.         (up-modify-goal math-goal s:= sn-focus-player-number)
  16.         (set-strategic-number sn-focus-player-number 1)
  17.         (set-goal math-goal2 0))

  18. (defrule
  19.         (building-type-count market >= 1)
  20.         (food-amount >= 2400)
  21.         (players-population focus-player > 30)
  22. (or        (players-unit-type-count focus-player villager >= 20)
  23.         (players-building-type-count focus-player town-center >= 1))
  24.         (stance-toward focus-player ally)
  25.         (player-in-game focus-player)
  26.         (strategic-number sn-focus-player-number != my-player-number)
  27.         (up-allied-resource-amount focus-player food < 1000)
  28. =>
  29.         (tribute-to-player focus-player food 1000)
  30.         (chat-to-player-using-id focus-player 22077); "Here is some food!"
  31.         (chat-local-to-self "Tributing 1000 food to an ally.")
  32.         (set-goal math-goal2 1))
  33. (defrule
  34.         (building-type-count market >= 1)
  35.         (wood-amount >= 2400)
  36.         (players-population focus-player > 30)
  37. (or        (players-unit-type-count focus-player villager >= 20)
  38.         (players-building-type-count focus-player town-center >= 1))
  39.         (stance-toward focus-player ally)
  40.         (player-in-game focus-player)
  41.         (strategic-number sn-focus-player-number != my-player-number)
  42.         (up-allied-resource-amount focus-player wood < 1000)
  43. =>
  44.         (tribute-to-player focus-player wood 1000)
  45.         (chat-to-player-using-id focus-player 22076); "Here is some wood!"
  46.         (chat-local-to-self "Tributing 1000 wood to an ally.")
  47.         (set-goal math-goal2 1))
  48. (defrule
  49.         (building-type-count market >= 1)
  50.         (gold-amount >= 2400)
  51.         (players-population focus-player > 30)
  52. (or        (players-unit-type-count focus-player villager >= 20)
  53.         (players-building-type-count focus-player town-center >= 1))
  54.         (stance-toward focus-player ally)
  55.         (player-in-game focus-player)
  56.         (strategic-number sn-focus-player-number != my-player-number)
  57.         (up-allied-resource-amount focus-player gold < 1000)
  58. =>
  59.         (tribute-to-player focus-player gold 1000)
  60.         (chat-to-player-using-id focus-player 22078); "Here is some gold!"
  61.         (chat-local-to-self "Tributing 1000 gold to an ally.")
  62.         (set-goal math-goal2 1))
  63. ;(defrule
  64. ;        (building-type-count market >= 1)
  65. ;        (stone-amount >= 260)
  66. ;        (building-type-count-total castle >= 5)
  67. ;        (players-population focus-player > 30)
  68. ;(or        (players-unit-type-count focus-player villager >= 20)
  69. ;        (players-building-type-count focus-player town-center >= 1))
  70. ;        (stance-toward focus-player ally)
  71. ;        (player-in-game focus-player)
  72. ;        (strategic-number sn-focus-player-number != my-player-number)
  73. ;        (up-allied-resource-amount focus-player stone < 100)
  74. ;=>
  75. ;        (tribute-to-player focus-player stone 100)
  76. ;        (chat-to-player-using-id focus-player 22079); "Here is some stone!"
  77. ;        (chat-local-to-self "Tributing 100 stone to an ally.")
  78. ;        (set-goal math-goal2 1))
  79. (defrule
  80.         (up-compare-goal math-goal2 != 1)
  81.         (strategic-number sn-focus-player-number < 8)
  82. =>
  83.         (up-modify-sn sn-focus-player-number c:+ 1)
  84.         (up-jump-rule -4)); 5
  85. (defrule
  86.         (true)
  87. =>
  88.         (up-modify-sn sn-focus-player-number g:= math-goal)); end jump
复制代码

修正方案:
  1. (defrule;改修正向上跳转第三处开始
  2. (or        (up-timer-status tensec == timer-running)
  3. (or        (building-type-count market < 1)
  4. (or        (not        (player-in-game any-ally))
  5. (or        (and        (food-amount < 2400)
  6.         (and        (wood-amount < 2400)
  7.                 (gold-amount < 2400)))
  8. (or        (up-compare-goal under-attack-goal >= 1)
  9.         (up-research-status c: ri-banking < research-complete))))))
  10. =>
  11.         (up-jump-rule 24)
  12. )
  13. ;(defrule
  14. ;        (true)
  15. ;=>
  16. ;        (up-modify-goal math-goal s:= sn-focus-player-number)
  17. ;        (set-strategic-number sn-focus-player-number 1)
  18. ;        (set-goal math-goal2 0))
  19. (defrule
  20.         (food-amount >= 2400)
  21.         (players-population 1 > 30)
  22. (or        (players-unit-type-count 1 villager >= 20)
  23.         (players-building-type-count 1 town-center >= 1))
  24.         (stance-toward 1 ally)
  25.         (player-in-game 1)
  26. ;        (strategic-number sn-focus-player-number != my-player-number)
  27.         (up-compare-const my-player-number != 1)
  28.         (up-allied-resource-amount 1 food < 1000)
  29. =>
  30.         (tribute-to-player 1 food 1000)
  31.         (chat-to-player-using-id 1 22077); "Here is some food!"
  32.         (chat-local-to-self "Tributing 1000 food to an ally.")
  33. ;        (set-goal math-goal2 1)
  34. )
  35. (defrule
  36.         (wood-amount >= 2400)
  37.         (players-population 1 > 30)
  38. (or        (players-unit-type-count 1 villager >= 20)
  39.         (players-building-type-count 1 town-center >= 1))
  40.         (stance-toward 1 ally)
  41.         (player-in-game 1)
  42. ;        (strategic-number sn-focus-player-number != my-player-number)
  43.         (up-compare-const my-player-number != 1)
  44.         (up-allied-resource-amount 1 wood < 1000)
  45. =>
  46.         (tribute-to-player 1 wood 1000)
  47.         (chat-to-player-using-id 1 22076); "Here is some wood!"
  48.         (chat-local-to-self "Tributing 1000 wood to an ally.")
  49. ;        (set-goal math-goal2 1)
  50. )
  51. (defrule
  52.         (gold-amount >= 2400)
  53.         (players-population 1 > 30)
  54. (or        (players-unit-type-count 1 villager >= 20)
  55.         (players-building-type-count 1 town-center >= 1))
  56.         (stance-toward 1 ally)
  57.         (player-in-game 1)
  58. ;        (strategic-number sn-focus-player-number != my-player-number)
  59.         (up-compare-const my-player-number != 1)
  60.         (up-allied-resource-amount 1 gold < 1000)
  61. =>
  62.         (tribute-to-player 1 gold 1000)
  63.         (chat-to-player-using-id 1 22078); "Here is some gold!"
  64.         (chat-local-to-self "Tributing 1000 gold to an ally.")
  65. ;        (set-goal math-goal2 1)
  66. )
  67. ;(defrule
  68. ;        (building-type-count market >= 1)
  69. ;        (stone-amount >= 260)
  70. ;        (building-type-count-total castle >= 5)
  71. ;        (players-population focus-player > 30)
  72. ;(or        (players-unit-type-count focus-player villager >= 20)
  73. ;        (players-building-type-count focus-player town-center >= 1))
  74. ;        (stance-toward focus-player ally)
  75. ;        (player-in-game focus-player)
  76. ;        (strategic-number sn-focus-player-number != my-player-number)
  77. ;        (up-allied-resource-amount focus-player stone < 100)
  78. ;=>
  79. ;        (tribute-to-player focus-player stone 100)
  80. ;        (chat-to-player-using-id focus-player 22079); "Here is some stone!"
  81. ;        (chat-local-to-self "Tributing 100 stone to an ally.")
  82. ;        (set-goal math-goal2 1))
  83. (defrule
  84.         (food-amount >= 2400)
  85.         (players-population 2 > 30)
  86. (or        (players-unit-type-count 2 villager >= 20)
  87.         (players-building-type-count 2 town-center >= 1))
  88.         (stance-toward 2 ally)
  89.         (player-in-game 2)
  90.         (up-compare-const my-player-number != 2)
  91.         (up-allied-resource-amount 2 food < 1000)
  92. =>
  93.         (tribute-to-player 2 food 1000)
  94.         (chat-to-player-using-id 2 22077)
  95.         (chat-local-to-self "Tributing 1000 food to an ally.")
  96. )
  97. (defrule
  98.         (wood-amount >= 2400)
  99.         (players-population 2 > 30)
  100. (or        (players-unit-type-count 2 villager >= 20)
  101.         (players-building-type-count 2 town-center >= 1))
  102.         (stance-toward 2 ally)
  103.         (player-in-game 2)
  104.         (up-compare-const my-player-number != 2)
  105.         (up-allied-resource-amount 2 wood < 1000)
  106. =>
  107.         (tribute-to-player 2 wood 1000)
  108.         (chat-to-player-using-id 2 22076)
  109.         (chat-local-to-self "Tributing 1000 wood to an ally.")
  110. )
  111. (defrule
  112.         (gold-amount >= 2400)
  113.         (players-population 2 > 30)
  114. (or        (players-unit-type-count 2 villager >= 20)
  115.         (players-building-type-count 2 town-center >= 1))
  116.         (stance-toward 2 ally)
  117.         (player-in-game 2)
  118.         (up-compare-const my-player-number != 2)
  119.         (up-allied-resource-amount 2 gold < 1000)
  120. =>
  121.         (tribute-to-player 2 gold 1000)
  122.         (chat-to-player-using-id 2 22078)
  123.         (chat-local-to-self "Tributing 1000 gold to an ally.")
  124. )

  125. (defrule
  126.         (food-amount >= 2400)
  127.         (players-population 3 > 30)
  128. (or        (players-unit-type-count 3 villager >= 20)
  129.         (players-building-type-count 3 town-center >= 1))
  130.         (stance-toward 3 ally)
  131.         (player-in-game 3)
  132.         (up-compare-const my-player-number != 3)
  133.         (up-allied-resource-amount 3 food < 1000)
  134. =>
  135.         (tribute-to-player 3 food 1000)
  136.         (chat-to-player-using-id 3 22077)
  137.         (chat-local-to-self "Tributing 1000 food to an ally.")
  138. )
  139. (defrule
  140.         (wood-amount >= 2400)
  141.         (players-population 3 > 30)
  142. (or        (players-unit-type-count 3 villager >= 20)
  143.         (players-building-type-count 3 town-center >= 1))
  144.         (stance-toward 3 ally)
  145.         (player-in-game 3)
  146.         (up-compare-const my-player-number != 3)
  147.         (up-allied-resource-amount 3 wood < 1000)
  148. =>
  149.         (tribute-to-player 3 wood 1000)
  150.         (chat-to-player-using-id 3 22076)
  151.         (chat-local-to-self "Tributing 1000 wood to an ally.")
  152. )
  153. (defrule
  154.         (gold-amount >= 2400)
  155.         (players-population 3 > 30)
  156. (or        (players-unit-type-count 3 villager >= 20)
  157.         (players-building-type-count 3 town-center >= 1))
  158.         (stance-toward 3 ally)
  159.         (player-in-game 3)
  160.         (up-compare-const my-player-number != 3)
  161.         (up-allied-resource-amount 3 gold < 1000)
  162. =>
  163.         (tribute-to-player 3 gold 1000)
  164.         (chat-to-player-using-id 3 22078)
  165.         (chat-local-to-self "Tributing 1000 gold to an ally.")
  166. )

  167. (defrule
  168.         (food-amount >= 2400)
  169.         (players-population 4 > 30)
  170. (or        (players-unit-type-count 4 villager >= 20)
  171.         (players-building-type-count 4 town-center >= 1))
  172.         (stance-toward 4 ally)
  173.         (player-in-game 4)
  174.         (up-compare-const my-player-number != 4)
  175.         (up-allied-resource-amount 4 food < 1000)
  176. =>
  177.         (tribute-to-player 4 food 1000)
  178.         (chat-to-player-using-id 4 22077)
  179.         (chat-local-to-self "Tributing 1000 food to an ally.")
  180. )
  181. (defrule
  182.         (wood-amount >= 2400)
  183.         (players-population 4 > 30)
  184. (or        (players-unit-type-count 4 villager >= 20)
  185.         (players-building-type-count 4 town-center >= 1))
  186.         (stance-toward 4 ally)
  187.         (player-in-game 4)
  188.         (up-compare-const my-player-number != 4)
  189.         (up-allied-resource-amount 4 wood < 1000)
  190. =>
  191.         (tribute-to-player 4 wood 1000)
  192.         (chat-to-player-using-id 4 22076)
  193.         (chat-local-to-self "Tributing 1000 wood to an ally.")
  194. )
  195. (defrule
  196.         (gold-amount >= 2400)
  197.         (players-population 4 > 30)
  198. (or        (players-unit-type-count 4 villager >= 20)
  199.         (players-building-type-count 4 town-center >= 1))
  200.         (stance-toward 4 ally)
  201.         (player-in-game 4)
  202.         (up-compare-const my-player-number != 4)
  203.         (up-allied-resource-amount 4 gold < 1000)
  204. =>
  205.         (tribute-to-player 4 gold 1000)
  206.         (chat-to-player-using-id 4 22078)
  207.         (chat-local-to-self "Tributing 1000 gold to an ally.")
  208. )

  209. (defrule
  210.         (food-amount >= 2400)
  211.         (players-population 5 > 30)
  212. (or        (players-unit-type-count 5 villager >= 20)
  213.         (players-building-type-count 5 town-center >= 1))
  214.         (stance-toward 5 ally)
  215.         (player-in-game 5)
  216.         (up-compare-const my-player-number != 5)
  217.         (up-allied-resource-amount 5 food < 1000)
  218. =>
  219.         (tribute-to-player 5 food 1000)
  220.         (chat-to-player-using-id 5 22077)
  221.         (chat-local-to-self "Tributing 1000 food to an ally.")
  222. )
  223. (defrule
  224.         (wood-amount >= 2400)
  225.         (players-population 5 > 30)
  226. (or        (players-unit-type-count 5 villager >= 20)
  227.         (players-building-type-count 5 town-center >= 1))
  228.         (stance-toward 5 ally)
  229.         (player-in-game 5)
  230.         (up-compare-const my-player-number != 5)
  231.         (up-allied-resource-amount 5 wood < 1000)
  232. =>
  233.         (tribute-to-player 5 wood 1000)
  234.         (chat-to-player-using-id 5 22076)
  235.         (chat-local-to-self "Tributing 1000 wood to an ally.")
  236. )
  237. (defrule
  238.         (gold-amount >= 2400)
  239.         (players-population 5 > 30)
  240. (or        (players-unit-type-count 5 villager >= 20)
  241.         (players-building-type-count 5 town-center >= 1))
  242.         (stance-toward 5 ally)
  243.         (player-in-game 5)
  244.         (up-compare-const my-player-number != 5)
  245.         (up-allied-resource-amount 5 gold < 1000)
  246. =>
  247.         (tribute-to-player 5 gold 1000)
  248.         (chat-to-player-using-id 5 22078)
  249.         (chat-local-to-self "Tributing 1000 gold to an ally.")
  250. )

  251. (defrule
  252.         (food-amount >= 2400)
  253.         (players-population 6 > 30)
  254. (or        (players-unit-type-count 6 villager >= 20)
  255.         (players-building-type-count 6 town-center >= 1))
  256.         (stance-toward 6 ally)
  257.         (player-in-game 6)
  258.         (up-compare-const my-player-number != 6)
  259.         (up-allied-resource-amount 6 food < 1000)
  260. =>
  261.         (tribute-to-player 6 food 1000)
  262.         (chat-to-player-using-id 6 22077)
  263.         (chat-local-to-self "Tributing 1000 food to an ally.")
  264. )
  265. (defrule
  266.         (wood-amount >= 2400)
  267.         (players-population 6 > 30)
  268. (or        (players-unit-type-count 6 villager >= 20)
  269.         (players-building-type-count 6 town-center >= 1))
  270.         (stance-toward 6 ally)
  271.         (player-in-game 6)
  272.         (up-compare-const my-player-number != 6)
  273.         (up-allied-resource-amount 6 wood < 1000)
  274. =>
  275.         (tribute-to-player 6 wood 1000)
  276.         (chat-to-player-using-id 6 22076)
  277.         (chat-local-to-self "Tributing 1000 wood to an ally.")
  278. )
  279. (defrule
  280.         (gold-amount >= 2400)
  281.         (players-population 6 > 30)
  282. (or        (players-unit-type-count 6 villager >= 20)
  283.         (players-building-type-count 6 town-center >= 1))
  284.         (stance-toward 6 ally)
  285.         (player-in-game 6)
  286.         (up-compare-const my-player-number != 6)
  287.         (up-allied-resource-amount 6 gold < 1000)
  288. =>
  289.         (tribute-to-player 6 gold 1000)
  290.         (chat-to-player-using-id 6 22078)
  291.         (chat-local-to-self "Tributing 1000 gold to an ally.")
  292. )

  293. (defrule
  294.         (food-amount >= 2400)
  295.         (players-population 7 > 30)
  296. (or        (players-unit-type-count 7 villager >= 20)
  297.         (players-building-type-count 7 town-center >= 1))
  298.         (stance-toward 7 ally)
  299.         (player-in-game 7)
  300.         (up-compare-const my-player-number != 7)
  301.         (up-allied-resource-amount 7 food < 1000)
  302. =>
  303.         (tribute-to-player 7 food 1000)
  304.         (chat-to-player-using-id 7 22077)
  305.         (chat-local-to-self "Tributing 1000 food to an ally.")
  306. )
  307. (defrule
  308.         (wood-amount >= 2400)
  309.         (players-population 7 > 30)
  310. (or        (players-unit-type-count 7 villager >= 20)
  311.         (players-building-type-count 7 town-center >= 1))
  312.         (stance-toward 7 ally)
  313.         (player-in-game 7)
  314.         (up-compare-const my-player-number != 7)
  315.         (up-allied-resource-amount 7 wood < 1000)
  316. =>
  317.         (tribute-to-player 7 wood 1000)
  318.         (chat-to-player-using-id 7 22076)
  319.         (chat-local-to-self "Tributing 1000 wood to an ally.")
  320. )
  321. (defrule
  322.         (gold-amount >= 2400)
  323.         (players-population 7 > 30)
  324. (or        (players-unit-type-count 7 villager >= 20)
  325.         (players-building-type-count 7 town-center >= 1))
  326.         (stance-toward 7 ally)
  327.         (player-in-game 7)
  328.         (up-compare-const my-player-number != 7)
  329.         (up-allied-resource-amount 7 gold < 1000)
  330. =>
  331.         (tribute-to-player 7 gold 1000)
  332.         (chat-to-player-using-id 7 22078)
  333.         (chat-local-to-self "Tributing 1000 gold to an ally.")
  334. )

  335. (defrule
  336.         (food-amount >= 2400)
  337.         (players-population 8 > 30)
  338. (or        (players-unit-type-count 8 villager >= 20)
  339.         (players-building-type-count 8 town-center >= 1))
  340.         (stance-toward 8 ally)
  341.         (player-in-game 8)
  342.         (up-compare-const my-player-number != 8)
  343.         (up-allied-resource-amount 8 food < 1000)
  344. =>
  345.         (tribute-to-player 8 food 1000)
  346.         (chat-to-player-using-id 8 22077)
  347.         (chat-local-to-self "Tributing 1000 food to an ally.")
  348. )
  349. (defrule
  350.         (wood-amount >= 2400)
  351.         (players-population 8 > 30)
  352. (or        (players-unit-type-count 8 villager >= 20)
  353.         (players-building-type-count 8 town-center >= 1))
  354.         (stance-toward 8 ally)
  355.         (player-in-game 8)
  356.         (up-compare-const my-player-number != 8)
  357.         (up-allied-resource-amount 8 wood < 1000)
  358. =>
  359.         (tribute-to-player 8 wood 1000)
  360.         (chat-to-player-using-id 8 22076)
  361.         (chat-local-to-self "Tributing 1000 wood to an ally.")
  362. )
  363. (defrule
  364.         (gold-amount >= 2400)
  365.         (players-population 8 > 30)
  366. (or        (players-unit-type-count 8 villager >= 20)
  367.         (players-building-type-count 8 town-center >= 1))
  368.         (stance-toward 8 ally)
  369.         (player-in-game 8)
  370.         (up-compare-const my-player-number != 8)
  371.         (up-allied-resource-amount 8 gold < 1000)
  372. =>
  373.         (tribute-to-player 8 gold 1000)
  374.         (chat-to-player-using-id 8 22078)
  375.         (chat-local-to-self "Tributing 1000 gold to an ally.")
  376. )
  377. ;(defrule
  378. ;        (up-compare-goal math-goal2 != 1)
  379. ;        (strategic-number sn-focus-player-number < 8)
  380. ;=>
  381. ;        (up-modify-sn sn-focus-player-number c:+ 1)
  382. ;        (up-jump-rule -4); 5
  383. ;)
  384. ;(defrule;改修正向上跳转第三处结束
  385. ;        (true)
  386. ;=>
  387. ;        (up-modify-sn sn-focus-player-number g:= math-goal))
复制代码


都比较长,毕竟是大BUG。我自己测试后,涉及focus-player的方面,AI的表现确实是更正常了。
_(¦3[_])_
回复

使用道具 举报

21

主题

0

精华

673

积分

伯爵

耕战
29
鹰币
591
天龙币
0
回帖
238
附庸关系0
发表于 2019-5-5 00:13:14 | 显示全部楼层
本帖最后由 chifeiyen 于 2019-5-5 00:18 编辑
HD官方AI是有不少问题,我在创意工坊上发布了个修改的Mod如下:
因为本人对AI不太懂,目前主要修改了以下几项:

@凌果


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册翔鹰会员(昵称)

x
回复

使用道具 举报

11

主题

4

精华

6914

积分

国王

耕战
755
鹰币
402254
天龙币
0
回帖
223

翔鹰建站十周年纪念章

附庸关系0
 楼主| 发表于 2019-5-5 01:04:36 | 显示全部楼层
本帖最后由 凌果 于 2019-5-5 01:23 编辑

我来慢慢回答一下吧。
首先关于训练某种兵种这类,直接相关的就是要找到(train xxxxxx),例如训练投石手就查找(train slinger),这是最直接相关的。
然后部分单位可能会有间接相关之处,就是民族策略,例如印加就查找#load-if-defined INCAN-CIV,一般第一条和第二条分别是民族策略相关常数和策略具体规则。

骆驼射手相关:
由于特种兵都是用(train my-unique-unit-line),所以搜索(train my-unique-unit-line)之后需要逐条细看,排除掉其它文明的特种兵的规则。
我找了,然后找到跟训练骆驼射手有关的是以下两条规则:
  1. (defrule
  2.         (strategic-number sn-resource-control < 1)
  3. (or        (players-unit-type-count focus-player cavalry-archer-line >= 5)
  4.         (players-unit-type-count focus-player mangudai >= 5))
  5. (or        (players-unit-type-count focus-player cavalry-archer-line >= 15)
  6. (or        (players-unit-type-count focus-player mangudai >= 15)
  7.         (unit-type-count my-unique-unit-line < 15)))
  8. (or        (players-unit-type-count focus-player cavalry-archer-line >= 30)
  9. (or        (players-unit-type-count focus-player mangudai >= 30)
  10.         (unit-type-count my-unique-unit-line < 30)))
  11.         (can-train my-unique-unit-line)
  12. =>
  13.         (train my-unique-unit-line)
  14. )
复制代码


  1. (defrule
  2.         (strategic-number sn-resource-control < 1)
  3.         (can-train my-unique-unit-line)
  4. (or        (up-research-status c: my-unique-unit-upgrade >= research-pending)
  5. (or        (goal unit-goal my-unique-unit-line)
  6.         (goal control-goal my-unique-unit-line)))
  7. (or        (up-compare-goal custom-civ-pop > 75);        (unit-type-count villager > 75)
  8. (or        (goal train-civ-goal -1)
  9.         (food-amount >= unique-unit-food)))
  10. (or        (current-age == castle-age)
  11.         (gold-amount > 100))
  12. =>
  13.         (train my-unique-unit-line)
  14. )
复制代码



先讲第一条规则,训练的条件是必须要焦点玩家(即focus-player)有5个以上的骑射手或蒙古突骑才允许训练,有15个以上才允许训练超过15个骆射,有30个以上才允许训练30个骆射。
骆射作为克制骑射手的单位,这条规则看似没有问题(虽然没有考虑到克制象射手、马车、飞镖骑兵等),然而这里就关系到1楼所说的BUG了。1楼所说的BUG影响到focus-player,使得focus-player固定为玩家2。也就是只看玩家2是否训练了一堆骑射手。只要按6楼的方式修正之后,这条训练骆射的规则就没什么问题。(当然可以考虑加入克制象射手、马车、飞镖骑兵等)

讲第二条规则,第二条规则实现难点在于以下3行:
(or        (up-research-status c: my-unique-unit-upgrade >= research-pending)
(or        (goal unit-goal my-unique-unit-line)
        (goal control-goal my-unique-unit-line)))
即当骆射没有升级成精锐骆射之前,需要unit-goal或control-goal为特种兵才允许训练。unit-goal或control-goal(就暂称为目标兵种吧)需要去查柏柏尔的民族策略,查找#load-if-defined BERBERS-CIV,第二条。然后高亮my-unique-unit-line,能发现有以下三条规则涉及目标兵种为特种兵:
  1. (defrule
  2.         (strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
  3. (or        (or        (and        (goal position-goal pocket)
  4.                         (and        (random-number < 73)
  5.                                 (random-number >= 65)))
  6.                 (regicide-game))
  7.         (and        (goal nr-map-goal 1)
  8.                 (random-number >= 75)))
  9.         (game-time > 13)
  10.         (game-time < 60)
  11. =>
  12.         (set-goal unit-goal my-unique-unit-line)
  13.         (set-goal control-goal 0)
  14.         (set-goal ranged-unit-type-goal 0)
  15.         (set-goal strategy-goal boom)
  16.         (set-goal uu-up-goal 1)
  17.         (disable-self)
  18. )
  19. (defrule
  20.         (up-compare-goal unit-goal != my-unique-unit-line)
  21.         (up-compare-goal unit-goal != knight)
  22.         (up-compare-goal control-goal != my-unique-unit-line)
  23.         (up-compare-goal control-goal != knight)
  24. (or        (unit-type-count villager > fourty-percent-pop)
  25. (or        (up-compare-goal custom-civ-pop >= max-civ)
  26.         (population >= max-civ-pop)))
  27. (or        (dropsite-min-distance stone < 5)
  28.         (building-type-count castle >= 1))
  29. =>
  30.         (set-goal unit-goal my-unique-unit-line)
  31.         (set-goal uu-up-goal 1)
  32.         (set-goal ranged-unit-type-goal 0)
  33. ;        (chat-to-player my-player-number "Switching to unique units.")
  34. )
  35. (defrule
  36.         (up-compare-goal unit-goal != my-unique-unit-line)
  37.         (up-compare-goal control-goal != my-unique-unit-line)
  38.         (up-compare-goal control-goal != knight);
  39. (or        (players-unit-type-count focus-player cavalry-archer-line > high-min-number-upgrade)
  40. (or        (players-unit-type-count focus-player mangudai-line > high-min-number-upgrade)
  41.         (players-unit-type-count focus-player conquistador-line > high-min-number-upgrade))); for now
  42.         (building-type-count castle >= 1)
  43. =>
  44.         (set-goal control-goal my-unique-unit-line)
  45.         (set-goal uu-up-goal 1)
  46.         (set-goal ranged-unit-type-goal 0)
  47. ;        (chat-to-player my-player-number "Switching to unique units.")
  48. )
复制代码


这三条规则要详细讲也挺麻烦的,简单来说就是
1.当弑君模式时;当柏柏尔位于居中位置时(左右侧有同盟);当地图是非快攻地图时(例如丛林竞技场、黑森林、堡垒什么之类的)这些情况下有一定概率将目标兵种定为特种兵。
2.人口很多时且目标兵种不为骑兵时将其定为特种兵。
3.焦点玩家骑射手较多时将目标兵种定为特种兵(这里又涉及1楼BUG了)。
总之这几条规则都没什么问题,就是第一条规则里的概率不够大,第二条由于柏柏尔最喜欢目标兵种是骑兵所以可能触发不多,第三条涉及了BUG。所以你见到骆射可能会比较少。
实际上我在游戏的过程中是有见到AI出骆射的,可能是你碰到得少了。

第一个问题写得稍微详细一点,你先看看能不能理解。后面的问题看情况我是写分析还是直接写代码吧。
_(¦3[_])_
回复

使用道具 举报

29

主题

0

精华

3429

积分

公爵

耕战
347
鹰币
4043
天龙币
0
回帖
1136
附庸关系0
发表于 2019-5-5 15:57:50 | 显示全部楼层
凌果大大请直接把改好的PER2分享出来吧?年纪大了,看得眼睛痛
其实骆驼射手不一定要设置为针对性出兵,没钱出标枪,有钱出骆射咯!
帝国2决定版懒人MOD+征服者1.5窃取特色单位MOD
http://www.hawkaoe.net/bbs/thread-139689-1-1.html
回复

使用道具 举报

29

主题

0

精华

3429

积分

公爵

耕战
347
鹰币
4043
天龙币
0
回帖
1136
附庸关系0
发表于 2019-5-5 16:23:25 | 显示全部楼层
本帖最后由 wongyuhua 于 2019-5-5 16:30 编辑
chifeiyen 发表于 2019-5-4 20:15
HD官方AI是有不少问题,我在创意工坊上发布了个修改的Mod如下:
因为本人对AI不太懂,目前主要修改了以下几 ...

前面3条我们讨论过,简化相关规则的前提,或者新增独立而简单的规则应该是可以解决的
4. 我要是意大利也不喜欢出佣兵,又没有步兵文明的加成优势
5. set-strategic-number sn-garrison-rams 0改为1可允许步兵进驻冲车,但不是100%有效,其实如果只驻扎1个的话也没卵用
6. sn-coop-share-attacking 1默认是开启的,但如果没有attack-now这种直接命令来响应同盟的求救,AI很难做到及时支援,用promi作者自己的话来说,就是usually helps ally too late, but better than nothing,你可以加一条规则(参考Boss):
(defrule
;    (strategic-number sn-maximum-town-size <= 30)
    (not(town-under-attack))
    (soldier-count >= 21)
    (taunt-detected any-ally 222)
    (strategic-number sn-percent-attack-soldiers != 96)
=>
    (chat-to-allies-using-id 22073)
    (set-strategic-number sn-percent-attack-soldiers 97)
    (attack-now)
    (acknowledge-taunt this-any-ally 222)
)

帝国2决定版懒人MOD+征服者1.5窃取特色单位MOD
http://www.hawkaoe.net/bbs/thread-139689-1-1.html
回复

使用道具 举报

2

主题

0

精华

569

积分

子爵

耕战
106
鹰币
580
天龙币
0
回帖
27
附庸关系0
发表于 2019-5-5 16:58:40 | 显示全部楼层
HD是有个大BUG 我去电脑家塔爆, 就在城镇中心边上建 ,他们完全不会去反抗你了,农民也不会攻击你。
回复

使用道具 举报

11

主题

4

精华

6914

积分

国王

耕战
755
鹰币
402254
天龙币
0
回帖
223

翔鹰建站十周年纪念章

附庸关系0
 楼主| 发表于 2019-5-5 17:31:10 | 显示全部楼层
本帖最后由 凌果 于 2019-5-5 17:38 编辑
wongyuhua 发表于 2019-5-5 15:57
凌果大大请直接把改好的PER2分享出来吧?年纪大了,看得眼睛痛
其实骆驼射手不一定要设置为针对性出 ...

是指六楼的修改方案吗,
查找到原代码的位置,把我列出整个部分的原代码都删了,把我给出的整段修正方案复制进去就OK


我晚点把我修正过的AI文件放上来吧,除了1楼说到的BUG,还有很多处小问题,我稍微整合一下并写一下注释。
_(¦3[_])_
回复

使用道具 举报

21

主题

0

精华

673

积分

伯爵

耕战
29
鹰币
591
天龙币
0
回帖
238
附庸关系0
发表于 2019-5-5 17:45:18 | 显示全部楼层
本帖最后由 chifeiyen 于 2019-5-5 17:52 编辑
wongyuhua 发表于 2019-5-5 16:23
前面3条我们讨论过,简化相关规则的前提,或者新增独立而简单的规则应该是可以解决的
4. 我要是意大利也不 ...

驻扎冲车我改成1也不会驻扎,但原版AI又是可以驻扎的,因此一直觉得很奇怪。

点评

所以说不是100%有效,看AI心情  发表于 2019-5-5 20:55
回复

使用道具 举报

21

主题

0

精华

673

积分

伯爵

耕战
29
鹰币
591
天龙币
0
回帖
238
附庸关系0
发表于 2019-5-5 17:47:51 | 显示全部楼层
本帖最后由 chifeiyen 于 2019-5-5 20:21 编辑
wongyuhua 发表于 2019-5-5 16:23
前面3条我们讨论过,简化相关规则的前提,或者新增独立而简单的规则应该是可以解决的
4. 我要是意大利也不 ...

第6条你说加的这条规则应该加在哪里?就加在AI文件最后就可以吗?HD的AI的攻击我看了貌似都是用TSA实现的,不是Attack now,野蛮人好像也是,但野蛮人能做到及时救援,难道是只有up 1.4以上的语句才能实现?
回复

使用道具 举报

21

主题

0

精华

673

积分

伯爵

耕战
29
鹰币
591
天龙币
0
回帖
238
附庸关系0
发表于 2019-5-5 20:04:31 | 显示全部楼层
本帖最后由 chifeiyen 于 2019-5-5 20:09 编辑
凌果 发表于 2019-5-5 01:04
我来慢慢回答一下吧。
首先关于训练某种兵种这类,直接相关的就是要找到(train xxxxxx),例如训练投石手就 ...

第一条规则我能理解,第二条规则我对up的goal类的语句不太懂。不过根据你的分析,只要把你1楼的Bug解决,骆射的问题也就算迎刃而解了吧!
回复

使用道具 举报

29

主题

0

精华

3429

积分

公爵

耕战
347
鹰币
4043
天龙币
0
回帖
1136
附庸关系0
发表于 2019-5-5 20:52:30 | 显示全部楼层
本帖最后由 wongyuhua 于 2019-5-12 15:25 编辑
chifeiyen 发表于 2019-5-5 17:47
第6条你说加的这条规则应该加在哪里?就加在AI文件最后就可以吗?HD的AI的攻击我看了貌似都是用TSA实现的 ...

位置随意,我有的放最后,有的放最前,都可以,放后面最好
attack-now是最简单直接的攻击命令,但无法实现野蛮人那样高级的效果。TSA就是三光政策,从距离最近的打起,你在前线火烧眉毛,援军在外围悠哉的打它没人的伐木场和采矿场。不过TSA也有优点,那就是集中兵力一窝蜂上,而不会舍近求远
帝国2决定版懒人MOD+征服者1.5窃取特色单位MOD
http://www.hawkaoe.net/bbs/thread-139689-1-1.html
回复

使用道具 举报

29

主题

0

精华

3429

积分

公爵

耕战
347
鹰币
4043
天龙币
0
回帖
1136
附庸关系0
发表于 2019-5-5 20:57:37 | 显示全部楼层
凌果 发表于 2019-5-5 17:31
是指六楼的修改方案吗,
查找到原代码的位置,把我列出整个部分的原代码都删了,把我给出的整段修正方案复 ...

等着您修正的AI文件呢!谢谢啦
帝国2决定版懒人MOD+征服者1.5窃取特色单位MOD
http://www.hawkaoe.net/bbs/thread-139689-1-1.html
回复

使用道具 举报

11

主题

4

精华

6914

积分

国王

耕战
755
鹰币
402254
天龙币
0
回帖
223

翔鹰建站十周年纪念章

附庸关系0
 楼主| 发表于 2019-5-12 22:43:32 | 显示全部楼层
本帖最后由 凌果 于 2019-10-2 01:08 编辑

文件搞好了,大部分改动是以前就做好的,最近加了一些规则并写了注释。
所有的改动都写了注释并以“改”开头,打开文件搜索“改”可以查到所有的改动,大概一百条吧。
(旧)
(新)
有些改动是修正客观存在的BUG;有些改动是带主观性质的改动,也就是不算BUG但我认为这样改更合理。
如果不打算全盘接受的话,可以用Beyond Compare、UltraCompare等文本对比软件对比一下,挑其中一些来用。
我在这里将全部的改动列一下表:
  1. 以下是一些客观存在的BUG修正:

  2. 修正一共三处up-jump-rule负数的大型BUG,HD版up-jump-rule负数跟up-jump-rule正数是等效的,这个BUG会导致数百条focus-player值错误
  3. 调整sn-current-age状态,避免城堡开局、帝王开局、后帝开局时偶尔出现的资源采集分配错乱的BUG
  4. 在12分钟时执行一次资源采集分配,修正偶尔出现的非黑暗时代开局资源采集分配错乱的BUG(配合上面那条改动),仅执行一次(disable-self),没出现BUG时会被覆盖
  5. 增设条件以解决偶尔出现的资源采集分配错乱的BUG
  6. 修正threat-player范围未包含玩家8的BUG(会导致不能计算玩家8的兵种威胁)
  7. 修正计算船只数量时未算卡拉维尔的BUG
  8. 一共有11条自杀农民的规则,其中有两条有BUG,会导致在含小片水域的地图进行游戏时错误地自杀农民。顺便给所有自杀规则加一个自我提示(chat-local-to-self)
  9. 修正城堡时代开局时美洲民族(特别是阿兹)有可能出现不生产村民的BUG
  10. 修正水陆混合地图后帝开局时不会造船坞的BUG,因为后帝开局某条重要的造船坞规则需要先造铁匠铺,然而后帝肯定不会造铁匠铺
  11. 修正一个BUG,当允许造建筑的城镇范围内,没有空地造城堡时代升帝王时代必要建筑时,增加城镇范围大小,常见于空间比较少的地图
  12. ->(蠢蠢的AI宁愿造兵营田地等也不去造大学城堡攻城武器厂、导致资源够升帝也一直卡在城堡时代。若地图的空间实在太少此修正方案不起效)
  13. 修正类似上面的BUG,封建时代升城堡时代
  14. 拥有一定数量的蒙古突骑、象射、骆射时研究帕提亚战术(原版仅考虑了骑射手未考虑特种骑射)
  15. 修正定义意大利佣兵常数的BUG(882是佣兵,184是佣兵的一个隐藏前置单位)
  16. 改动训练意大利佣兵的规则,修正佣兵常数错误的BUG,并使训练佣兵的规则更合理
  17. 定义两个标志和一个定时器
  18. 修正"strategic-number.+:"不能配合类型符的错误,例如strategic-number sn-xxx g:== xxx,strategic-number sn-xxx s:>= xxx,都是不正确的判断,只能判断c:类型。共有五处修正。

  19. 以下是一些带主观性质的改动:

  20. 加入一大段AI之间救援的规则,加入后AI之间的救援会更加积极或及时(特别是坐中的AI),只影响AI之间救援,不影响AI对人类玩家施救
  21. 高资源开局时禁止一开局马上研究封建时代,因为花时间研究封建时代会使村民数很少,发展很缓慢
  22. 后帝开局时预留100木材给第一间伐木场,原版会直接造兵营等东西导致第一座伐木场延后很久(尤其是中高资源开局)
  23. 加入研究异教的规则,当敌方僧侣很多时研究,原版完全不会研究异教
  24. 改动研究信念的规则,使其更合理(拥有异教的文明会优先异教)
  25. 加入一条研究城镇巡逻的规则(只有当资源丰富时才研究,原版完全不会研究城镇巡逻);另改动研究城镇瞭望的规则
  26. 提高允许卖木材时的木材存有量,因为AI容易缺木(只涉及一条卖木规则)
  27. 加入一条买木材的规则,当金多木少且木材比较便宜时买100木(AI挺容易缺木的)
  28. 海战时或木材缺少时暂时地提高一点伐木工人数
  29. 改动建造前线马厩、靶场、兵营、攻城、箭塔、炮塔的规则,使其更合理
  30. 改动建造前线城堡的规则,使其更合理(实际上原版几乎不会造前线城堡,改后也很少会造,但还是合理一点)
  31. 允许训练非精锐的龙头战舰(原版不允许)
  32. 减少爆破船上限,减少一点点浪费,AI的爆破船太容易浪费了
  33. 即使印加已研究劲弩手,当敌步兵较多时也允许训练投石手(原版已研究劲弩就不会训练投石手了)
  34. 当敌方拥有特种骑射时允许训练骆驼射手(原版仅考虑了骑射手和蒙古突骑),并略微提高出骆射的概率
  35. 标枪骑兵和帝矛都能训练时,不再禁止训练帝矛
  36. 改动训练标枪骑兵的规则,使其更合理
  37. 允许西班牙训练1个传教士(原版完全不会训练传教士)
  38. 水陆混合图也允许训练贸易船,但限制在2艘以内,因为贸易船容易发呆所以不宜太多
  39. 改动研究刺网的规则,加入一条拥有7艘渔船以上时允许研究
  40. 不再禁止中国和蒙古训练弩炮
  41. 改动研究操练规则,不一定要先研究重型冲车(原版必须研究重冲完毕后才允许操练)
  42. 改动早期建造炮塔的规则,原版早期能造炮塔就会直接造,改后会留石头优先造一座城堡后才考虑炮塔
  43. 改动早期建造箭塔的规则,类似上面
  44. 当敌方有人类玩家时,AI只要至少还有一个城镇中心就不会轻易投降

  45. 以下是一些小改动:
  46. 略微减少炮舰上限,AI的炮舰实在太蠢了
  47. 降低炮舰数量对sn-resource-control的影响和对attack-goal的影响
  48. 提高sn-target-evaluation-boat,默认攻击船优先度(不过实际上似乎是没有效果)
  49. 略微改动研究重型弩炮的规则;略微修改一条训练象兵的规则;略微调整一条训练僧侣的规则(使它们更合理)
  50. 提高一点中国的诸葛弩的出场率;提高一点马来坐中时象兵的优先级;略微提高匈奴出答剌罕的概率
  51. 改动以下民族的默认射手,提高一点骑射的优先级(相对弩手而言):柏柏尔、印度、日本、马扎尔、波斯、萨拉森、土耳其(另外比较适合骑射的匈奴蒙古西班牙不需要提高)
  52. 改动以下民族的坐中目标兵种,提高一点特种兵的优先级:缅甸、拜占庭、埃塞、哥特、匈奴、日本、萨拉森、斯拉夫、维京
  53. 略微改动建造大学时的规则,加入一条当木材较多时允许建造大学(还是不超过1间)
  54. 延迟禁止训练渔船的时机
复制代码

使用方法见27楼。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册翔鹰会员(昵称)

x
_(¦3[_])_
回复

使用道具 举报

11

主题

4

精华

6914

积分

国王

耕战
755
鹰币
402254
天龙币
0
回帖
223

翔鹰建站十周年纪念章

附庸关系0
 楼主| 发表于 2019-5-12 23:00:55 | 显示全部楼层
本帖最后由 凌果 于 2019-9-15 18:48 编辑

另外我顺便传一个我自己用的Notepad++的帝国2语法高亮方案:
(旧,已淘汰)
(新)
可以导入到Notepad++用。
(语言->自定义语言格式->导入)

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册翔鹰会员(昵称)

x
_(¦3[_])_
回复

使用道具 举报

11

主题

4

精华

6914

积分

国王

耕战
755
鹰币
402254
天龙币
0
回帖
223

翔鹰建站十周年纪念章

附庸关系0
 楼主| 发表于 2019-5-12 23:03:08 | 显示全部楼层
wongyuhua 发表于 2019-5-5 20:57
等着您修正的AI文件呢!谢谢啦

来啦,最近沉迷于某小说导致这个晚了
_(¦3[_])_
回复

使用道具 举报

本版积分规则

排行榜|小黑屋|翔鹰帝国

GMT+8, 2024-4-24 14:14 , Processed in 0.244701 second(s), 220 queries , File On.

Powered by Hawk Studio  QS Security Corp.® Licensed

Copyright © 2001-2023, Hawkaoe.net All Rights Reserved

快速回复 返回顶部 返回列表