# TypeII AI

## Adding new level for TypeII AI

Since TypeII AI uses breadth first search algorithm, it requires high computational power, potentially exponential use of computation power for increasing AI level. Personally only found out it can go as far as level 5 for a reasonable amount of computation time, depending on platforms. It might be able to go as far to beyond level 5 but at the cost of unreasonable waiting time for AI to move, for a smooth game. But iOS might be superb in its computation speed for this breadth first search algorithm, from my past experience, iOS can perform AI moves search more than 2 times faster than any other platform. For the reason of high cpu requirement, a level 5 search depth had been prepared without it being made available on any demo scenes containing AIs.&#x20;

Head to the ChessAITypeIIMechanism class, five level of search depth has been there, currently the dropdown UI for TypeII AI only have 4 options available, up to level 4 search depth.&#x20;

<figure><img src="https://2079102914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FA7OKfIba5xvQF1lhv60z%2Fuploads%2FXEEPXSK9Seh1CMwpawWU%2Fdevenv_52UjPQG4z5.png?alt=media&#x26;token=aa14eee2-351c-4211-953c-cdf239acb425" alt=""><figcaption></figcaption></figure>

In order to enable the level 5 options, it is as easy as adding a new dropdown to the TypeII AI dropdown UI.&#x20;

{% hint style="info" %}
Level 5 of TypeII AI has up to 1650 Elo.
{% endhint %}

<figure><img src="https://2079102914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FA7OKfIba5xvQF1lhv60z%2Fuploads%2Fa5ZOgfYMEbx8g0b5sRJp%2FUnity_LmZRGjhooC.png?alt=media&#x26;token=884e35a4-f6cf-4670-a205-53b2b5667153" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://freedom-developer.gitbook.io/the-chess/customization/typeii-ai.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
