Hi, it’s been a week.
This is Otorakobo.

This week, I have been working on improving the AI to make COM’s movement better.

I’m still brushing up the in-game image and so on, so I’ve shelved it for now. Sorry.

The AI of COMs was a part that I could not finish in time when I was working on the Comiket demo version of Irisy Aqua, and the COMs were using the old attack methods even though the attack specifications had changed.
I thought that the changes to the proto-ROM specifications had been completed, so I decided to fix the COM logic.

*Problems
(1) Old attacks other than skill attacks
(2) Getting lost in path finding
(3) Not acquiring dropped items

When we tried to solve the problem of not acquiring dropped items in (3), the player would get lost in the path search in (2), resulting in a negative cycle of not executing the skill attack in (1).

In other words, there was one main cause.

Getting lost in the pathfinding.

This is it.

The answer is simple: because the processing load of Aster’s algorithm is so heavy that it gives up if it cannot reach the destination after searching for about 500 patterns.
The answer is simple: because the algorithm Aster’s processing load is heavy.

If you are searching in a short distance, searching 500 patterns is enough, but if there are enemies nearby, the cost of the search route increases and you end up getting lost.

* Solution
When a route to a destination is not found, the system once uses a straight line distance to get to the destination.
Then, when heading to the destination, we continued the route search, and if a route was found, we changed to adopt that route.
This enabled us to reach our destination without getting lost.

The bottleneck is that when you are moving in a straight line, you are unprotected and will go straight ahead, ignoring enemy attacks and such.
However, if you were hit, the logic that prioritizes recovery and survival would be On, so the destination would refer to the recovery block, so I thought, well, it wouldn’t break the bank.

I implemented such a solution in COM in the ↓ video.

The player who rasquires the white tower in the middle wins, but since there are not enough colors in the beginning, we go to attack from the surrounding red, blue, and green towers.
In doing so, we chose the action that seemed optimal for the presence of other players and moreover, in the end, one COM was able to destroy the white tower and execute it until the end of the game.
Good.

It looks like I’m going to have to do some serious research on AssetBundle soon, so next week I’ll investigate AddressableAsset and the like.
Of course, once I get the ingame images together, I’ll introduce those as well.

See you soon!

【Irisy Aqua】COMの動きを良くしてみる
どうも一週間ぶりです。
Otorakoboです。

今週はCOMの動きを良くするためにAIを改良していました。

インゲームイメージとかはブラッシュアップ中なので、一旦棚上げしております。すんません。

COMのAIですが、Irisy Aquaのコミケ体験版を作っている際に、間に合わなかった部分で、攻撃の仕様が変わっているのにCOMは旧攻撃方法を使ってきたりとかしていました。
プロトROMの仕様変更もまぁまあひと段落してきていると思ったので、COMのロジックにメスを入れました。

●問題点
1)スキル攻撃以外の旧攻撃をする
2)経路探索で迷子になる
3)ドロップしたアイテムを取得しない

この中で、3)のドロップアイテムを取得しない問題を解決しようとしたところ、2)の経路探索で迷子になってしまい、結果1)のスキル攻撃を実行しないという負の循環になっていました。

つまり、原因は大本は一つで。

経路探索で迷子になる

これです。

じゃぁ、なんで迷子になるんじゃいってことなんですが、答えは簡単で、アルゴリズムのAsterの処理負荷が重たいので、500パターンほど検索して目的地にたどり着けなかったら諦めてしまう。
という仕様になっているからです。

近距離の探索であれば500通りも検索すれば十分なんですが、敵が近くに居たりすると探索ルートのコストが上がり、それはそれで迷子になってしまいます。

●解決策
目的地への経路が見つからなかった際には、一旦直線距離で目的地へ向かうようにしました。
そして、目的地へ向かう際にも経路探索を継続し、経路が見つかったら、その経路を採用するように変更しました。
すると、ちゃんと迷子にならずに目的地へたどり着けるようになりました。

ネックとしては直線距離で移動している際は無防備な状態で、敵の攻撃とかを無視して直進してしまいます。
ただ、もし被弾したら回復や生存を優先するロジックがOnになるため、目的地が回復ブロックを参照するようになるので、まぁ破綻しないかなと思いました。

そんなソリューションをCOMに実装したのが↓の動画です。

真ん中の白いタワーをラスキルした人が勝ちですが、序盤は色が足りないので、周囲の赤青緑のタワーから攻略しに行きます。
その際に、他のプレイヤが存在するともろもろ最適と思われる行動を選択し、最終的には一人のCOMが白タワーを破壊してゲーム終了まで実行できました。
良かった。

そろそろAssetBundleを真面目に調査しないといけなさそうなので、来週はAddressableAssetとかを調査してみようと思います。
もちろんインゲームイメージがまとまってくれば、そちらもご紹介しようと思います。

それでは!