AI 규칙 (ver 0.2 WIP)
Last Edited: 2018-02-12 2139
모델 조건
- 최종기획버전기준
Basic Algorithm:
- Gather all possible tasks by Task do-ers
- Score all tasks by table
- Sort all tasks by score
- Do highest scoring task
- If multiple tasks have same score, choose randomly
- Back to 1. and repeat until no more positive-scoring tasks remain
- Skip Turn for any units with remaining AP but no positive-scoring task
- End Turn
Possible Task Types
- Attack Enemy Unit/City
- Move Fighting Unit to Spot
- Move Pioneer to Spot
- Use a Skill of a Unit/Building
- Build Fighting Unit
- Build Pioneer
- Build Resource Building
- Build Military Building
- Build Special Building
- Cancel Unit/Building
- Deploy Unit to a City
- Deploy Interior Resource Building to a City
- Deploy Interior Special Building to a City
- Deploy Normal Resource Building to Spot
- Deploy Normal Special Building to Spot
- Deploy Normal Military Building to Spot
- Deploy City to Pioneer
- Accept Quest
- Raise Tax Rate by 5%
- Lower Tax Rate by 5%
- Raise Economy Investment by 5%
- Lower Economy Investment by 5%
- Raise Tech Investment by 5%
- Lower Tech Investment by 5%
- Raise Logistics by 5%
- Lower Logistics by 5%
- Quest Task : A combination/list of above tasks that is needed to complete a Quest.
General Task Priority(일반적인 AI의 행동 흐름/우선 순위): Quest Tasks >= Attack = Skill >= Move > Deploy >= Accept Quest > Build=Cancel >=Raise/Lower Resource
즉 밑에 표에서 각 Task Type 마다 Very High/High/Low/etc. 되있는건 각 Task Type 내부에 한해 상대적 기준, 다른 Task Type과 비교해 우선 순위는 위에 General Task Priority참조
예시) Quest Tasks >= Attack이니까 Attack에서 Very High/Most High정도는 되야지 Quest Task보다 높은 Score가 매겨짐. 반면 Move > Deploy이므로 Deploy는 아무리 높아도 Move Task들을 먼저하게됨.
Priority Score Table
Task Type | Context | Score |
---|---|---|
Attack Enemy Unit/City | Unit lives after attack | 100 |
Unit dies after attack | -50 | |
Enemy Unit lives after attack | 25 | |
Enemy Unit dies after attack | 50 | |
Enemy City lives after attack | 50 | |
Enemy City dies after attack | 75 | |
Move Fighting Unit to Spot | Unit dies if attacked after moving to spot | -150 |
Unit can attack enemy after moving to spot | 50 | |
Unit can be attacked after moving to spot | -50 | |
Unit has low HP(<1/3) and is further from enemy after moving to spot | 50 | |
Unit has non-low HP and is closer to enemy after moving to spot | 50 | |
Unit is closer to City after moving to spot | 25 | |
Move Pioneer to Spot | Unit is further from enemy after moving to spot | 20 |
Unit is closer to enemy after moving to spot | 10 | |
Unit is further from city after moving to spot | 10 | |
Unit is closer to enemy after moving to spot | 20 | |
Use a Skill of a Unit/Building | Can Destroy Enemy Unit/Building | Extremely High |
Build Fighting Unit | 1.5 × (Enemy Fighting Unit Number + Enemy City Number) < Fighting Unit Number | -50 |
Fighting Unit Number < 1.5 × (Enemy Fighting Unit Number + Enemy City Number) | 50 | |
Gold/Labor Capacity is full | -100 | |
Build Pioneer | City Number < 1.5 × Enemy City Number | 50 |
1.5 × Enemy City Number < City Number | -50 | |
Gold/Labor Capacity is full | -100 | |
Build Resource Building | (Resource : Resource Type Produced by Building) is High | Very Low |
(Resource) is Okay | Medium | |
(Resource) is Low | High | |
(Resource) is Very Low/Negative | Very High | |
Build Military Building | Enemy Fighting Unit Number is High | High |
Enemy Fighting Unit is Near My Fighting Unit | High | |
Gold/Labor Capacity is full | Very Low | |
Deploy Unit to a City | Unit is Fighting Unit | 128 - Distance to enemy from City |
Unit is Pioneer | Distance to enemy from City + 20 | |
Deploy Interior Resource Building to a City | Far from Enemy | Very High |
Many Resource Building in City | Low | |
Close to Enemy | Very Low | |
Few Resource Building in City | High | |
Deploy Normal Resource Building to Spot | Far From Enemy | Very High |
Close to Enemy | Very Low | |
Many Resource Building Nearby | Low | |
Few Resource Building Nearby | High | |
Deploy Normal Military Building to Spot | Enemy within Range of Skill | Most High |
Nearby Friendly Fighting Unit | High | |
Nearby Enemy Fighting Unit | Low | |
Deploy City to Pioneer | City Number + Pioneer Number < 1.5 × Enemy City Number | 50 |
1.5 × Enemy City Number < City Number + Pioneer Number | 30 | |
Accept Quest | Quest is Ultimate Weapon Quest | Most High |
Quest Reward is Military Special Resource | Very High | |
Quest Display Period is Short | High | |
Quest Display Due is Approaching | Very High | |
Quest Reward is Resource for lacking Resource | High | |
Quest Reward is Resource-buff Special Resource for lacking Resource | High | |
Set Tax Rate to X% | ||
Set Economy Investment to X% | ||
Set Tech Investment to X% | Enemy Tech is Higher | X is Very High |
Tech Lost to Enemy | X is High | |
My Tech is Higher | X is Low | |
Need Gold Now | X is Very Low | |
Set Logistics to X% | ||
Quest Task | Quest is Ultimate Weapon Quest | Super High |
Quest Limit Period is short | Very High | |
Quest Limit Due is Approaching | Very High | |
Quest Reward is Military Special Resource | Very High | |
Quest Reward is Resource for lacking Resource | High | |
Quest Reward is Resource-buff Special Resource for lacking Resource |
Task do-ers
- Fighting Unit - Attack, Move, Use a Skill
- Pioneer - Move
- Build Que - Build
- Deploy Que - Deploy
- Quest Display Que - Accept Quest
- Quest Accepted Que - Quest Task