콘텐츠로 건너뛰기
라이엇 비트

라이엇 비트

  • 집
  • 소식
  • 가이드
  • 비디오 가이드
  • 패치 노트
  • 남용 신고
  • 검색 양식 전환
The Hand of Merlin

The Hand of Merlin – Artificial Intelligence Modding Guide

에 게시됨 05/13/2022 에 의해 Mibs 코멘트 없음 ~에 The Hand of Merlin – Artificial Intelligence Modding Guide
  • 제목: The Hand of Merlin
  • 출시일:
  • 개발자:
  • 발행자:
Information about The Hand of Merlin is still incomplete. 이것을 사용하여 게임의 세부 정보를 입력할 수 있도록 도와주세요. 문의 양식.

This is an extensive and detailed guide setting up or debugging AI of units in The Hand of Merlin, written by its game designer Mat.

소개

이 가이드에서는, 나’d like to walk you through the creation of an AI, which can make an enemy unit use their skills on their own, against your warband.

How does AI work in The Hand of Merlin?

Our programmers chose to use the Utility AI paradigm. 이는 다음을 의미합니다., in simple terms, that for every ability we let our AI consider, 그것’ll try to rank the “utility” value of its casting in every single tile it can cast, and then compare all options, picking the one with the highest utility value. 그것’s a great way to consider multiple options at once.

Specifically in our case, 각 “Unit Class” has its own “뇌”, where we’ll describe options and the questions the AI makes to each target tile.

If that isn’t clear yet, 두목’걱정, 허락하다’s go step by step.

Unit Brains

가장 먼저, we have to create a 뇌. A great way to do it is via the Create Menu (CTRL+N), and then selecting Generic -> (merlin) AI brain params.

대안으로, if you already have a Unit Class file, you can create a new Brain directly on that file, and then open it separately.

어느 쪽이든, the result is a blank Brain file, like this one:

Be sure to save that puppy (we use the Content\Merlin\AI\UnitBrains folder).

Note that there’s not a lot going on here, as we still have to fill in the Ability Considerations, but there’s already something called a Unit Priority. 나’ll take this chance to explain what Priority is.

그것은, 잘, our “공익사업” value for each action. During an enemy turn, since our game uses Side Initiative, all possible actions from all possible units will be ranked in how high their priority is, 그리고 그것들’ll be played in that order, as long as there are available abilities. As we’ll see shortly, the Ability considerations are the heavy lifters here, but if you ever want a unit to consistently play first or last, you might want to play with the Unit Priority, as this will multiply the priority/utility of everything that that specific brain calculates.

For an example on how that works, Behemoth has a priority of 3, 그리고 요술 장이 (Support bandit) 가지다 0.5. This usually makes the Behemoth play first, and the warlock after all other units.

Consideration Sets

지금, 허락하다’s look at the Ability Consideration Sets. 여기, you should have at least one for every ability the unit has, but some abilities (like Run!) can have multiple entries.

Think of each Consideration Set as a question your AI can ask. In the example below, “If I am going to use Shoot, how should I use it, and is it more important than other abilities?”

Each consideration has 4 속성:

  • ㅏ Label is for internal use only. Helps you identify them from afar, and will come in handy when we talk about debugging. 그것’s like a name for that set.
  • 그만큼 능력 is where you list the ability this is in relation to. If the ability is not enabled for any reason (the unit doesn’t have it, it’s on cooldown, or it takes more AP than the unit currently has), this set won’t be triggered.
  • 당신은 우선 사항 to associate with the ability, which is modulated by the Unit Priority and the …
  • Decision Maker, which is the actual calculation the AI does with that ability to each possible tile. Note how it actually is a file type on its own, so it’s a modular piece.

Decision Makers and Scorers

Found in the Content/Merlin/AI/Behaviours 접는 사람, and always named with a `Behavior_` prefix, these are the building blocks of the AI. 기술적으로, you can mix and match between those, but I recommend creating your own Decision Makers, especially if you have a specific behavioral pattern in mind.

