<?xml version="1.0" encoding="UTF-8" ?><rdf:RDF 
  xmlns="http://purl.org/rss/1.0/"
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:atom="http://www.w3.org/2005/Atom"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xml:lang="ja">
  <channel rdf:about="http://w.atwiki.jp/wesnoth/">
    <title>Create of Wesnoth@wiki</title>
    <link>http://w.atwiki.jp/wesnoth/</link>
    <atom:link href="https://w.atwiki.jp/wesnoth/rss10.xml" rel="self" type="application/rss+xml" />
    <atom:link rel="hub" href="https://pubsubhubbub.appspot.com" />
    <description>Create of Wesnoth@wiki</description>

    <dc:language>ja</dc:language>
    <dc:date>2009-02-18T13:59:49+09:00</dc:date>
    <utime>1234933189</utime>

    <items>
      <rdf:Seq>
                <rdf:li rdf:resource="https://w.atwiki.jp/wesnoth/pages/20.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/wesnoth/pages/19.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/wesnoth/pages/18.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/wesnoth/pages/17.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/wesnoth/pages/16.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/wesnoth/pages/15.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/wesnoth/pages/14.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/wesnoth/pages/13.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/wesnoth/pages/12.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/wesnoth/pages/11.html" />
              </rdf:Seq>
    </items>
	
		
    
  </channel>
    <item rdf:about="https://w.atwiki.jp/wesnoth/pages/20.html">
    <title>sample.py</title>
    <link>https://w.atwiki.jp/wesnoth/pages/20.html</link>
    <description>
      このページはais/python/sample.pyのコメントを訳したものです。

**sample.py

#codehighlight(python){{

#!WPY

&quot;&quot;&quot;これは必要最低限のpythonAIの例です&quot;&quot;&quot;

import ai as wesnoth
import heapq

def pos(location):
    &quot;&quot;&quot;デバッグメッセージでポジションを表示するためだけの関数&quot;&quot;&quot;
    return &quot;(%d, %d)&quot; % (1 + location.x, 1 + location.y)

def debug(string):
    pass

class AI:
    &quot;&quot;&quot;AIのメインクラス&quot;&quot;&quot;

    def __init__(self):
        &quot;&quot;&quot;このクラスはAIのターン毎に構成されます。
        定期的に値を取得し続けるため、またゲームをセーブした時のために、
        set_variableとget_variableを使用します。&quot;&quot;&quot;

        self.team = wesnoth.get_current_team()
        self.village_radius = 25
        self.scout_villages = 3

        self.recruit()

        self.fight()

        self.conquer()

    def conquer(self):
        &quot;&quot;&quot;村を占領しようとします&quot;&quot;&quot;
        villages = self.find_villages()
        units =  wesnoth.get_destinations_by_unit().keys()

        #(distance, unit, village)というリストを作成
        queue = []
        for village in villages:
            for unit in units:
                d = self    </description>
    <dc:date>2009-02-18T13:59:49+09:00</dc:date>
    <utime>1234933189</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/wesnoth/pages/19.html">
    <title>要望・意見</title>
    <link>https://w.atwiki.jp/wesnoth/pages/19.html</link>
    <description>
      *要望・意見

このページを訳してほしい、この訳は間違っているのではないか、など、要望や意見があれば書いていくと幸せになれるかもしれません。

#comment    </description>
    <dc:date>2009-02-12T09:29:14+09:00</dc:date>
    <utime>1234398554</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/wesnoth/pages/18.html">
    <title>FormulaAI</title>
    <link>https://w.atwiki.jp/wesnoth/pages/18.html</link>
    <description>
      このページは本家wikiの[[FormulaAI&gt;http://www.wesnoth.org/wiki/FormulaAI]]のページを訳したものです。

*FormulaAI

#contents

**概要

Wesnoth Formula AIは、WesnothのAIを簡単に開発出来るAIフレームワークです。

WesnothはすでにPythonでのAI作成をサポートしていますが、これは2つの問題を抱えています。

-AIやPyhtonに詳しくない人(特にプログラマでない人)には難解
-AIにみせかけた、悪意のあるトロイの木馬スクリプトによって、甚大なダメージを与える可能性がある

Wesnoth Formula AIの狙いは、AIを実行できる、簡単で純粋な関数型言語をつくることであり、また、比較的専門的なスキルがあまり無いような人でも、AIの変更や微調整が可能なことです。WMLを使う事ができる人たちが、シナリオと共に、シナリオに沿ったAIを作成できるようになるべきではないでしょうか。

Wesnoth Formula AIは現在、開発の実験段階にあり、基礎的なAIであればプレイする事が出来ますので、フィードバックがもらえたら幸いです。

Formula AIを使っての開発には、[side]内で、ai_algorithm=formula_aiをセットします。

**アプローチ

Formula AIを使うためには、[side]タグ内に[ai]タグをひとつ入れる必要があります。[ai]タグの中には、どのようにAIが動くのかを&#039;move&#039;属性で指定する必要があります。AIが動くたびに、この式が作動すると、moveが実行されます。移動が可能な限り式は作動し続け、移動できなくなった時点でAIはターンを終了します。また、ターンが終わってすぐの時点で式を返すコマンドがあります。

Wolf Riderを動かすだけのサンプルAIは以下のようになります。

&gt;&gt;
[side]~
...~
ai_algorithm=formula_ai~
[ai]~
move=&quot;recruit(&#039;Wolf Rider&#039;)&quot;~
[/ai]~
[/side]~
&lt;&lt;

**Formulaコマンドライン

formula    </description>
    <dc:date>2009-02-12T15:47:29+09:00</dc:date>
    <utime>1234421249</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/wesnoth/pages/17.html">
    <title>template</title>
    <link>https://w.atwiki.jp/wesnoth/pages/17.html</link>
    <description>
      このページは本家wikiの[[&gt;http://www.wesnoth.org/wiki/]]のページを訳したものです。


**コメント
#comment


total:&amp;counter()
today:&amp;counter(today)
yesterday:&amp;counter(yesterday)    </description>
    <dc:date>2009-02-05T15:28:12+09:00</dc:date>
    <utime>1233815292</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/wesnoth/pages/16.html">
    <title>WhyWritingAWesnothAIIsHard</title>
    <link>https://w.atwiki.jp/wesnoth/pages/16.html</link>
    <description>
      このページは本家wikiの[[WhyWritingAWesnothAIIsHard&gt;http://www.wesnoth.org/wiki/WhyWritingAWesnothAIIsHard]]を訳したものです。

*なぜWesnothのAIをつくる事は難しいのか?

**概要
私はこの問いの答えとして、主にWesnothのAIを伝統的に書いていた数人と、Summer of Codeの一部としてAIの開発をした学生について書く。

WesnothのAIは非常に役に立つものだが、その難しさを侮ってはいけない。ほとんどの伝統的なAIメソッドをWesnothに適用させることはできず、非常に革新的な解決策を使う事が必要とされた。

多くの人はWesnothのとても強力なAIをかなり簡単なはずだと思っている。結局のところ、コンピュータはチェスやバックギャモンの世界チャンピオンを負かしている。どちらもターン制のゲームなのに、Wesnothはなぜこれらとは違うのだろうか？このドキュメントでは、なぜWesnothがチェスやバックギャモンのテクニックを使わずに成功に近づいたのかについて示そう。

**Wesnothの柔軟さは我々を苦しめる

Wesnothは非常に柔軟だ。それは様々なサイズやユニットで作られた、多くの異なるマップに現れている。プレイヤーは自分のユニットをどこにでも置く事が出来る。これで、一般的なAIを作る事はより難しくなる。

コンピュータがチェスがとてもうまいのは、チェスが比較的小さなボードで、いつも同じであり、こまが同じポジションからスタートするからである。これは、コンピュータが処理しなければならない盤面が、比較的制限されていることを意味する。そして、特にコンピュータが処理しなければならない盤面のタイプはかなり限られている。例えば、チェスで城のキングの前に3つの連続したポーン(将棋で言うと歩)があるパターンはチェスではよくあるパターンだ。そしてそのパターンをチェスの評価エンジンが認識して、強さを判定するのは比較的簡単なことなのだ。

Wesnothは全く違う。Wesnothとチェスを比べるまでもなく、もしチェスが違う形や大きさだったら、その都度チェスのプログラムが書かれるだろう、とあなだって思うはずだ。真ん中が通れない正方形かも    </description>
    <dc:date>2009-02-05T15:18:54+09:00</dc:date>
    <utime>1233814734</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/wesnoth/pages/15.html">
    <title>ReferencePythonAPI</title>
    <link>https://w.atwiki.jp/wesnoth/pages/15.html</link>
    <description>
      *ReferencePythonAPI

#contents

PythonAIはターンごとにpython scriptを実行し、ユニットの移動や攻撃を許可します。このドキュメントでは、AIを有効にする方法、Python scriptで利用できるプロパティとメソッドについて解説します。

特に指定しない限り、全てのプロパティは読み込み専用です。

全てのオブジェクトはwesnoth.gamemapを除いて==演算子がサポートされています。実際には比較はサポートされていますが、結果はイコールテストのみ意味があります。

**Python AIのオプションの指定方法 

Python support will be built if HAVE_PYTHON is defined during the build process. Under Unix, this is disabled with the --disable-python configure switch. 

Pythonのサポートを一度有効にすると、PythonAIを使う方法が3つできます。いずれにしても、.pyファイルはdataフォルダかuserdataフォルダ内のdata/aisに入っているはずです。例えば、Unix系ならそれらのスクリプトは~/.wesnoth/data/ais/my_ai.pyか、/usr/share/wesnoth/data/ais/my_ai.pyにあるはずです。また、Windowsなら、wesnoth/userdata/data/ais/my_ai.pyか、wesnoth/data/ais/my_ai.pyにあるはずです。


***方法その1
マルチプレイヤーゲームを始める場合は、PythonAIを選択して使う事ができます。そのAIは全てのプレイヤーに提供できるはずです。これを動かすために、メインで使うAIの.pyファイルは最初の1行目に以下のようなコメントを入れる必要があります。

#highlight(python){{
#!WPY
}}

また、安全なPythonAIのみを実行したい場合は、以下のようにコメントを入れます。
#highlight(python){{
&gt;#!UNSAFE_WPY
}}

***    </description>
    <dc:date>2009-02-12T15:49:42+09:00</dc:date>
    <utime>1234421382</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/wesnoth/pages/14.html">
    <title>WritingYourOwnAI</title>
    <link>https://w.atwiki.jp/wesnoth/pages/14.html</link>
    <description>
      このページは本家wikiの[[WritingYourOwnAI&gt;http://www.wesnoth.org/wiki/WritingYourOwnAI]]のページを訳したものです。

*WritingYourOwnAI(AIの自作について)

**Writing your own AI

WesnothはC++、またはPythonでAIを自作できるプラガブルなAIシステムをサポートしています。始める前に[[WhyWritingAWesnothAIIsHard(なぜWesnothのAIを作る事は難しいのか)&gt;WhyWritingAWesnothAIIsHard]]を読んでおくといいでしょう。

**Python

PythonでのAIの情報については、[[ReferencePythonAPI]]のAPIを見てください。

**C++

**コメント

- 現在は[[FormulaAI]]というページの方が役立つと思います。  -- shin@管理者  (2009-02-12 15:51:36)
#comment    </description>
    <dc:date>2009-02-12T15:51:36+09:00</dc:date>
    <utime>1234421496</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/wesnoth/pages/13.html">
    <title>Create</title>
    <link>https://w.atwiki.jp/wesnoth/pages/13.html</link>
    <description>
      このページは本家wikiの[[Create&gt;http://www.wesnoth.org/wiki/Create]]ページの訳です。

*Create

シナリオやキャンペーンの作成に興味があるでしょうか？Wesnothの最も良い特徴の一つとして、その拡張性の高さが挙げられます。プレイヤーは地図やユニット、シナリオなどに加えて、全体のキャンペーンも作成する事ができます。ゲームのコア部分へのアクセスは、簡単であり、難しくもあります。テキストエディタでも作成は可能ですが、WML(the Wesnoth Markup Language)を使うと簡単です。このセクションでは作成から配布までのプロセスを解説していきます。

気をつけておいてほしいのは、ゲームのコア部分において、アートワークの作成にはかなりの手間がかかるということです。現在のプロジェクトはここに載っています。

-[[Read This First -+- A list of things we need help with(英語)&gt;http://www.wesnoth.org/forum/viewtopic.php?t=2014&amp;start=0&amp;postdays=0&amp;postorder=asc&amp;highlight=]]

***最初に読むべき事 [#b252bf84]

あなたが何か変更したり追加したりする前に、ゲームがどのようにデータを格納、整理しているかを把握しておくといいでしょう。以下のページにはゲームのディレクトリ構造とusrdataディレクトリについて説明されています。

-[[EditingWesnoth]]

***何が作成できるのか [#e4f25d76]

-[[地図&gt;http://www.wesnoth.org/wiki/BuildingMaps]]
--タイルのレイアウトについて
-[[シナリオ&gt;http://www.wesnoth.org/wiki/BuildingScenarios]]
-[[キャンペーン&gt;http://www.wesnoth.org/wiki/BuildingCampaigns]]
-[[マルチプレイヤーマップとシナリオ&gt;http://www.wesnoth.org/wiki/BuildingMultiplayer]]
    </description>
    <dc:date>2009-02-05T09:19:11+09:00</dc:date>
    <utime>1233793151</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/wesnoth/pages/12.html">
    <title>EditingWesnoth</title>
    <link>https://w.atwiki.jp/wesnoth/pages/12.html</link>
    <description>
      *EditingWesnoth

このページは本家wikiの[[EdtingWesnoth&gt;http://www.wesnoth.org/wiki/EditingWesnoth]]のページを訳したものです。

#contents

**ゲームディレクトリとユーザディレクトリ

あなたがどこにゲームをインストールしていても、ゲームデータディレクトリにはゲームのデータが入っています。このディレクトリには以下のサブディレクトリが入っています。

-data
-music
-sounds
-images

その他にも、重要なものがいくつかあります。wiki内で「game data」、「wesnoth/data」,「./data」と書かれている場合、それらは全て、wesnoth/dataを指します。通常これらのファイルは変更する必要はありませんが、ユニットなどに変更を加えたい時はこれらを編集する必要があります。

ユーザデータディレクトリは、あなたがカスタムしたコンテンツを置く事が出来ます。これによって、ゲームの元データを変更せずにすむわけです。OSによってユーザデータディレクトリは別の場所にあります。wiki内で「user data」と言った場合、「userdata/subdirectory」を指します。たまに「~wesnoth/」と書いている場合もあります。


**ゲームデータディレクトリの場所

***windows

通常は

&gt;C:\Program Files\Wesnoth\data

にありますが、ゲームを自分で違う場所にインストールした人は、インストールした場所から探して下さい。

***Mac OS X

sourceforgeからダウンロードした人は、アプリケーションのアイコンを右クリックして、「パッケージの内容を表示」を選択して下さい。その中のContents/Resourcesに入っています。sourceforge以外からダウンロードした人は、

&gt;/usr/local/share/wesnoth

を見てみてください。

***Linux

-/usr/local/share/wesnoth
-apt-get(Debian and Ubuntu)かemerge (Ge    </description>
    <dc:date>2009-02-03T16:25:29+09:00</dc:date>
    <utime>1233645929</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/wesnoth/pages/11.html">
    <title>プラグイン/コメント</title>
    <link>https://w.atwiki.jp/wesnoth/pages/11.html</link>
    <description>
      * コメントプラグイン
@wikiのwikiモードでは
 #comment()
と入力することでコメントフォームを簡単に作成することができます。
詳しくはこちらをご覧ください。
＝＞http://atwiki.jp/guide/17_60_ja.html


-----
たとえば、#comment() と入力すると以下のように表示されます。

#comment    </description>
    <dc:date>2009-02-03T15:13:55+09:00</dc:date>
    <utime>1233641635</utime>
  </item>
  </rdf:RDF>