Each Decision Maker is nothing more than a combination of Scorers, that take the priority of the ability and multiply it by some value. In the picture above, you can see that the Behavior_OverwatchDefensive decision maker, associated with Mandrake’에스 Prepare Shot 능력, 가지다 3 scorers:

  1. Gate_NoOverwatchAlly, which sets the priority to 0 거기 있다면’s an ally of Mandrake’s that is already preparing a shot;
  2. Gate_CanHitRangedAnyone, which will set the priority to 0 if the unit cannot find a target to hit (즉. 그것’ll never use overwatch if there is no one in range, likely preferring to just walk up)
  3. Score_DefensiveRating, which makes the priority lower if the current tile is a bit too in the open, making the Mandrake prefer to use Prepare Shot only if its behind cover (우리’ll talk more about Defensive rating in a sec, 두목’걱정).

Note how they have a specific naming convention. All of these scorers, found in Content/Merlin/AI/Considerations, have one of three suffixes: 게이트 can set a priority to 0 또는 1, almost like a boolean. 점수 tend to be more subtle, ~에 이르기까지 0 에게 1, 그리고 보너스 can only have 1+ 가치, making something MORE likely. This is just my personal conventions though, and you can feel free to name them whatever you prefer.

To dive a bit deeper, 허락하다’s take a look at how Gate_NoOverwatch Ally works:

가장 먼저, it’s of the type “Has status effect”, which is kind of the category of question. 우리’ll list all the questions and their base properties in a sec. 그래서, we have to qualify the question. “Who” 가지다 “어느” status effect. 그만큼 “Who” here is the Units of Interest. I can set it up to search for all sorts of units, like those inside an area, those with a specific health ratio, those with specifics relations, 등.

이 경우, 우리’re searching for all allies, so we put All Units in the unit group, and we apply the relation filter, with the 친구 filter.

그 다음에, which status effect? We could use a category (positive/negative/marker/hidden), but for this case, I just wanted to know who has the `Overwatch.rsc` status effect. And there you go.

그래서, 그만큼 답변 to this question will be a number of units that are my allies that also have the listed status effect. This will be plotted as the X value in the Graph entry.

To check out this graph in a more visual way, I suggest clicking on the the graph button, 여기

Which grants you this visual over here:

As we said, the X axis is the “답변” to the consideration’s question. The Y axis, 하지만, is whatever we decide should multiply the 우선 사항 given a X value. In the example above, if the X is 0 (there are no allies with the Overwatch status effect), then we’ll multiply the priority by 1. 만약에, 하지만, 있다 1 or more allies with the status effect, then we multiply the priority by 0, cancelling the entire operation – Mandrake will not use Prepare Shot.

Hence the name – is a 문 to see if there are allies with the 오버 워치 효과!

All Scorers work in this same way, providing you with an X for you to decide what the Y should be. 여기’s a quick rundown of all the types, so you know what to look for. 그런데, questions that are “Yes/no” result in 1 for yes, 0 for no, as expected.

참고하세요 Offensive Rating 그리고 Defensive Rating are left for last, since they are a bit special.

Gate Types

  • Units Count in Cast area at Target: “If I aim an ability at a specific tile, what units will the target area of this ability find there?” Great for checking the effectiveness of AoE.
  • Number of Interesting Units: “How many units are there of this type?” A more generic way of searching for units. Maybe your behavior is different if your unit is the last one standing?
  • Hit Chance: “how likely an ability is to hit a specific target?”. Most ranged units will avoid taking shots against targets in cover!
  • AP cost to use this ability: “what does this ability cost if I target this tile?” Useful if your ability can scale off AP, like Run.
  • Min Walk distance from target tile: “Starting from the target tile, 무엇’s the minimum distance to a unit of interest?” This is useful for movement abilities, to keep other units at a reasonable distance. Cockatrices use this to get close to allies, 예를 들어.
  • Min Walk Distance to target tile: “From here I am standing, how far is my target tile?” This works well if your unit wants to minimize/maximize traveling distance. Redcaps love walking around units, and this is what you use for that.
  • Air Distance: Works exactly like Walk Distance, but doesn’t consider covers and other movement blockers. It’s a straight line, and uses diagonals well. Better for “proximity” checks, like Mandrake’s preference to shoot nearby units.
  • Single Target X Percent/Amount: “At this target tile, 거기 있다면’s a unit, how much Armor/Health/Life does it have?” 여기, Life stands for adding both Health and Armor. This is a good one if your enemies prefer wounded targets, or if they have armor-wrecking skills, they might prefer higher armored foes! Percent puts it in a 0-1 비율, and Amount gives you the flat value.
  • Has Status Effect: “Does my units of interest have a status effect?” We talked about this one before, but it works well for more complex behaviors if you use hidden status effects!
  • Status Effect Stack Count: “How many stacks of the status effect do they have?” We don’t use this one, but it would work well for some “격노”-type effects, 오른쪽?
  • Can Caster Activate Ability?: “Can I use this other ability?” Good for checking if your ability is out of cooldown before you do something. Our Rogue bandit checks if their Shiv ability is cleared before it Sprints close, as an example.
  • Turn Type of Caster: “What kind of turn is this?” Hopefully the X is self-explanatory here. This gives you a different result if this is the turn the unit was revealed, or if it is a reaction, like those granted by Redcap’s Watchful.
  • Blackboard Query: “What information is out there regarding ability use?” this allows you to query which abilities have been used recently. Will help you sort out combos and similar actions!

  • Caster Action Points: “how many Action Points I have?” If you want to prefer to do some actions at a specific action point count, 이것은 당신을위한 것입니다!
  • Defensive Rating: “How safe is the target tile?” This is an interesting one. The AI tries to estimate how defended a tile is considering all enemies and their ranges. Having this consideration associated with your movement ability makes enemies more careful, and favor covers, depending on how you set your graph. And yeah – the AI can even see what class each enemy is, and doesn’t care about getting cover against Warriors!
  • Offensive Rating: “How good of a shot do I have at my foes from the target tile?” This allows the unit to rank how many enemies it can hit from the target tile. Higher X in tiles where multiple enemies can be hit without cover – add this to get better flanking behavior!

The combination of these last two can do wonders for the “성격” of your AI. Work a good graph to balance between “방어적인” 그리고 “offensive play!

Do note: if your movement ability determines that the current tile is the best possible tile, the unit will just stay put and pass a turn.

Debugging

Small parting note, to help your testing out. When you are messing with new enemies in your tests, 있다 Console Command that can give you some information about the end result of your queries.

To use it, when you are running a simulation, 누르다 틸데 key and type

hom_dbg_bEnableAIDebugging = 1

This will make it so that when the AI starts to consider their first turn, they actually print to the screen all actions with >0 end priority. 완료되면, set the same variable to 0.

이것으로, I can see that he could’ve used Ooze Run, Gaze, Corrupt, and Far Run, but Gaze wont out by a landslide, also noted by the red yellow line. Just right click to step through the process of every action, 당신은요’ll see how your configuration ended up working!

There you go! Go forth and have some fun creating new brains for your units!

이것이 오늘 우리가 공유하는 모든 것입니다. The Hand of Merlin 가이드. 이 가이드는 원래 작성자가 작성하고 작성했습니다. Mibs. 이 가이드를 업데이트하지 못한 경우, 다음을 수행하여 최신 업데이트를 찾을 수 있습니다. 링크.

이 사이트의 콘텐츠가 귀하의 권리를 침해한다고 생각하는 경우, 귀하의 지적 재산권을 포함하여, 문의 양식을 사용하여 즉시 문의하십시오..
가이드 태그:The Hand of Merlin

탐색 후

이전 게시물: The Hand of Merlin – Status Effect Modding Guide
다음 게시물: The Hand of Merlin – 오라스 & Ground Effects Modding Guide

답장을 남겨주세요 답장 취소

귀하의 이메일 주소는 공개되지 않습니다. 필수 입력란이 표시되어 있습니다 *

  • 제목: The Hand of Merlin
  • 출시일:
  • 개발자:
  • 발행자:
Information about The Hand of Merlin is still incomplete. 이것을 사용하여 게임의 세부 정보를 입력할 수 있도록 도와주세요. 문의 양식.

부인 성명

인용된 모든 콘텐츠는 해당 소스에서 파생됩니다.. 귀하의 콘텐츠를 허가 없이 사용했다고 생각되는 경우, 우리에게 연락하면 진지하게 받아 들일 것입니다..
  • 회사 소개
  • 문의하기
  • 개인 정보 정책
  • 서비스 약관

저작권 © 2025 라이엇 비트.

에 의해 구동 프레스북 뉴스 WordPress 테마