JP2019191786A - Game program generation device and game program generation program - Google Patents

Game program generation device and game program generation program Download PDF

Info

Publication number
JP2019191786A
JP2019191786A JP2018081928A JP2018081928A JP2019191786A JP 2019191786 A JP2019191786 A JP 2019191786A JP 2018081928 A JP2018081928 A JP 2018081928A JP 2018081928 A JP2018081928 A JP 2018081928A JP 2019191786 A JP2019191786 A JP 2019191786A
Authority
JP
Japan
Prior art keywords
game
program
action
program module
initial state
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2018081928A
Other languages
Japanese (ja)
Inventor
今井 達也
Tatsuya Imai
達也 今井
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Heroz Inc
Original Assignee
Heroz Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Heroz Inc filed Critical Heroz Inc
Priority to JP2018081928A priority Critical patent/JP2019191786A/en
Publication of JP2019191786A publication Critical patent/JP2019191786A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

To create various programs related to a game program from a game specification more conveniently.SOLUTION: A game rule processing program generates the following program modules on the basis of a game specification 202 including a definition of a game state, a definition of an action to be executed by a game program by an instruction of a player, and a definition of game completion: a module generating a table of an initial state of a game; a module specifying an action executable by the game program by searching the table in an initial state; a module receiving an action selected by the player; a module executing an action if the selected action is an executable action; a module updating the table by adding a change to a proposition stored in the table on the basis of a definition of the executed action; and a module outputting game completion and a completion result by searching the table.SELECTED DRAWING: Figure 3

Description

本発明は、ゲームプログラム生成装置及びゲームプログラム生成プログラムに関する。   The present invention relates to a game program generation device and a game program generation program.

コンピュータプログラムの作成には、一般的に、プログラミング言語を用いてプログラムを定義することが行われている。   In general, a computer program is created by defining a program using a programming language.

コンピュータゲームのプログラムは、ゲームのルールだけでなく、画面の描画処理、音響の入出力処理、コントローラからの入力処理、通信処理、AIの思考処理など、様々な要素の処理を並行して行う複雑なプログラムである。多くのゲーム製作現場では、これらの処理をより簡単に実現し実装するために、ゲームエンジンと呼ばれるゲーム製作支援用ソフトウェアが用いられている。   A computer game program is not only a game rule but also a complex process that performs various elements in parallel, such as screen drawing processing, sound input / output processing, controller input processing, communication processing, AI thinking processing, etc. Program. In many game production sites, in order to more easily realize and implement these processes, game production support software called a game engine is used.

一般にゲームエンジンと称されるものには、ゲームのプログラム製作を支援するツールを備えたものであって、様々な形態が存在する。ゲームエンジンの例を挙げれば、ミドルウェアの集合で構成されたツール群が総合化された形態のもの、API(Application Programing Interface)を提供することでゲームの部品を提供するものなどがある。
ゲームエンジンの具体例としては、例えば、Unity(登録商標)、Unreal Engine、Cocos2d-xなどが挙げられる。
What is generally called a game engine is provided with a tool that supports the creation of a game program, and there are various forms. Examples of game engines include a form in which a group of tools configured by a set of middleware is integrated, and a part that provides game parts by providing an API (Application Programming Interface).
Specific examples of the game engine include Unity (registered trademark), Unreal Engine, Cocos2d-x, and the like.

従来のゲームエンジンにおいては、個別の要素を処理するライブラリやAPIは用意されていても、それらをどのようにまとめあげて連携させるのかはゲーム製作者が自ら考えて設計し実装している。特に、ゲームのルールを処理する部分の製作又はゲームのロジックを処理する部分の製作については、ツールやライブラリを有効に利用できる機会が限られている。   In a conventional game engine, even if libraries and APIs for processing individual elements are prepared, the game creator thinks about how to collect and link them together and designs and implements them. In particular, for the production of the part that processes the game rules or the production of the part that processes the game logic, there are limited opportunities to use tools and libraries effectively.

したがって、ゲームのルール処理部の設計からテストに至るまで、製作者自身が殆ど全てのプログラムを設計し、プログラミングする場合が多い。このため、上述のようなゲームエンジンの役割には限界が存在する。結果的にはゲームプログラムの製作には、多くの作業工数がかかることになる。   Therefore, in many cases, the creator himself designs and programs almost all the programs from the design of the rule processing unit of the game to the test. For this reason, there is a limit to the role of the game engine as described above. As a result, the production of the game program takes a lot of work steps.

加えて、ゲームプログラムの製作には、ゲームを構成する要素に関する多岐にわたる専門知識が要求される。例えば人間の対戦相手やNPC(Non-Player Character)のプレイを操作するゲームAIの製作などは高度な知識が要求されて難しい。   In addition, the production of a game program requires a wide range of expertise regarding the elements that make up the game. For example, it is difficult to produce a game AI for manipulating human opponents and NPC (Non-Player Character) play because advanced knowledge is required.

また、複数のゲーム製作者の設計能力のばらつきや製作時の急な仕様変更など様々な理由から、全ての処理が密に結合したモノリシックなプログラムが製作される傾向が強い。プログラムの処理のモジュール化が不十分な場合には、単体テストや自動的なテストなどのデバッグ手法を利用することが難しくなってしまう。
加えて、ゲームの特定の機能だけを別のゲームで再利用したい場合においても、移植作業が困難になるなど、様々な不都合がある。
Also, for various reasons such as variations in the design ability of a plurality of game producers and sudden specification changes at the time of production, there is a strong tendency to produce monolithic programs in which all processes are closely coupled. When the program processing is not modularized, it becomes difficult to use debugging techniques such as unit tests and automatic tests.
In addition, there are various inconveniences such as a porting operation becoming difficult even when only a specific function of a game is to be reused in another game.

また、ゲームプログラムに限らず、一般的なプログラムの製作においても、プログラム製作者を支援する技術が存在する。例えば以下のような技術が挙げられる。   Further, not only a game program but also a technique for supporting a program producer exists in production of a general program. For example, the following techniques are mentioned.

アプリケーションプログラムを構成する要素を表示する表示部と、第1の要素を個別の状況に対応できるようにする旨、及び、第2の要素により個別の状況を識別する旨の表示部上での指示を検出する検出部と、第1の要素を第2の要素により識別される個別の状況に対応できるようにするアプリケーションプログラムの部分を生成する生成部とを備えた技術が存在する。この技術では、既存のアプリケーションプログラムを個別の状況に応じて変更する作業を行える環境を提供している(例えば特許文献1参照)。   An indication on the display unit for displaying the elements constituting the application program, the fact that the first element can be adapted to the individual situation, and the identification of the individual situation by the second element There is a technology that includes a detection unit that detects the occurrence of a problem and a generation unit that generates a part of an application program that enables the first element to correspond to an individual situation identified by the second element. This technology provides an environment in which an existing application program can be changed according to individual circumstances (see, for example, Patent Document 1).

また、所定のプログラミング言語により記述されるコンピュータプログラムを生成するコンピュータプログラム生成装置であって、ユーザによって定義された用語と、前記用語に対応する識別子とを記憶する用語データベースと、前記プログラミング言語の文法に従って形成される木構造であって、前記プログラミング言語に用いられる各命令文を構成する複数の構成要素をそれぞれ格納する複数のノードを含む木構造を有する文法データベースと、前記用語を含む前記コンピュータプログラムのアルゴリズムの入力を受け付ける入力部と、前記用語データベースを検索して前記入力部で入力された用語に対応する識別子を読み出し、前記文法データベースを検索して前記ノードから構成要素を読み出し、前記読み出された識別子及び構成要素を配列することにより複数の命令文を1つずつ生成し、前記生成された複数の命令文を前記入力されたアルゴリズムに従って順番に並べる生成部とを備える、コンピュータプログラム生成装置を提供する技術がある(例えば特許文献2参照)。
以上のような一般的なプログラムの製作を支援する技術においても、その適用範囲は限られた範囲にとどまっているのが現状である。
A computer program generation device for generating a computer program described in a predetermined programming language, the term database storing a term defined by a user and an identifier corresponding to the term, and a grammar of the programming language A grammar database having a tree structure including a plurality of nodes each storing a plurality of components constituting each statement used in the programming language, and the computer program including the terms An input unit that accepts the input of the algorithm of the above; searching the term database; reading out an identifier corresponding to the term input at the input unit; searching the grammar database; reading out components from the node; Identifiers and configuration requirements There is a technique for providing a computer program generation device comprising: a generation unit that generates a plurality of imperative sentences one by one and arranging the plurality of generated imperative sentences in order according to the input algorithm (For example, refer to Patent Document 2).
Even in the technology for supporting the production of the general program as described above, the scope of application is currently limited.

特許第4629646号公報Japanese Patent No. 4629646 特許第5844347号公報Japanese Patent No. 5844347

本発明は、上述のような、技術的な課題を解決するためになされたものであって、その目的は、ゲームの仕様から、ゲームプログラム及びゲームプログラムに付随する様々なプログラムの作成をより簡便に行えるようにすることにある。   The present invention has been made to solve the technical problems as described above, and its purpose is to make it easier to create a game program and various programs accompanying the game program from the specifications of the game. It is to be able to do it.

一実施形態によれば、命題を用いて定義されたゲームの仕様から、ゲームマシンにゲームを動作させるゲームプログラムを生成するゲームプログラム生成装置であって、前記仕様は、少なくとも、ゲームの状態の定義と、プレイヤーからの指示に基づいて前記ゲームプログラムにより実行されるアクションの定義と、ゲームの終了の定義と、を含み、前記ゲームプログラム生成装置は、ゲームの状態を記憶するテーブルに、前記ゲームの仕様に含まれる複数の命題について、ゲームの初期状態における真理値が含まれるように、初期状態のテーブルを作成するプログラムモジュールを生成する、テーブル作成プログラム生成部と、前記アクションの定義を用いて、前記テーブルを検索することで、前記ゲームプログラムにより実行可能なアクションを特定するプログラムモジュールを生成する、実行可能アクション特定プログラム生成部と、前記プレイヤーによって選択されたアクションを受け取るプログラムモジュールを生成する、アクション受取プログラム生成部と、前記プレイヤーによって選択されたアクションが、前記実行可能なアクションのうちの1つである場合、前記選択されたアクションを実行するプログラムモジュールを生成する、アクション実行プログラム生成部と、実行された前記アクションの定義に基づいて、前記アクションが実行された後のゲームの状態を表す真の命題の全てを含むように、前記テーブルに格納された命題に変更を施すことで、前記テーブルを更新するプログラムモジュールを生成する、テーブル更新プログラム生成部と、前記ゲームの終了の定義を用いて、前記テーブルを検索することで、ゲームの終了及びゲームの終了の結果を出力するプログラムモジュールを生成する、ゲーム終了プログラム生成部と、を有する、ゲームプログラム生成装置が提供される。   According to an embodiment, there is provided a game program generation device for generating a game program for causing a game machine to operate a game from a game specification defined using a proposition, wherein the specification includes at least a definition of a game state. And a definition of an action executed by the game program based on an instruction from the player and a definition of the end of the game, and the game program generation device stores the game state in a table that stores a game state. For a plurality of propositions included in the specification, using a table creation program generation unit that generates a program module that creates a table of an initial state so that the truth value in the initial state of the game is included, and the definition of the action, By searching the table, an action executable by the game program is executed. An executable action specifying program generating unit for generating a program module for specifying an action, an action receiving program generating unit for generating a program module for receiving an action selected by the player, and an action selected by the player. If the action is one of the executable actions, the action is generated based on an action execution program generation unit that generates a program module for executing the selected action and the definition of the executed action. A table update program generation unit that generates a program module that updates the table by changing the proposition stored in the table so as to include all of the true propositions representing the state of the game after being executed And the game There is provided a game program generation device having a game end program generation unit that generates a program module that outputs a game end and a game end result by searching the table using an end definition. The

実施形態によれば、ゲームの仕様などから、ゲームプログラム及びゲームプログラムに付随する様々なプログラムの製作をより簡便に行うことができる。   According to the embodiment, it is possible to more easily produce a game program and various programs accompanying the game program from the specifications of the game.

三目並べを説明する図である。It is a figure explaining a tic-tac-toe arrangement. 実施形態の概略を示す図である。It is a figure which shows the outline of embodiment. ゲームルール処理プログラム生成部の処理の内容を示した図である。It is the figure which showed the content of the process of a game rule processing program production | generation part. プレイヤーシミュレーション(AI)プログラム生成部を示す図である。It is a figure which shows a player simulation (AI) program generation part. 初期状態(ステージ)難易度測定プログラムの生成及び難易度比較・初期状態出力プログラムの生成を示す図である。It is a figure which shows the production | generation of an initial state (stage) difficulty measurement program and the production | generation of a difficulty comparison / initial state output program. テストプログラムの生成を示す図である。It is a figure which shows the production | generation of a test program. ゲームプログラム生成プログラムの動作のフローである。It is a flow of operation of a game program generation program. 一実施形態のハードウエア構成を示す図である。It is a figure which shows the hardware constitutions of one Embodiment.

複数の実施形態について図面を参照しながら説明する。   A plurality of embodiments will be described with reference to the drawings.

以下に示す複数の実施形態は、様々なゲームに対して適用でき、ゲームのルールの仕様に依存するものではない。また、以下の実施形態は、ゲームに関するプログラムの製作に適用できるのは勿論のこと、例えば交通や運輸のシミュレーションなど、特定の対象に適用される所定のルールに基づいて状態が変化する対象を取り扱うプログラムなどにも有効に利用できる。   A plurality of embodiments shown below can be applied to various games and do not depend on the rules of the game rules. In addition, the following embodiment can be applied to the production of a program related to a game, and handles objects whose state changes based on a predetermined rule applied to a specific object such as a simulation of traffic or transportation. It can be used effectively for programs.

なお、以下の実施形態の説明においては、具体的なゲームを例に説明を行うことが、各実施形態の理解を助けることとなる。このため、主に三目並べのゲームを例にして、各実施形態の説明を行う。上述のように、三目並べのゲームは、例示であって、実施形態は、三目並べのゲームにのみ適用できる技術でないことは言うまでもない。なお、実施形態によっては、説明の都合上、三目並べ以外のゲームのルールを例示して説明を行う場合がある。   In the following description of the embodiments, a specific game will be described as an example to help understanding each embodiment. For this reason, each embodiment will be described mainly using a game of tic-tac-toe as an example. As described above, the tic-tac-toe game is an example, and it goes without saying that the embodiment is not a technique that can be applied only to the tic-tac-toe game. Note that, depending on the embodiment, for the convenience of explanation, there may be a case where a game rule other than tic-tac-toe is illustrated as an example.

<三目並べのゲームのルール>
まず、三目並べのゲームのルールについて簡潔に説明する。
図1(A)は、三目並べの盤面を示している。盤面には、9つのマス目の陣地がある。9つの陣地の位置を示すために、各列に1、2、3の番号が付されており、各行にa、b、cの英文字が付されている。各陣地の位置は、例えば、[1a]、[1b]、[1c]、[2a]、[2b]・・・などの数字と英文字の組合せで特定される。
図1(A)においては、先手が〇、後手が×であり、以下の順でゲームが進行している。
1a〇、3a×、2b〇、3b×、3c〇
この時点において、先手〇は、直線に並んだ3マスの列[1a]、[2b]、[3c]に〇を並べることができたので、先手〇の勝ちとなる。
<Tic-tac-toe game rules>
First, the rules for the tic-tac-toe game will be briefly explained.
FIG. 1 (A) shows a board surface arranged in a three-dimensional pattern. There are nine square positions on the board. In order to indicate the positions of the nine positions, numbers 1, 2, and 3 are assigned to each column, and letters a, b, and c are assigned to each row. The position of each base is specified by a combination of numbers and letters such as [1a], [1b], [1c], [2a], [2b].
In FIG. 1A, the leading hand is ◯ and the trailing hand is ×, and the game is progressing in the following order.
1a〇, 3a ×, 2b〇, 3b ×, 3c〇 At this point, because the predecessor 〇 was able to line up 〇 in three square columns [1a], [2b], [3c] , Will win first.

図1(B)は、他のゲームの進展の例であり、先手〇及び後手×共に、直線に並んだ3マスの列の陣地を取ることができなかったため、引き分けに終わった例である。
なお、以下の説明においては、縦、横、斜めのいずれであっても「直線に並んだ3つのマス」を単に「列」と称す。
FIG. 1 (B) is an example of progress of another game, in which both the first hand and the second hand x cannot be taken in a three-column lined up in a straight line, and thus are drawn.
In the following description, “three cells arranged in a straight line” are simply referred to as “columns” regardless of whether they are vertical, horizontal, or diagonal.

<実施形態1>
<<ゲームのルール仕様の定義の例>>
人間がプログラムのコーディングをすることは、非常に煩雑な作業を行わなければならない。また、ゲームの仕様が変更された場合などでは、ゲームのプログラムを修正するという極めて手間のかかる作業を強いられることとなる。
<Embodiment 1>
<< Example of game rule specification definition >>
Human coding of the program has to be very complicated. In addition, when the game specifications are changed, for example, the laborious work of correcting the game program is forced.

このため、人間がゲームの仕様の作成に専念できるようにして、その後のゲームプログラムのコーディング作業については、人間の手を煩わせることをできるだけ排除できれば、ゲームプログラムを作成するための労力を大幅に削減できる。また、ゲームの仕様を変更するような場合においても、プログラムの手直しなどにかかる労力を削減できる。   For this reason, if humans can concentrate on creating game specifications, and the subsequent game program coding work can eliminate the human work as much as possible, the effort to create game programs will be greatly reduced. Can be reduced. Further, even when the game specifications are changed, labor required for reworking the program can be reduced.

このためには、ゲームのルールの仕様を適切に定義する手法が確立されていることが重要である。以下に説明するゲームのルール仕様の定義の例は、以上のような背景のもとに提案されたものである。   To this end, it is important that a method for appropriately defining the game rule specifications is established. The definition examples of the game rule specifications described below are proposed based on the above background.

<<ゲームルール処理プログラムがなす仕事>>
ゲームルール処理プログラムは、以下の処理を行うことで進行し終了する。すなわち、ゲーム処理の本質を列挙すれば以下のとおりである。
(1)プレイヤーの指示により、どのようなアクションを実行できるのかゲーム装置が判定あるいは列挙すること。
(2)プレイヤーによって指示されたアクションをゲーム装置が実行できるのか否かを確認し、実行できる場合には、実行して、実行の前後のゲームの状態の変化を特定し、実行した後の状態を保持すること。
(3)ゲームの状態をチェックすることで、いずれかのプレイヤーが勝利しているか、あるいはいずれのプレイヤーも勝利していないかをゲーム装置が判定すること。
<< Work done by game rule processing program >>
The game rule processing program proceeds and ends by performing the following processing. That is, the essence of the game process is enumerated as follows.
(1) The game device determines or enumerates what actions can be executed according to the player's instructions.
(2) Check whether or not the game device can execute the action instructed by the player, and if it can be executed, execute it, identify the change in the state of the game before and after execution, and state after execution To hold.
(3) The game device determines whether any player has won or no player has won by checking the state of the game.

以上の3点が把握できれば、ゲームルール処理プログラムによってゲーム装置は、ゲームの処理を遂行することが可能である。より具体的には、以上の3点を把握しつつ以下のようにして、ゲームプログラムは、ゲーム装置にゲーム処理を遂行させることができる。   If the above three points can be grasped, the game device can execute the game processing by the game rule processing program. More specifically, the game program can cause the game device to perform a game process as follows while grasping the above three points.

(n1)ゲーム装置が、プレイヤーに(初期の)状態を提示する。
(n2)ゲーム装置が、プレイヤーにより現在実行可能なアクションをプレイヤーに提示する。
(n3)プレイヤーによっていずれかのアクションが選択され、選択されたアクションがゲーム装置によって実行される。
(n4)選択されたアクションによる後の状態をゲーム装置が認識することでゲームの決着がついたか否か判定し、決着になるまでn2ないしn4を繰り返す。
(N1) The game device presents the (initial) state to the player.
(N2) The game device presents the player with an action that can be currently executed by the player.
(N3) One of the actions is selected by the player, and the selected action is executed by the game device.
(N4) The game device recognizes the state after the selected action to determine whether or not the game is settled, and repeats n2 to n4 until the game is settled.

なお、プレイヤーに対して、実行可能なアクションを列挙(提示)しないゲームの場合には、上記(n1)ないし(n4)は、以下のような処理であってもよい。   In the case of a game that does not enumerate (present) executable actions for the player, the above (n1) to (n4) may be the following processes.

(m1)ゲーム装置が、プレイヤーに(初期の)状態を提示する。
(m2)ゲーム装置が、プレイヤーにより選択されたアクションが、実行可能なアクションかをチェックする。
(m3)プレイヤーにより選択されたアクションがゲーム装置によって実行可能であれば、選択されたアクションがゲーム装置によって実行される。実行不可能なアクションの選択がなされた場合には、ゲーム装置がその旨を報知する。
(m4)アクションが実行されれば、実行されたアクションによる後の状態をゲーム装置が認識することでゲームの決着かついたか否か判定し、決着になるまでm2ないしm4を繰り返す。
(M1) The game device presents the (initial) state to the player.
(M2) The game device checks whether the action selected by the player is an executable action.
(M3) If the action selected by the player can be executed by the game device, the selected action is executed by the game device. If an action that cannot be executed is selected, the game device notifies that fact.
(M4) If the action is executed, it is determined whether or not the game has been settled by recognizing the later state by the executed action, and m2 to m4 are repeated until the game is settled.

このような処理を行うゲーム装置で動作するゲームプログラムの生成にあたって、本実施形態を適用する場合のゲーム製作者の主な作業は、自分が製作しているゲームのルールにおいて、上記(1)、(2)及び(3)がそれぞれどのように定義されるのかについて、例えば形式言語を用いてルール仕様を記述することである。   In generating a game program that operates on a game device that performs such processing, the main work of the game producer when applying the present embodiment is the above-mentioned (1), Regarding how (2) and (3) are defined, a rule specification is described using a formal language, for example.

以下では、実施形態として、ゲームのルール仕様を一階述語論理に基づいた形式言語で記述する方法について述べるが、ルール仕様を形式的に書き表すことができればよいのであって、言語の具体的な定義は以下で述べるものに限定されない。   In the following, a method for describing a rule specification of a game in a formal language based on first-order predicate logic will be described as an embodiment. Is not limited to those described below.

<<ゲームのルールの仕様の定義の手法>>
(a)仕様の構成要素1:述語、命題、論理式
述語を用いて、ゲームのルールの定義を表現する例を以下に示す。
例えば、「[位置]は空欄である」という述語を例に説明する。ここで、[位置]は、述語「[位置]は空欄である」の項を表す。
本実施形態では、述語の項のことを引数と表現し、[ ]を用いて表現する(なお、本明細書において「引数」の語は、ある関数に引き渡す値を意味する用語としても用いられる場合がある。)。例えば、

[位置]は[手番]の陣地である (式1)

という(式1)で示される述語に対して、図1(A)において、具体的に[位置]=[1a]及び[手番]=[先手]を当てはめれば、

[1a]は[先手]の陣地である (式2)

という命題となる。図1Aにおいて位置[1a]には「〇」が入っているから先手の陣地であり、(式2)で表現された命題の真偽(真理値)は、「真」である。
<< Method for defining game rule specifications >>
(A) Specification component 1: predicate, proposition, logical expression An example of expressing a game rule definition using a predicate is shown below.
For example, a predicate “[position] is blank” will be described as an example. Here, [position] represents a term of the predicate “[position] is blank”.
In the present embodiment, the term of the predicate is expressed as an argument and expressed using [] (in this specification, the term “argument” is also used as a term meaning a value passed to a certain function. May be.) For example,

[Position] is the position of [Stage] (Formula 1)

For the predicate expressed by (Equation 1), in FIG. 1 (A), [position] = [1a] and [number] = [first move] are specifically applied,

[1a] is the [first] position (Formula 2)

It becomes a proposition. In FIG. 1A, “◯” is entered at position [1a], which is the leading position, and the truth (truth value) of the proposition expressed by (Expression 2) is “true”.

また、例えば、

[位置]は空欄である (式3)

という述語(式3)に対して、図1(A)において、具体的に[位置]=[3c]を当てはめれば、

[3c]は空欄である (式4)

という命題(式4)となる。図1Aにおいて位置[3c]は、「〇」が入っており空欄ではないから、(式4)の命題の真偽は、「偽」である。
また、以下の(式5)は、論理式の一例である。

∃[位置],[位置]は[先手]の陣地でありかつ[位置]は[後手]の陣地でない (式5)
For example,

[Position] is blank (Formula 3)

If we specifically apply [position] = [3c] in FIG. 1 (A) to the predicate (Equation 3),

[3c] is blank (Formula 4)

This is the proposition (Formula 4). In FIG. 1A, since the position [3c] contains “◯” and is not blank, the truth of the proposition in (Expression 4) is “false”.
The following (Formula 5) is an example of a logical expression.

∃ [Position] and [Position] are [First] positions and [Position] is not [Back] positions (Formula 5)

この論理式(式5)は、図1Aに関しては、具体的に[位置]=[3c]を当てはめれば、位置[3c]には、「〇」が入っているから、「位置[3c]は先手の陣地でありかつ位置[3c]は後手の陣地でないという位置[3c]が少なくとも1つ存在する」ことになるから、論理式(式5)の真偽は、「真」である。 With respect to FIG. 1A, this logical formula (Formula 5) is specifically set to [Position [3c] because [Position] = [3c] is applied to the position [3c]. Since there is at least one position [3c] in which the position of [3c] is not the position of the rear hand and position [3c] is not the position of the rear hand, the truth of the logical expression (Formula 5) is “true”.

(b)仕様の構成要素2:ゲーム中で用いられる引数(述語の項)
ゲームのルールの定義においては、ゲームにおける引数の取り得るバリエーションを定義しておくことが望ましい。例えば、図1の三目並べのゲームにおいては、引数の取り得るバリエーションは、「1a、2a、3a、1b、2b、3b、1c、2c、3c、先手、後手」である。三目並べのゲームの場合には、[4a]という位置は存在しないから、そのような位置に陣地を取ることはできない。このため、引数[4a]は、存在し得ない引数であるとゲーム装置が判断するよう、例えば初期状態の定義中に引数の取り得る範囲をも定めておくことが望ましい。なお、ゲームの仕様を表す命題の数は、ゲームを遂行するにあたり、合理的な数を作成しておくことが望ましい。
(B) Specification component 2: Argument used in the game (predicate term)
In the definition of the game rules, it is desirable to define the possible variations of arguments in the game. For example, in the tic-tac-toe game of FIG. 1, the possible variations of the arguments are “1a, 2a, 3a, 1b, 2b, 3b, 1c, 2c, 3c, first hand, second hand”. In a tic-tac-toe game, the position [4a] does not exist, so you cannot take a position at such a position. For this reason, for example, it is desirable to set a range that the argument can take during the definition of the initial state so that the game apparatus determines that the argument [4a] is an argument that cannot exist. It should be noted that it is desirable to create a reasonable number of propositions representing game specifications in order to execute the game.

<<ゲームのルールの仕様の構成要素>>
ゲームのルールの仕様は、以下の構成要素を有する。
(F1)ゲームの初期状態の定義
(F2)プレイヤーによって指示され得るアクションの定義
(F3)ゲームの終了条件(勝敗、引き分けなど)の定義
ゲームのルールの仕様は、上記の(F1)ないし(F3)で定義できる。以下、これらの構成要素について説明する。
<< Components of game rule specifications >>
The game rule specification has the following components.
(F1) Definition of initial state of game (F2) Definition of action that can be instructed by player (F3) Definition of game end condition (win / lose, draw, etc.) The rules of the game rules are the above (F1) to (F3) ). Hereinafter, these components will be described.

(F1)ゲームの初期状態の定義
ゲームを開始する際に真である命題の全てを少なくとも含む命題の集合が列記されていることにより、ゲームが開始されるときの状態が定義され得る。
たとえば、三目並べのゲームのルールであれば、真の値を取り得る全ての命題のリストが初期状態を表すこととなる。以下に、その例を示す。「,」は、各命題の区切りを示している。
(F1) Definition of initial state of game A set of propositions including at least all of the propositions that are true when the game is started is listed, so that a state when the game is started can be defined.
For example, in the case of a tic-tac-toe game rule, a list of all propositions that can take a true value represents the initial state. An example is shown below. “,” Indicates a break between propositions.

(三目並べの初期状態を表す真の命題のリストの例) (式6)
[1a]は空欄である, [1b]は空欄である, [1c]は空欄である,
[2a]は空欄である, [2b]は空欄である, [2c]は空欄である,
[3a]は空欄である, [3b]は空欄である, [3c]は空欄である,
[1a]は位置である, [1b]は位置である, [1c]は位置である,
[2a]は位置である, [2b]は位置である, [2c]は位置である,
[3a]は位置である, [3b]は位置である, [3c]は位置である,
[1a] [1b] [1c]は列である, [2a] [2b] [2c]は列である, [3a] [3b] [3c]は列である,
[1a] [2a] [3a]は列である, [1b] [2b] [3b]は列である, [1c] [2c] [3c]は列である,
[1a] [2b] [3c]は列である, [3a] [2b] [1c]は列である,
[先手]の手番である, [後手]の手番でない
(Example of a list of true propositions representing the initial state of tic-tac-toe)
[1a] is blank, [1b] is blank, [1c] is blank,
[2a] is blank, [2b] is blank, [2c] is blank,
[3a] is blank, [3b] is blank, [3c] is blank,
[1a] is the position, [1b] is the position, [1c] is the position,
[2a] is a position, [2b] is a position, [2c] is a position,
[3a] is a position, [3b] is a position, [3c] is a position,
[1a] [1b] [1c] is a sequence, [2a] [2b] [2c] is a sequence, [3a] [3b] [3c] is a sequence,
[1a] [2a] [3a] is a row, [1b] [2b] [3b] is a row, [1c] [2c] [3c] is a row,
[1a] [2b] [3c] is a sequence, [3a] [2b] [1c] is a sequence,
[First move], not [Second move]

上記(式6)に列挙された命題の全てが真である状態は、三目並べの初期状態の一例である。初期状態を定義するには、初期状態において真である命題の全てが少なくとも列挙されていればよい。なお、真偽の両者の命題が含まれる場合には、例えば真理値表又はフラグなどを用いて、各命題の真偽がわかるようにすればよい。初期状態以外の任意の時点のゲームの状態も、その任意の時点において、真である命題の全てが少なくとも列挙されていれば、その時点の状態を適切に表現することができる。なお、例えば、「[1a]は位置である」という真の命題は、「[後手]は位置である」などの、存在し得ない命題がゲームの状態に混入することを避けるために、定義しておくことが望ましい。また、上記の定義のように、初期状態の定義において、引数の取り得る範囲も定義されていることが望ましい。   A state in which all of the propositions listed in (Equation 6) are true is an example of an initial state of a tic-tac-toe layout. To define the initial state, at least all of the propositions that are true in the initial state need be listed. In addition, when both the truth and false propositions are included, for example, a truth table or a flag may be used so that the truth of each proposition is known. As for the state of the game at any time other than the initial state, the state at that time can be appropriately expressed as long as all the propositions that are true at that time are listed. For example, the true proposition “[1a] is a position” is defined to avoid a proposition that cannot exist such as “[Back] is a position” from being mixed in the game state. It is desirable to keep it. In addition, as in the above definition, it is desirable that the range that the argument can take is defined in the definition of the initial state.

なお、上記の三目並べの初期状態を表す真の命題のリストの例(式6)では、真の命題だけが含まれる形式となっているが、ゲームにおいて存在し得る合理的な数の命題全てを含むように、初期状態を表す命題のリストを作成してもよい。この場合には、初期状態を表す命題のリストには、上述のように例えば命題が真であるか偽であるかを表すフラグが付け加えられる。この場合には、状態を表す命題のリストに含まれる命題の総数Nは、ゲームの各場面を通じて変化しないこととなる。   In the above example of the list of true propositions representing the initial state of the tic-tac-toe layout (formula 6), only the true proposition is included, but a reasonable number of propositions that can exist in the game. A list of propositions representing the initial state may be created so that all are included. In this case, for example, as described above, a flag indicating whether the proposition is true or false is added to the list of propositions indicating the initial state. In this case, the total number N of propositions included in the list of propositions representing states does not change throughout each scene of the game.

(F2)プレイヤーによって指示され得るアクションの定義
次に、プレイヤーによって指示され得るアクションの定義の手法について述べる。プレイヤーによって指示され得るアクションの定義は、例えば、以下の構成要素を含む。
(F2−1)引数の列挙
(F2−2)アクションが実行されるための前提条件となる論理式
(F2−3)アクションが実行された後に真になる命題のリスト
(F2−4)アクションが実行された後に偽になる命題のリスト
(F2) Definition of Action that can be Instructed by Player Next, a method for defining an action that can be instructed by the player will be described. The definition of the action that can be instructed by the player includes, for example, the following components.
(F2-1) Enumeration of arguments (F2-2) A logical expression which is a precondition for executing the action (F2-3) A list of propositions that become true after the action is executed (F2-4) A list of propositions that are false after they have been executed

上記(F2−1)で引数を列挙する理由は、その後の(F2−2)、(F2−3)及び(F2−4)において定義される述語或いは論理式において、どのような項(引数)が含まれているかを簡便に把握するためである。(F2−1)で引数を列挙しておくことで、プレイヤーによって指示され得るアクションを網羅的に探索したり、アクションが実行可能か否かを判断したり、具体的なアクションを特定したりするプログラムを生成することがより容易になる。したがって、「(F2−1)引数の列挙」を、プレイヤーによって指示され得るアクションの定義に含ませておくことが望ましい。   The reason for enumerating the arguments in (F2-1) is that any term (argument) in the predicates or logical expressions defined in the following (F2-2), (F2-3) and (F2-4) This is for easily grasping whether or not the content is included. By enumerating the arguments in (F2-1), it is possible to exhaustively search for actions that can be instructed by the player, determine whether or not the actions can be executed, and specify specific actions. It becomes easier to generate the program. Therefore, it is desirable to include “(F2-1) Enumeration of arguments” in the definition of actions that can be instructed by the player.

三目並べの場合には、指示され得るアクションの定義は、例えば、以下のようになる。
(F2−1)引数の列挙:[手番1], [手番2], [位置]
(F2−2)アクションが実行されるための前提条件となる論理式
[位置]は位置である, かつ
[位置]は空欄である, かつ
[手番1]の手番である, かつ
[手番2]の手番でない,
(F2−3)アクションが実行された後に真になる命題のリスト
[位置]は[手番1]の陣地である,
[手番2]の手番である,
[手番1]の手番でない
(F2−4)アクションが実行された後に偽になる命題のリスト
[位置]は空欄である,
[手番1]の手番である,
[手番2]の手番でない
In the case of tic-tac-toe, the definition of actions that can be instructed is as follows, for example.
(F2-1) Enumeration of arguments: [number 1], [number 2], [position]
(F2-2) Logical expression as a precondition for the action to be executed
[Position] is the position, and
[Position] is blank, and
[Number 1] is the turn, and
It ’s not the turn of [number 2],
(F2-3) List of propositions that become true after the action is executed
[Position] is the position of [Number 1],
[Number 2] is the turn,
A list of propositions that are false after the action is executed.
[Position] is blank,
The turn of [Number 1],
Not a turn of [number 2]

たとえば、初期状態において、先手が、位置[1a]に陣地を取る(1aに○を打つ)場合には、上記の具体的アクションは以下のようになる。   For example, in the initial state, when the front mover takes a position at position [1a] (struck 1a), the above specific action is as follows.

(f2−1)引数の列挙:[先手], [後手], [1a]
(f2−2)アクションが実行されるための前提条件となる論理式
[1a]は位置である, かつ
[1a]は空欄である, かつ
[先手]の手番である, かつ
[後手]の手番でない,
(f2−3)アクションが実行された後に真になる命題のリスト
[位置]は[先手]の陣地である,
[後手]の手番である,
[先手]の手番でない
(f2−4)アクションが実行された後に偽になる命題のリスト
[1a]は空欄である,
[先手]の手番である,
[後手]の手番でない
(F2-1) Enumeration of arguments: [first hand], [second hand], [1a]
(F2-2) Logical expression as a precondition for the action to be executed
[1a] is the position, and
[1a] is blank, and
The [first move] turn, and
It ’s not a [second] turn,
(F2-3) A list of propositions that become true after the action is executed
[Position] is [Predecessor] position,
The [second] turn,
A list of propositions that are false after the action is executed.
[1a] is blank,
The [first move] turn,
It ’s not a [second] turn

初期状態の場合、アクションが実行されるための前提条件となる論理式(f2−2)は、真であるから、アクションが実行され得る前提条件を満足する。   In the initial state, since the logical expression (f2-2), which is a precondition for executing the action, is true, the precondition that the action can be executed is satisfied.

そして、アクションが実行された場合には、アクションの実行後に、ゲームの状態を更新する必要がある。このため、アクションが実行された後に真になる命題のリストである(f2−3)に列挙された命題のリストを、初期状態の命題のリストに加える。そして、アクションが実行された後に偽になる命題のリストである(f2−4)に列挙された命題のリストを取り除くか、又はこれらの命題が偽である旨のフラグを付するなどの処理を行う。   When the action is executed, it is necessary to update the game state after the execution of the action. For this reason, the list of propositions listed in (f2-3), which is a list of propositions that become true after the action is executed, is added to the list of propositions in the initial state. Then, processing such as removing the list of propositions listed in (f2-4), which is a list of propositions that become false after the action is executed, or adding a flag indicating that these propositions are false is performed. Do.

以上の処理によって、状態を表す命題のリストが現在の状態を表すように更新されることとなる。なお、状態を表す命題のリストは、例えば記憶装置にテーブル(真理値表)の形式で保存することで実現できる。   Through the above processing, the list of propositions representing the state is updated to represent the current state. Note that a list of propositions representing states can be realized by storing the list in a storage device in the form of a table (truth table), for example.

(F3)ゲームの終了条件(勝敗、引き分けなど)の定義
通常のゲームの場合には、キャラクター同士を何らかの競技で対戦させる形式や、キャラクターを操作してゴールに到達させるなど何らかの目的を達成させる形式でゲームが進行する場合が多い。このようなゲームでは、勝敗が決まれば、ゲームは終了するか、次のゲームステージに移る場合が多い。また、勝敗が決まらずに、引き分ける場合もある。
以上のようなゲームの一区切りを判断する条件が定義される。これを、本実施形態では、ゲームの終了条件と呼ぶ。
ゲームの終了条件の定義は、例えば、ゲームの状態を監視し、ゲームの状態が終了条件を満足したときに真となる論理式を定義することによって実現できる。
三目並べの場合には、以下の論理式が、ゲームの終了条件を与える。
(F3) Definition of game end conditions (win / lose, draw, etc.) In the case of a normal game, a form that allows characters to fight each other in some kind of competition, or a form that achieves some purpose such as operating characters to reach a goal In many cases, the game progresses. In such a game, if winning or losing is decided, the game is often ended or moved to the next game stage. In addition, there are cases in which a draw is made without winning or losing.
Conditions for determining a break of the game as described above are defined. In the present embodiment, this is called a game end condition.
The game end condition can be defined, for example, by monitoring the game state and defining a logical expression that is true when the game state satisfies the end condition.
In the case of tic-tac-toe, the following logical expression gives the game end condition.

(f3−1)先手の勝ちの論理式(真の場合)
∃[位置1], [位置2], [位置3],
[位置1]は[先手]の陣地であり、かつ
[位置2]は[先手]の陣地であり、かつ
[位置3]は[先手]の陣地であり、かつ
[位置1] [位置2] [位置3]は列である
(F3-1) Formula of winning first (if true)
∃ [Position 1], [Position 2], [Position 3],
[Position 1] is the [first] position, and
[Position 2] is the [first] position, and
[Position 3] is the [first] position, and
[Position 1] [Position 2] [Position 3] is a row

(f3−2)後手の勝ちの論理式(真の場合)
∃[位置1], [位置2], [位置3],
[位置1]は[後手]の陣地であり、かつ
[位置2]は[後手]の陣地であり、かつ
[位置3]は[後手]の陣地であり、かつ
[位置1] [位置2] [位置3]は列である
(F3-2) Winning logical formula (if true)
∃ [Position 1], [Position 2], [Position 3],
[Position 1] is the [Back] base, and
[Position 2] is the [Back] base, and
[Position 3] is the [Back] base, and
[Position 1] [Position 2] [Position 3] is a row

(f3−3)引き分けの論理式
(f3−1)の論理式が偽であり、かつ(f3−2)の論理式が偽であり、かつ「∃[位置], [位置]は空欄」の論理式が偽である
(F3-3) Draw logical expression The logical expression of (f3-1) is false, the logical expression of (f3-2) is false, and “∃ [position], [position] is blank” The logical expression is false

上記の条件が満足されれば、三目並べの勝敗又は引き分けが判定され、三目並べのゲームが終了する。   If the above-mentioned conditions are satisfied, the winning / losing or drawing of the tic-tac-toe is determined, and the tic-tac-toe game ends.

<実施形態の全体構成>
図2は、実施形態の概略を示す図である。
まず、ゲームルールの仕様202が与えられる。このゲームルールの仕様は、ゲームを開発した者が作成することとなる。ゲームルールの仕様については、実施形態1の「ゲームのルールの仕様の定義」で述べたように、以下の3要素が定義されることである。
(F1)ゲームの初期状態の定義
(F2)プレイヤーによって指示され得るアクションの定義
(F3)ゲームの終了条件(勝敗、引き分けなど)の定義
そして、ゲームルールの仕様202は、ゲームルール処理プログラム生成部220に入力される。
<Overall Configuration of Embodiment>
FIG. 2 is a diagram showing an outline of the embodiment.
First, a game rule specification 202 is given. The specification of this game rule is created by the person who developed the game. As described in “Definition of Game Rule Specifications” in the first embodiment, the following three elements are defined for the game rule specifications.
(F1) Definition of initial state of game (F2) Definition of action that can be instructed by player (F3) Definition of game end condition (win / lose, draw, etc.) And game rule specification 202 is a game rule processing program generation unit 220.

ゲームルール処理プログラム生成部220は、仕様情報解析部220a、実装情報作成部220b、アノーテーション付加部220c、プログラミング言語生成部220dを具備する。   The game rule processing program generation unit 220 includes a specification information analysis unit 220a, a mounting information generation unit 220b, an annotation addition unit 220c, and a programming language generation unit 220d.

仕様情報解析部220aは、例えば、ゲームルールの仕様が、「ゲームの初期状態の定義」、「プレイヤーによって指示され得るアクションの定義」、「ゲームの終了(勝敗、引き分けなど)の定義」のいずれかに少なくとも分類する。分類された仕様を、実装情報作成部220bに渡す。
実装情報作成部220bの具体的な動作は、図3ないし図6の説明において詳述する。
For example, the specification information analysis unit 220a has a game rule specification of “definition of initial state of game”, “definition of action that can be instructed by player”, or “definition of game end (win / lose, draw, etc.)”. At least classify it. The classified specifications are passed to the mounting information creation unit 220b.
The specific operation of the mounting information creation unit 220b will be described in detail in the description of FIGS.

アノーテーション付加部は、その後段に位置するプログラミング言語生成部220dにおいて、具体的なプログラミング言語プログラムが生成されるときに、プログラムに適切なアノーテーション(コメント)を付す情報を提供する。このアノーテーションは、UI、映像出力機能等を有する汎用プログラム282が提供するAPI280とのインタフェースを取る際に、プログラム開発者によって利用される情報となる。このアノーテーション付加部220cの動作の詳細は、後述する。   When a specific programming language program is generated in the programming language generation unit 220d located in the subsequent stage, the annotation addition unit provides information for attaching an appropriate annotation (comment) to the program. This annotation is information used by the program developer when interfacing with the API 280 provided by the general-purpose program 282 having a UI, a video output function, and the like. Details of the operation of the annotation adding unit 220c will be described later.

プログラミング言語生成部220dは、たとえばC言語などの具体的なプログラミング言語の文法に準拠した具体的なプログラムを生成する。この具体的なプログラムは、実装情報作成部220bとアノーテーション付加部220cからの情報を用いて、モジュール化されたプログラムの適切な場所にアノーテーションを付加することで、生成される。生成されたプログラムは、ゲームルール処理プログラム250となる。プログラミング言語生成部220dの処理の詳細は、図3ないし図6の説明において詳述する。   The programming language generation unit 220d generates a specific program that conforms to the grammar of a specific programming language such as C language. This specific program is generated by adding an annotation to an appropriate location of the modularized program using information from the mounting information creating unit 220b and the annotation adding unit 220c. The generated program becomes the game rule processing program 250. Details of the processing of the programming language generation unit 220d will be described in detail with reference to FIGS.

また、各種プログラム生成部(320、420、520、620)は、プレイヤーシミュレーション(AI)プログラム350、初期状態(ステージ)難易度測定プログラム450、難易度比較・初期状態出力プログラムモジュール550、テストプログラム650を出力する。これらのプログラムは、ゲームルール処理プログラム250と連携して動作する。これらのプログラムの生成方法及びプログラムの機能については、図3ないし図6の説明において詳述する。   The various program generation units (320, 420, 520, 620) include a player simulation (AI) program 350, an initial state (stage) difficulty measurement program 450, a difficulty comparison / initial state output program module 550, and a test program 650. Is output. These programs operate in cooperation with the game rule processing program 250. These program generation methods and program functions will be described in detail with reference to FIGS.

そして、ゲームルール処理プログラム250は、UI、映像出力等の機能を有する汎用プログラム282及びオペレーティングシステム284に対して、直接又はAPI280を経由して情報の授受を行う。プログラム作成者は、ゲームルール処理プログラムのアノーテーションを参照することで、ゲームルール処理プログラム250とAPI280との情報の授受が行える付加的なプログラムを容易に作成することができる。   Then, the game rule processing program 250 exchanges information directly or via the API 280 with respect to the general-purpose program 282 and the operating system 284 having functions such as UI and video output. The program creator can easily create an additional program that can exchange information between the game rule processing program 250 and the API 280 by referring to the annotation of the game rule processing program.

<実施形態2>ゲームルール処理プログラムの生成
以下に、ゲームルール処理プログラムを生成する実施形態を説明する。
図3は、ゲームルール処理プログラム生成部の処理の内容を示した図である。
ゲームルールの仕様202については、「実施形態の全体構成」で既に説明した。
ゲームルール処理プログラム生成部220の各機能と、生成されるゲームルール処理プログラム250について、以下に説明する。
なお、図2と図3との対応関係は以下のとおりである。
図3におけるテーブル作成プログラム生成部222、実行可能アクション特定プログラム生成部224、アクション受取プログラム生成部226、アクション実行プログラム生成部228、テープル更新プログラム生成部230及びゲーム終了プログラム生成部232は、図2における仕様情報解析部220a、実装情報作成部220b及びプログラミング言語生成部220dに対応しており一体化して描かれている点に留意すべきである。
<Embodiment 2> Generation of Game Rule Processing Program An embodiment for generating a game rule processing program will be described below.
FIG. 3 is a diagram showing the contents of the process of the game rule processing program generation unit.
The game rule specification 202 has already been described in “Overall Configuration of Embodiment”.
Each function of the game rule processing program generation unit 220 and the generated game rule processing program 250 will be described below.
The correspondence between FIG. 2 and FIG. 3 is as follows.
The table creation program generation unit 222, executable action identification program generation unit 224, action reception program generation unit 226, action execution program generation unit 228, table update program generation unit 230, and game end program generation unit 232 in FIG. It should be noted that the specification information analysis unit 220a, the mounting information creation unit 220b, and the programming language generation unit 220d in FIG.

なお、図2及び図3におけるアノーテーション付加部220cは、実施形態7において後述する。(図4ないし図6では、図を簡略化するためアノーテーション付加部220cの記載を省略している。)   2 and 3 will be described later in the seventh embodiment. (In FIG. 4 thru | or FIG. 6, description of the annotation addition part 220c is abbreviate | omitted in order to simplify a figure.)

・テーブル作成プログラム生成部222
まず、テーブル作成プログラム生成部222は、テーブル作成プログラムモジュール252を作成する。テーブルとは、ゲームの状態をメモリ部に格納する状態テーブル264を指す。テーブル作成プログラムモジュール252は、ゲームを始めるにあたって、状態テーブル264の領域をメモリに確保し、ゲームの初期状態を状態テーブル264に格納する機能を有する。
Table creation program generation unit 222
First, the table creation program generator 222 creates a table creation program module 252. The table refers to a state table 264 that stores the state of the game in the memory unit. The table creation program module 252 has a function of securing the area of the state table 264 in the memory and starting the game in the state table 264 when starting the game.

三目並べの場合には、(式6)で提示した初期状態をテーブルに格納する。テーブルへの格納の手法としては、それぞれの命題を所定のフォーマットでメモリに記述することにより達成される。たとえば、「[3a]は空欄である」という真の命題は、

[3a],空欄である,真 (式7)

上記(式7)のようなエントリーを表形式でメモリに格納するようにすればよい。
In the case of tic-tac-toe, the initial state presented in (Equation 6) is stored in a table. The method of storing in a table is achieved by describing each proposition in a memory in a predetermined format. For example, the true proposition “[3a] is blank”

[3a], blank, true (Equation 7)

An entry like the above (Formula 7) may be stored in a memory in a table format.

テーブル作成プログラム生成部222は、この初期状態をあらかじめ保存しておき、ゲームの起動時に、この初期状態をメモリに展開する具体的なプログラムを作成することで、テーブル作成プログラムモジュール252が作成される。
作成されたテーブルは、状態テーブル264の初期状態となる。
三目並べの場合、生成されるテーブル作成プログラムモジュール252は、例えば、以下のようなプログラムモジュールで状態テーブル264を作成することができる。
以下のプログラムの場合、三目並べにおける命題の総数をNとする。各命題に1からNの番号を割り振る。
The table creation program generation unit 222 stores the initial state in advance, and creates a specific program for developing the initial state in the memory when the game is started, so that the table creation program module 252 is created. .
The created table is the initial state of the state table 264.
In the case of tic-tac-toe, the generated table creation program module 252 can create the status table 264 with the following program module, for example.
In the following program, N is the total number of propositions in the tic-tac-toe. Assign a number from 1 to N to each proposition.

(テーブル作成プログラムモジュール252の例)
1. サイズNの真理値テーブルTをメモリに確保;
2. for each (i = 1…N)
3. T[i] = 初期状態における命題iの値;
4. Tを出力;
以上のプログラムで、状態テーブル264が作成される。
(Example of table creation program module 252)
1. Secure truth table T of size N in memory;
2. for each (i = 1… N)
3. T [i] = value of proposition i in the initial state;
4. Output T;
The state table 264 is created by the above program.

・実行可能アクション特定プログラム生成部224
実行可能アクション特定プログラム生成部254は、実行可能アクション特定プログラムモジュール254を生成する。実行可能アクション特定プログラムモジュール254は、状態テーブル264に格納された現在のゲームの状態を参照し、ゲームが実行可能なアクションを特定し列挙する機能を有する。あるいは、プレイヤーにより特定されたアクションが実行可能なアクションか否かを、チェックする機能を更に有してもよい。
例えば、三目並べの場合、具体的な処理は以下のようになる。
Executable action specific program generation unit 224
The executable action specifying program generation unit 254 generates an executable action specifying program module 254. The executable action specifying program module 254 has a function of referring to the current game state stored in the state table 264 and specifying and enumerating actions that can be executed by the game. Or you may further have the function to check whether the action specified by the player is an action which can be performed.
For example, in the case of tic-tac-toe, specific processing is as follows.

状態テーブル264の現在のゲームの状態において、アクションが実行されるための前提条件となる論理式(F2−2)が、真となる引数の列挙(F2−1)を探索し特定することにより達成される。初期状態の場合には、位置の全ては空欄であるから、先手は、全ての位置に先手の陣地〇を打つことができる。具体的な実行可能なアクションを列挙すれば以下のとおりである。   In the current game state of the state table 264, the logical expression (F2-2), which is a precondition for executing the action, is achieved by searching and specifying the list of arguments (F2-1) that are true. Is done. In the initial state, since all the positions are blank, the first hand can hit the first hand position 0 at every position. The specific actions that can be executed are listed as follows.

(初期状態において実行可能なアクション)
[先手], [後手], [1a]
[先手], [後手], [1b]
[先手], [後手], [1c]
[先手], [後手], [2a]
[先手], [後手], [2b]
[先手], [後手], [2c]
[先手], [後手], [3a]
[先手], [後手], [3b]
[先手], [後手], [3c]
(Actions that can be executed in the initial state)
[First], [second], [1a]
[First], [second], [1b]
[First], [second], [1c]
[First], [second], [2a]
[First], [second], [2b]
[First], [second], [2c]
[First], [second], [3a]
[First], [second], [3b]
[First], [second], [3c]

このように、アクションの定義と、状態テーブル264とから、上記のような実行可能なアクションを抽出し特定するように、実行可能アクション特定プログラムモジュール254が生成される。   As described above, the executable action specifying program module 254 is generated so as to extract and specify the executable action as described above from the action definition and the state table 264.

三目並べの場合、生成される実行可能アクション特定プログラムモジュール254は、例えば、以下のようなプログラムで、実行可能なアクションのリストLを作ることができる。   In the case of tic-tac-toe, the executable action specifying program module 254 to be generated can create a list L of executable actions by using the following program, for example.

(実行可能アクション特定プログラムモジュール254の例)
1. 実行可能なアクションを収めるリストLを用意;
2. for each (アクションの候補となる網羅的なアクションのリストに列記されたアクションa)
3. if (現在の状態がアクションaの前提条件となる論理式(F2−2)を満たす)
4. Lにaを追加;
5. return L;
(Example of executable action identification program module 254)
1. Prepare a list L that contains actions you can perform;
2. for each (Action a listed in the comprehensive list of possible actions)
3. if (the current state satisfies the logical expression (F2-2) that is a precondition for action a)
4. Add a to L;
5. return L;

・アクション受取プログラム生成部226
アクション受取プログラム生成部226は、ゲーム装置において実行されるべきアクションの指示をプレイヤーの操作等272に基づいてプレイヤーから受け取るアクション受取プログラムモジュール256を生成する。ゲームのルールにも依存するが、ゲーム装置がプレイヤーに対して、選択可能なアクションを提示するルールの場合には、アクション受取プログラムモジュール256は、選択可能なアクションを、実行可能アクション特定プログラムモジュール254から受け取り、プレイヤーに提示すればよい。ゲーム装置がプレイヤーに対して、選択可能なアクションを提示しないルールの場合には、アクション受取プログラムモジュール256は、プレイヤーからのアクションの指示を受け取り、その情報を実行可能アクション特定プログラムモジュール254に渡して、指示されたアクションが実行可能かを問い合わせればよい。アクション受取プログラムモジュール256は、プレイヤーから指示された実行可能なアクションの情報を、後述するアクション実行プログラムモジュール258及びテーブル更新プログラムモジュール260に渡す。
アクション受取プログラム生成部226は、以上の処理を行うアクション受取プログラムモジュール256を生成する。
Action receiving program generation unit 226
The action receiving program generation unit 226 generates an action receiving program module 256 that receives an instruction of an action to be executed in the game device from the player based on the operation 272 of the player. Depending on the rules of the game, in the case of a rule in which the game device presents a selectable action to the player, the action receiving program module 256 executes the selectable action by the executable action specifying program module 254. And present it to the player. In the case where the game device does not present a selectable action to the player, the action receiving program module 256 receives an action instruction from the player and passes the information to the executable action specifying program module 254. It may be inquired whether the designated action can be executed. The action receiving program module 256 passes information on the executable action instructed by the player to the action execution program module 258 and the table update program module 260 described later.
The action receiving program generation unit 226 generates an action receiving program module 256 that performs the above processing.

・アクション実行プログラム生成部228
アクション実行プログラム生成部228は、プレイヤーにより指示されたアクション、及びゲームの状態の変化をゲーム装置に反映させるため、画像表示、音響出力などの指示を含むアクションの表示等270を出力するためのアクション実行プログラムモジュール258を生成する。アクション実行プログラムモジュール258は、アクション受取プログラムモジュール256から、プレイヤーの指示したアクションを取得する。また、現在のゲームの状態を、状態テーブル264から取得する。
Action execution program generation unit 228
The action execution program generation unit 228 outputs an action display 270 including instructions such as image display and sound output in order to reflect the action instructed by the player and the change in the game state on the game device. An execution program module 258 is generated. The action execution program module 258 acquires an action instructed by the player from the action receiving program module 256. Further, the current game state is acquired from the state table 264.

なお、出力されるアクションの表示等270は、API280を介してUI、映像出力機能等を有する汎用プログラム282に渡されるか、直接オペレーティングシステム284に渡される。なお、アクションの表示等270の出力を適切なAPI280へのコマンド又は適切なOS284へのコマンドに変換するためには、プログラム製作者が別途のインタフェースを作りこむことが必要となる場合がある。この場合には、生成されたプログラムモジュールに併記されたアノーテーションをプログラム製作者が参照することにより、上記インタフェースを製作することが容易化される。なお、アノーテーションについては、後述する。
三目並べの場合、生成されるアクション実行プログラムモジュール258は、例えば、以下のようなプログラムモジュールとなる。
The output action display 270 is passed to the general-purpose program 282 having a UI, a video output function, or the like via the API 280 or directly to the operating system 284. Note that in order to convert the output of the action display 270 or the like into an appropriate command to the API 280 or an appropriate command to the OS 284, it may be necessary for the program producer to create a separate interface. In this case, it is facilitated to produce the interface by referring to the annotation written together with the generated program module. Annotation will be described later.
In the case of tic-tac-toe, the generated action execution program module 258 is, for example, the following program module.

(アクション実行プログラムモジュール258の例)
1. 現在の状態のテーブルをTとする;
2. 実行するアクションをaとする;
3. 命題を覚えるリストLT、LFを用意する;
4. for each (アクションaが実行された後に真になる命題のリストに列記された命題p)
5. if (T[pの番号]が偽)
6. LTにpを追加;
7. for each (アクションaが実行された後に偽になる命題のリストに列記された命題p)
8. if (T[pの番号]が真)
9. LFにpを追加;
10. テーブル更新プログラムモジュール260にLT、LFを渡して、テーブル更新プログラムモジュール260を実行する;
11. return a、LT、LF;
以上の処理において、アクションa、アクションaが実行された後に偽から真になる命題のリストLT、アクションaが実行された後に真から偽になる命題のリストLFは、ゲーム装置において、映像効果のプログラム及び/又は音響効果のプログラムをゲームプログラム開発者が別途製作する際に有効に利用することができる。
このように本実施形態を適用することで、ゲームプログラム開発者は、ゲームルールの仕様の作成と、ゲームのアクションの映像効果又は音響効果のプログラムの作成とを切り分けて作業を遂行することができ、作業効率を高めることができる。
(Example of action execution program module 258)
1. Let T be the current state table;
2. Let a be the action to be performed;
3. Prepare lists L T and L F to remember propositions;
4. for each (proposition p listed in the list of propositions that are true after action a is executed)
5. if (T [p number] is false)
6. Add p to L T ;
7. for each (proposition p listed in the list of propositions that are false after action a is executed)
8. if (T [p number] is true)
9. Add p to L F ;
10. Pass L T and L F to the table update program module 260 to execute the table update program module 260;
11. return a, L T , L F ;
In the above processing, the list of propositions L T from false to true after the execution of action a and action a, and the list of propositions L F from true to false after execution of action a are displayed on the game device. The game program developer can effectively utilize the effect program and / or the sound effect program.
In this way, by applying this embodiment, the game program developer can perform the work by separating the creation of the game rule specification from the creation of the game action video effect or sound effect program. , Can increase the work efficiency.

・テーブル更新プログラム生成部230
テーブル更新プログラム生成部230は、ゲーム装置により実行されたアクションを基にして、状態テーブル264をアクション実行後の状態に更新する機能を有するテーブル更新プログラムモジュール260を生成する。
Table update program generator 230
The table update program generation unit 230 generates a table update program module 260 having a function of updating the state table 264 to the state after the action is executed based on the action executed by the game device.

三目並べの場合、例えば、先手が、位置[1a]に陣地を取る(1aに○を打つ)場合には、状態テーブル264に格納された現在の状態を表す真の命題のリストに対して、上述のアクションが実行された後に真になる命題のリスト(f2−3)を加える。そして、上述のアクションが実行された後に偽になる命題のリスト(f2−4)を削除するか、これらの偽となる命題が「偽」であることを示すフラグを立てればよい。
例えば、以上の具体的な処理を行うテーブル更新プログラムモジュール260が以下のように生成される。
In the case of tic-tac-toe, for example, if the front moves to position [1a] (circles 1a), the list of true propositions representing the current state stored in state table 264 Add a list (f2-3) of propositions that become true after the above action is executed. Then, the proposition list (f2-4) that becomes false after the above-described action is executed may be deleted, or a flag may be set to indicate that these false propositions are “false”.
For example, a table update program module 260 that performs the above specific processing is generated as follows.

(テーブル更新プログラムモジュール260の例)
1. 現在の状態のテーブルをTとする;
2. アクション実行プログラムモジュール258から与えられた真になる命題のリストをLT、偽になる命題のリストをLFとおく。
3. for each (LTに列記された命題p)
4. T[pの番号] = 真;
5. for each (LF列記された命題p)
6. T[pの番号] = 偽;
以上のプログラムによって、状態テーブル264が現在の状態を反映したものとなる。このようにして、状態テーブルは、現在のゲームの状態を常に反映した情報を保持することができる。
(Example of table update program module 260)
1. Let T be the current state table;
2. Let L T be a list of propositions that become true given by the action execution program module 258, and let L F be a list of propositions that become false.
3. for each (proposition p listed in L T )
4. T [p number] = true;
5. for each (L F list of propositions p)
6. T [p number] = false;
With the above program, the status table 264 reflects the current status. In this way, the status table can hold information that always reflects the current game status.

・ゲーム終了プログラム生成部232
ゲーム終了プログラム生成部232は、状態テーブル264に格納された現在のゲームの状態が、ゲームの終了の定義に当てはまるかを判断するゲーム終了プログラムモジュール262を生成する。
Game end program generation unit 232
The game end program generation unit 232 generates a game end program module 262 that determines whether the current game state stored in the state table 264 matches the definition of the end of the game.

三目並べの場合は、状態テーブルを監視し、既に述べた先手の勝ちの論理式(f3−1)が真となるか、後手の勝ちの論理式(f3−2)が真となるか、引き分けの論理式(f3−3)が真となるかをチェックすればよい。ゲーム終了プログラム生成部232は、このようなチェックを行うように、ゲーム終了プログラムモジュール262を生成すればよい。   In the case of tic-tac-toe, the status table is monitored, and whether the preceding logical expression (f3-1) is true or whether the subsequent logical expression (f3-2) is true, What is necessary is just to check whether the drawing logical expression (f3-3) is true. The game end program generation unit 232 may generate the game end program module 262 so as to perform such a check.

そして、ゲーム終了プログラムモジュール262がゲームの終了を検出した場合は、ゲームの結果の表示等266を出力する。ゲームの終了の結果の表示は、例えば、UI、映像出力機能等を有する汎用プログラム282にAPI270を介して渡され、プレイヤーに報知される。なお、ゲームの終了とは、例えば複数のステージを有するゲームの場合には、所定のゲームのステージの終了を意味し、次のステージの開始の準備がなされるように、ゲームルール処理プログラム250全体が動作するようにトリガーをかけるプログラムを生成すればよい。ゲームのステージの切り替わりのシーン、ゲームのエンディングのシーンなどは、ゲームの本質的な動作とのかかわりが薄いから、ゲーム製作者が別途プログラムを作成してもよい。
三目並べの場合、生成されるゲーム終了プログラムモジュール262は、例えば、以下のようなプログラムモジュールとなる。
When the game end program module 262 detects the end of the game, the game result display 266 is output. The display of the game end result is, for example, passed to the general-purpose program 282 having a UI, a video output function, and the like via the API 270 and notified to the player. The end of the game means, for example, the end of a predetermined game stage in the case of a game having a plurality of stages, and the entire game rule processing program 250 is prepared so as to prepare for the start of the next stage. Just create a program that triggers to work. Since game stage switching scenes, game ending scenes, and the like have little to do with the essential operations of the game, the game creator may create a separate program.
In the case of tic-tac-toe, the generated game end program module 262 is, for example, the following program module.

(ゲーム終了プログラムモジュール262の例)
1. 現在の状態のテーブルをTとする;
2. for each (プレイヤーp)
3. if (Tがプレイヤーpが勝ちとなる論理式を満たす)
4. return “pの勝ち”;
5. if (Tが引き分けとなる論理式を満たす)
6. return “引き分け”;
7. return “終了ではない”;
なお、三目並べの場合は、ゲームの終了形態は、いずれかのプレイヤーの勝ち、又は引き分けである。なお、この終了形態は、一例であって、既に述べたように、ゲームステージの一区切り、他のステージへのへの移動、様々な特典の開放など、ゲームの区切りであってもよい。ゲーム製作者が定めた様々なゲームの区切りを、容易にゲームプログラムに実装することが可能となる。
(Example of game end program module 262)
1. Let T be the current state table;
2. for each (player p)
3. if (T satisfies the logical expression that player p wins)
4. return “p wins”;
5. if (satisfies logical expression where T is a draw)
6. return “draw”;
7. return “not finished”;
In the case of tic-tac-toe, the game end form is a win or draw of any player. Note that this end form is an example, and as described above, it may be a game break, such as a break of the game stage, a move to another stage, and the release of various privileges. Various game breaks determined by the game creator can be easily implemented in the game program.

以上のようにして、ゲームルール処理プログラム生成部220は、ゲームルールの仕様202を用いて、ゲームルール処理プログラム250を生成することができる。本実施形態によれば、ゲームプログラム製作者は、ゲームルールの仕様の作成に専念することができる。そして、ゲームルールの仕様をゲームルール処理プログラム生成部220に与えることにより、ゲームルール処理プログラム生成部220が、ゲームルール処理プログラム250を自動的に生成することができる。すなわち、ゲームルールの仕様から、ゲームプログラム及びゲームプログラムに付随する様々なプログラムの製作をより簡便に行うことができる。   As described above, the game rule processing program generation unit 220 can generate the game rule processing program 250 using the game rule specification 202. According to this embodiment, the game program producer can concentrate on creating the game rule specifications. Then, the game rule processing program generation unit 220 can automatically generate the game rule processing program 250 by giving the game rule specifications to the game rule processing program generation unit 220. That is, it is possible to more easily produce a game program and various programs accompanying the game program from the specifications of the game rules.

また、ゲームルールが変更された場合にも、ゲームプログラム製作者は、ゲームルールの仕様202を変更すればよいため、簡便にゲームルール処理プログラム250を変更することができる。加えて、既存のゲームルールの仕様を流用することにより、新たなゲームプログラムを簡便に作成することができる。   Even when the game rules are changed, the game program creator can change the game rule processing program 250 simply because the game rule specification 202 has only to be changed. In addition, a new game program can be easily created by using the existing game rule specifications.

<実施形態3>プレイヤーシミュレーション(AI)プログラムの生成
図4は、プレイヤーシミュレーション(AI)プログラム生成部320を示す図である。生成されるプレイヤーシミュレーション(AI)プログラム350は、人間であるプレイヤーに代わって、ゲームルール処理プログラムを操作するプログラムである。プレイヤーシミュレーション(AI)プログラム生成部320は、アクション伝達プログラム生成部322と、有利になるアクション推定プログラム生成部324とを有する。
例えば、三目並べの場合には、二人のプレイヤーによる対戦ゲームである。したがって、二人のプレイヤーのそれぞれに対して、1つのプレイヤーシミュレーション(AI)プログラム350を用いることもできる。この場合には、担当プレイヤーの識別子を引数として、1つのプレイヤーシミュレーション(AI)プログラム350に与えて全プレイヤー(三目並べでは二人のプレイヤー)で同じプレイヤーシミュレーション(AI)プログラム350を使いまわすことができる。この場合には、プレイヤーを識別する識別子を引数にして、記憶すべきメモリ領域などをプレイヤー毎に識別できるようにすればよい。
<Third Embodiment> Generation of Player Simulation (AI) Program FIG. 4 is a diagram showing a player simulation (AI) program generation unit 320. The generated player simulation (AI) program 350 is a program for operating a game rule processing program on behalf of a human player. The player simulation (AI) program generation unit 320 includes an action transmission program generation unit 322 and an advantageous action estimation program generation unit 324.
For example, in the case of tic-tac-toe, it is a battle game between two players. Therefore, one player simulation (AI) program 350 can be used for each of two players. In this case, the identifier of the player in charge is given as an argument to one player simulation (AI) program 350, and the same player simulation (AI) program 350 is reused by all players (two players in a tic-tac-toe). Can do. In this case, an identifier for identifying the player may be used as an argument so that the memory area to be stored can be identified for each player.

アクション伝達プログラム生成部322は、アクション受取プログラムモジュールに、実行されるべきアクションを指示するための、アクション伝達プログラムモジュール352を生成する。
三目並べの場合、生成されるアクション伝達プログラムモジュール352は、例えば、以下のようなプログラムモジュールとなる。
The action transmission program generating unit 322 generates an action transmission program module 352 for instructing the action receiving program module about an action to be executed.
In the case of tic-tac-toe, the generated action transmission program module 352 is, for example, the following program module.

(アクション伝達プログラムモジュール352の例)
1. アクションa = 有利になるアクション推定プログラム354の結果;
2. return a;
上記プログラム例では、有利になるアクション推定プログラム354の結果であるアクションaを得て、このアクションaを採用するプログラムモジュールとなっている。
(Example of action transmission program module 352)
1. Action a = Result of the action estimation program 354 to be advantageous;
2. return a;
In the above program example, an action a that is a result of the advantageous action estimation program 354 is obtained, and the program module adopts this action a.

有利になるアクション推定プログラム生成部324は、有利になる確率の高いアクション推定プログラムモジュール354を生成する。有利になる確率の高いアクション推定プログラムモジュール354は、例えば、状態テーブル264及びゲーム終了プログラムモジュール262の結果から得た学習結果に基づき、有利になるアクションを特定する。特定された有利なアクションは、上記アクション伝達プログラムモジュール352の例に示したようにアクション伝達プログラムモジュール352に伝えられる。   The advantageous action estimation program generation unit 324 generates an action estimation program module 354 having a high probability of becoming advantageous. The action estimation program module 354 having a high probability of being advantageous identifies, for example, an advantageous action based on the learning result obtained from the results of the state table 264 and the game end program module 262. The identified advantageous actions are communicated to the action transmission program module 352 as shown in the action transmission program module 352 example above.

有利になる確率の高いアクション推定プログラムモジュール354は、AI技術を実装したプログラムモジュールである。AI技術は、種々のものが提案されているが、その一例として、以下に原始モンテカルロ法について簡潔に説明する。   The action estimation program module 354 that has a high probability of being advantageous is a program module that implements the AI technology. Various AI techniques have been proposed. As an example, the primitive Monte Carlo method will be briefly described below.

原始モンテカルロ法は、実行可能なアクションのそれぞれの次の状態から、ランダムなアクション選択によるシミュレーションプレイを繰り返して、平均勝利回数の最も高かった次の状態に対応するアクションを実際の選択として決定する、というアルゴリズムである。このため、有利になる確率の高いアクション推定プログラムモジュール354は、実行可能アクション特定プログラムモジュール254から、実行可能なアクションを取得する。有利になる確率の高いアクション推定プログラムモジュール354が採用するアルゴリズムは、上述の原始モンテカルロ法に限られるものではなく、その他のAIのアルゴリズムでもよいことは言うまでもない。
三目並べの場合、生成される有利になる確率の高いアクション推定プログラムモジュール354は、例えば、以下のようなプログラムモジュールとなる。
The Primitive Monte Carlo method repeats the simulation play by random action selection from the next state of each action that can be executed, and determines the action corresponding to the next state having the highest average number of wins as the actual selection. It is an algorithm. For this reason, the action estimation program module 354 having a high probability of being advantageous obtains an executable action from the executable action identification program module 254. It goes without saying that the algorithm employed by the action estimation program module 354 having a high probability of being advantageous is not limited to the above-mentioned primitive Monte Carlo method, and may be another AI algorithm.
In the case of tic-tac-toe, the action estimation program module 354 having a high probability of being generated is, for example, the following program module.

(有利になるアクション推定プログラム354の例(原始モンテカルロ法))
1. 現在の状態のテーブルをTとする;
2. AIが担当するプレイヤーをPとおく;
3. L = Tに対して実行可能アクション特定プログラムモジュール254を実行した結果;
4. C = Lと同じサイズのテーブルをメモリに確保;
5. X = 所定回数(例えば100回);
6. for each (Lに列挙されたアクションa)
7. T’= アクション実行プログラムモジュール258でTに対してaを実行した結果;
8. C[a] = 0;
9. for each (i=1…X)
10. T’’= ゲームルール処理プログラムを利用して、T’から開始して各プレイヤーのアクションをランダムに選択しながらゲームが終了するまで状態を変化させた際の、ゲームが終了した状態のテーブル;
11. if (T’’がプレイヤーPの勝利する状態)
12. C[a]を1増加;
13. return C[a]が最も高くなるアクションa;
(Example of advantageous action estimation program 354 (primitive Monte Carlo method))
1. Let T be the current state table;
2. Let P be the player in charge of AI;
3. Result of executing the executable action specific program module 254 for L = T;
4. Reserve a table of the same size as C = L in memory;
5. X = predetermined number of times (eg 100 times);
6. for each (action a listed in L)
7. T '= result of executing a on T in action execution program module 258;
8. C [a] = 0;
9. for each (i = 1… X)
10. T '' = game rule processing program, when starting from T 'and changing the state until the game ends while randomly selecting each player's action table;
11. if (T '' wins Player P)
12. Increase C [a] by 1;
13. Return a C [a] has the highest action a;

上記のプログラムでLは、実行可能アクション特定プログラムモジュール254を実行して得た実行可能なアクションを収めるリストである。また、アクションaはLのリストに列挙された実行可能なアクションである。上記のプログラムによって、個々のアクションaに対して有利になる評価値C[a]を求め、最も高い評価値C[a]となるアクションaを、求めるアクションに採用することとなる。
なお、上記の場合、1つのプレイヤーシミュレーション(AI)プログラム350に、二人のプレイヤーを担当させている。
上記のプログラムでは、所定回数Xに100回を用いているが、この所定回数は、用いられるコンピュータの計算能力、得られる結果の質などを勘案し、妥当な値を予め設定すればよい。なお、計算時間及び得られる結果の質に応じて、上記所定回数を適宜変更してもよい。この点は、他のプログラムの例における「所定回数」についても同様である。
In the above program, L is a list containing executable actions obtained by executing the executable action specifying program module 254. Action a is an executable action listed in the L list. With the above program, an evaluation value C [a] that is advantageous for each action a is obtained, and the action a having the highest evaluation value C [a] is adopted as the action to be obtained.
In the above case, two players are assigned to one player simulation (AI) program 350.
In the above program, 100 is used as the predetermined number of times X, but this predetermined number may be set in advance to an appropriate value in consideration of the computing ability of the computer used, the quality of the results obtained, and the like. Note that the predetermined number of times may be appropriately changed according to the calculation time and the quality of the obtained result. This also applies to the “predetermined number of times” in other program examples.

<実施形態4>初期状態(ステージ)難易度推定プログラムの生成及び難易度比較・初期状態出力プログラムの生成
図5は、初期状態(ステージ)難易度推定プログラムの生成及び難易度比較・初期状態出力プログラムの生成を示す図である。なお、図5において、図4に示したプレイヤーシミュレーション(AI)プログラム350は、簡略化して図示されている。
<Embodiment 4> Generation of initial state (stage) difficulty level estimation program and difficulty level comparison / initial state output program generation FIG. 5 shows generation of initial state (stage) difficulty level estimation program and difficulty level comparison / initial state output. It is a figure which shows the production | generation of a program. In FIG. 5, the player simulation (AI) program 350 shown in FIG. 4 is shown in a simplified manner.

まず、初期状態(ステージ)難易度推定プログラム450の生成について以下に説明する。初期状態(ステージ)難易度推定プログラム生成部420は、初期状態変更プログラム生成部422と、難易度測定プログラム生成部424とを有する。   First, generation of the initial state (stage) difficulty level estimation program 450 will be described below. The initial state (stage) difficulty level estimation program generation unit 420 includes an initial state change program generation unit 422 and a difficulty level measurement program generation unit 424.

なお、三目並べの場合には、(式6)に示したように、初期状態は1つしか存在しない。複数の初期状態があるゲームとしては、例えば、詰め将棋が挙げられる。詰め将棋には、最初に置かれた将棋の駒の配置に無数のバリエーションがある。最初に置かれているコマのパターンの各々が、それぞれ異なる初期状態の例である。   In the case of tic-tac-toe arrangement, as shown in (Equation 6), there is only one initial state. An example of a game having a plurality of initial states is stuffed shogi. There are countless variations in the placement of Shogi pieces placed in the first place. Each of the frame patterns placed first is an example of a different initial state.

初期状態変更プログラムモジュール454は、プログラム作成者から、初期状態564を受け取る。初期状態変更プログラムモジュール454は、受け取った初期状態を変更せずにテーブル作成プログラムモジュール252に渡す。後述する難易度比較・初期状態出力プログラムモジュール550を動作させない場合には、初期状態変更プログラムモジュール454は、初期状態を変更しない。   The initial state change program module 454 receives an initial state 564 from the program creator. The initial state change program module 454 passes the received initial state to the table creation program module 252 without changing it. When the difficulty level comparison / initial state output program module 550 described later is not operated, the initial state change program module 454 does not change the initial state.

プレイヤーシミュレーション(AI)プログラム350を動作させて、初期状態564を固定させて複数回ゲームを実行させる。難易度測定プログラムモジュール452は、ゲーム終了プログラムモジュール262から、この複数回のゲームの終了結果(すなわち勝敗)を取得して、初期状態564に対する難易度を測定することで測定難易度561を出力する。測定難易度の一例は、勝率である。勝率が低い結果が得られた場合には、初期状態564の難易度は高いと判定できる。勝率が高い結果が得られた場合には、初期状態564の難易度は低いと判定できる。勝ちの回数、負けの回数、引き分けの回数に、所定の重みをかけて加算した結果を測定難易度561としてもよい。
生成される難易度測定プログラムモジュール452は、例えば、以下のようなプログラムモジュールとなる。
The player simulation (AI) program 350 is operated to fix the initial state 564 and execute the game a plurality of times. The difficulty level measurement program module 452 outputs the measurement difficulty level 561 by obtaining the completion results (that is, winning or losing) of the plurality of games from the game end program module 262 and measuring the difficulty level with respect to the initial state 564. . An example of the measurement difficulty is a winning percentage. If a result with a low win rate is obtained, it can be determined that the difficulty level of the initial state 564 is high. When a result with a high win rate is obtained, it can be determined that the difficulty level of the initial state 564 is low. A result obtained by adding a predetermined weight to the number of wins, the number of losses, and the number of draws may be used as the measurement difficulty level 561.
The generated difficulty measurement program module 452 is, for example, the following program module.

(難易度測定プログラムモジュール452の例)
1. 与えられた初期状態のテーブルをTとする;
2. X = 所定回数(例えば100回);
3. 難易度D = 0;
4. for each (i = 1…N)
5. Tを初期状態としてゲームが終了するまでAIにプレイさせる;
6. if (Tが負けの場合)
7. Dを1増加;
8. return D;
上記のプログラムの例の場合、測定難易度561(D)が大きい値であるほど、与えられた初期状態564の難易度は高いと判断することができる。
(Example of difficulty measurement program module 452)
1. Let T be the table in the given initial state;
2. X = predetermined number of times (eg 100 times);
3. Difficulty level D = 0;
4. for each (i = 1… N)
5. Let AI play with T as the initial state until the game ends;
6. if (if T is losing)
7. Increase D by 1;
8. return D;
In the case of the above program example, it can be determined that the higher the measurement difficulty 561 (D) is, the higher the difficulty of the given initial state 564 is.

次に、難易度比較・初期状態出力プログラム生成部520について以下に説明する。難易度比較・初期状態出力プログラム生成部520は、難易度比較・初期状態出力プログラムモジュール550を出力する。   Next, the difficulty level comparison / initial state output program generation unit 520 will be described below. The difficulty level comparison / initial state output program generation unit 520 outputs a difficulty level comparison / initial state output program module 550.

難易度比較・初期状態出力プログラムモジュール550は、難易度測定プログラムモジュール452から測定難易度561を受け取ると共に、プログラム製作者から、目標難易度560を受け取る。難易度比較・初期状態出力プログラムモジュール550は、測定難易度561と目標難易度560とを比較する。例えば、測定難易度561と目標難易度560との差の絶対値が、所定の閾値以下であれば、測定難易度561は、目標難易度560に近似していると判断できる。この場合には、現在の初期状態を適切な初期状態であるとして、決定初期状態(所定のステージの初期状態)562を出力する。   The difficulty level comparison / initial state output program module 550 receives the measurement difficulty level 561 from the difficulty level measurement program module 452 and also receives the target difficulty level 560 from the program producer. The difficulty level comparison / initial state output program module 550 compares the measurement difficulty level 561 with the target difficulty level 560. For example, if the absolute value of the difference between the measurement difficulty level 561 and the target difficulty level 560 is equal to or less than a predetermined threshold, it can be determined that the measurement difficulty level 561 is close to the target difficulty level 560. In this case, a determination initial state (initial state of a predetermined stage) 562 is output assuming that the current initial state is an appropriate initial state.

測定難易度561と目標難易度560との差の絶対値が、所定の閾値を超える場合には、測定難易度561は、目標難易度560から乖離していると判断できる。このため、難易度比較・初期状態出力プログラムモジュール550は、初期状態変更プログラムモジュール454に対して、初期状態を変更するよう指示する。
生成される難易度比較・初期状態出力プログラムモジュール550は、例えば、以下のようなプログラムモジュールとなる。
When the absolute value of the difference between the measurement difficulty level 561 and the target difficulty level 560 exceeds a predetermined threshold, it can be determined that the measurement difficulty level 561 is deviated from the target difficulty level 560. Therefore, the difficulty level comparison / initial state output program module 550 instructs the initial state change program module 454 to change the initial state.
The difficulty level comparison / initial state output program module 550 generated is, for example, the following program module.

(難易度比較・初期状態出力プログラムモジュール550の例)
1. 与えられた初期状態のテーブルをTとする;
2. X = 所定回数(例えば100回);
3. 難易度と目標難易度の近さQbest = 無限大;
4. 暫定最良の初期状態のテーブルTbestをメモリに確保;
5. for each (i = 1…X)
6. T’= 初期状態変更プログラムモジュール454にTを与えた結果;
7. D = 難易度測定プログラムモジュール452にT’を与えた結果;
8. Q = (D −目標難易度)の絶対値;
9. if (Q < Qbest)
10. Tbest = T’;
11. Qbest = Q;
12. return Tbest;
上記プログラムでは、初期状態を変更することで、暫定最良の初期状態のテーブルTbestを探索しながら、最終的に目標難易度に近い難易度の初期状態のテーブルTbestを出力している。この処理により、試行錯誤を繰り返しながら、目標とする難易度に近い初期状態が決定され出力される(決定初期状態(ステージ)562)。多くのゲームでは、難易度の異なる複数のステージを有する場合が多い。このようなゲームでは、所望の難易度の初期状態を有するステージを作り出すことができる。
なお、ステージを切り替えるプログラムは、ゲームのアレンジを基にして、プログラム製作者によって別途作りこみを行えばよい。
(Example of difficulty comparison / initial state output program module 550)
1. Let T be the table in the given initial state;
2. X = predetermined number of times (eg 100 times);
3. Closeness of difficulty and target difficulty Qbest = infinity;
4. Reserve table Tbest of temporary best initial state in memory;
5. for each (i = 1… X)
6. T '= result of giving T to the initial state change program module 454;
7. D = Result of giving T 'to the difficulty measurement program module 452;
8. Q = absolute value of (D-target difficulty);
9. if (Q <Qbest)
10. Tbest = T ';
11. Qbest = Q;
12. return Tbest;
In the above program, by changing the initial state, the table Tbest in the initial state with the difficulty level close to the target difficulty level is finally output while searching the table Tbest in the provisional best initial state. By this process, an initial state close to the target difficulty level is determined and output while repeating trial and error (determination initial state (stage) 562). Many games often have multiple stages with different levels of difficulty. In such a game, a stage having an initial state of a desired difficulty level can be created.
Note that the program for switching the stage may be created separately by the program creator based on the arrangement of the game.

なお、初期状態の変更の手法としては、目標難易度560に測定難易度561が収束してゆくように、初期状態を変更させることが望ましい。収束のさせ方は、例えば、モンテカルロ法を採用してもよい。なお、収束が局所的な極小値に収束してしまうのを避けるために、例えば、大域的最適化問題への汎用の乱択アルゴリズムである焼きなまし法を採用してもよい。
生成される初期状態変更プログラムモジュール454は、例えば、以下のようなプログラムモジュールとなる。
As a method for changing the initial state, it is desirable to change the initial state so that the measurement difficulty level 561 converges on the target difficulty level 560. For example, the Monte Carlo method may be employed as the method of convergence. In order to avoid convergence of the convergence to a local minimum value, for example, an annealing method that is a general-purpose random selection algorithm for the global optimization problem may be employed.
The generated initial state change program module 454 is, for example, the following program module.

(初期状態変更プログラムモジュール454の例)
1. 与えられた初期状態のテーブルをTとする;
2. X = 所定回数(例えばNの5%);
3. for each (i = 1…X)
4. 命題p = 1からNの中からランダムに選択;
5. T[p] = T[p]の値を反転した値;
6. return T;
上記プログラムでは、サイズNの真理値テーブルTにおいて、例えばN個の命題のうちの5%の命題の真理値を反転させている。このようにすることにより、初期状態をランダムに変更することができる。
(Example of initial state change program module 454)
1. Let T be the table in the given initial state;
2. X = predetermined number of times (eg 5% of N);
3. for each (i = 1… X)
4. Randomly selected from propositions p = 1 to N;
5. Inverted value of T [p] = T [p];
6. return T;
In the above program, in the truth table T of size N, for example, the truth values of 5% of N propositions are inverted. By doing in this way, an initial state can be changed at random.

本実施形態によれば、任意の初期状態の難易度を測定するプログラムが生成できる。また、設定された難易度の初期状態を自動的に生成できる。この自動的に生成された初期状態は、次第に難易度が増してゆくゲームの各ステージの初期状態に適用することができる。   According to the present embodiment, it is possible to generate a program that measures the difficulty level of an arbitrary initial state. Moreover, the initial state of the set difficulty level can be automatically generated. This automatically generated initial state can be applied to the initial state of each stage of the game with increasing difficulty.

<実施形態5>テストプログラムの生成
図6は、テストプログラムの生成を示す図である。
テストプログラムは、ゲームルール処理プログラム250が正しい状態となっているかをテストするためのプログラムである。テストプログラム生成部620は、テストプログラム650を生成する。テストプログラム生成部620は、論理式受取プログラム生成部622と、テーブル監視プログラム生成部624とを有する。
<Fifth Embodiment> Generation of Test Program FIG. 6 is a diagram showing generation of a test program.
The test program is a program for testing whether the game rule processing program 250 is in a correct state. The test program generation unit 620 generates a test program 650. The test program generation unit 620 includes a logical expression reception program generation unit 622 and a table monitoring program generation unit 624.

論理式受取プログラム生成部622は、背反する論理式受取プログラムモジュール652を生成する。テーブル監視プログラム生成部624は、テーブル監視プログラムモジュール654を生成する。   The logical formula reception program generation unit 622 generates a contradictory logical reception program module 652. The table monitoring program generation unit 624 generates a table monitoring program module 654.

背反する論理式受取プログラムモジュール652は、プログラム製作者が作成した背反する論理式670を受け取る。背反する論理式受取プログラムモジュール652の機能は、背反する論理式570を受け取り、テーブル監視プログラムモジュール654に渡すことである。テーブル監視プログラムモジュール654の機能は、背反する論理式670に対応する命題の集合が、状態テーブル264に存在するという異常を発見することである。そして、異常が発見された場合には、テーブル監視プログラムモジュール654は、状態が異常である旨672を報知する。
生成される背反する論理式受取プログラムモジュール652は、例えば、以下のようなプログラムモジュールとなる。
The contradicting logic formula receiving program module 652 receives the contradicting logic formula 670 created by the program creator. The function of the contradictory logic receiving program module 652 is to receive the contradicting logic 570 and pass it to the table monitoring program module 654. The function of the table monitoring program module 654 is to find an anomaly that a set of propositions corresponding to the contradicting logical expression 670 exists in the state table 264. If an abnormality is found, the table monitoring program module 654 notifies that the state is abnormal 672.
The contradictory logical expression receiving program module 652 generated is, for example, the following program module.

(背反する論理式受取プログラムモジュール652の例)
1. 論理式(文字列)を取得する;
2. 論理式を等価な構造体Sに変換する;
3. return S;
上記のプログラムは、論理式を処理しやすいように、論理式をそれと等価な構造体Sに変換している例を示している。なお、論理式を構造体Sに変換することが必須ではないことは言うまでもない。
例えば、三目並べの場合には、下記の論理式(式8)は、常に偽となる論理式であり、真となってはならない論理式である。

∃[位置],[位置]は[先手]の陣地でありかつ[位置]は[後手]の陣地である(式8)
(An example of a contradictory logic receiving program module 652)
1. Get a logical expression (string);
2. Convert the logical expression to the equivalent structure S;
3. return S;
The above program shows an example in which a logical expression is converted into a structure S equivalent to the logical expression so that the logical expression can be easily processed. Needless to say, it is not essential to convert the logical expression into the structure S.
For example, in the case of tic-tac-toe, the following logical expression (Expression 8) is a logical expression that is always false and should not be true.

∃ [Position] and [Position] are [first] positions and [Position] is [back] positions (Formula 8)

上記(式6)は、同じ位置が先手の陣地でありかつ後手の陣地でもあるという論理式である。この論理式は、常に偽となるはずである。しかしながら、このような論理式(式8)と整合する下記の2つの命題(式9)を例にして説明する。

[位置]は[先手]の陣地である,[位置]は[後手]の陣地である (式9)
The above (Formula 6) is a logical expression that the same position is the front position and the back position. This logical expression should always be false. However, the following two propositions (formula 9) consistent with such a logical formula (formula 8) will be described as an example.

[Position] is the position of [First], [Position] is the position of [Rear] (Formula 9)

このような2つの命題(式9)のいずれの命題も真であるような状態が、状態テーブルに存在することは、状態テーブルに格納されたゲームの状態が異常であることを示している。このことは、ゲームルールの定義に誤りが存在すると判断される。   The existence of a state in which both of these two propositions (Equation 9) are true in the state table indicates that the state of the game stored in the state table is abnormal. This is determined that there is an error in the definition of the game rule.

真となってはいけない論理式(例えば論理式(式8))が真であれば、テーブル監視プログラムモジュール654は、ゲームを中断させる。そして、初期状態からどのようなアクションの系列を経てゲームの中断に至ったのかを表示するようにしてもよい。   If a logical expression that cannot be true (for example, logical expression (expression 8)) is true, the table monitoring program module 654 interrupts the game. Then, what kind of action sequence from the initial state may be displayed through which the game is interrupted.

なお、テストプログラムは、実際のプレイヤーがゲームを操作している際に動作させてもよいが、既に述べたプレイヤーシミュレーション(AI)プログラム350にゲームをプレイさせたときに動作させるようにすることが望ましい。正しいゲームプログラムをプレイヤーに提供することが望ましいからである。
生成されるテーブル監視プログラムモジュール654は、例えば、以下のようなプログラムモジュールとなる。
The test program may be operated when an actual player is operating the game. However, the test program may be operated when the player simulation (AI) program 350 described above is played. desirable. This is because it is desirable to provide players with a correct game program.
The generated table monitoring program module 654 is, for example, the following program module.

(テーブル監視プログラムモジュール654の例)
1. 初期状態のテーブルをTとする;
2. E = 背反する論理式受取プログラムモジュール652の結果の論理式;
3. X = 所定回数(例えば100回);
4. for each (i = 1…X)
5. T’ = T;
6. Y = 所定回数(例えば100回);
7. for each (j = 1…Y)
8. if (T’が終了の状態)
9. jのループを中断して次のiへ;
10. if (T’が論理式Eを満たす)
11. T’や初期状態Tからそこまで至ったアクションの列などの情報を出力;
12. return “背反状態を発見”;
13. L = 実行可能アクション特定プログラムモジュール254の結果;
14. アクションa = Lからランダムに一つ選択したアクション;
15. T’= アクション実行プログラムモジュール258でT’に対してaを実行した結果;
16. return “背反状態未発見”;
上記のプログラムの例で、論理式Eは、構造体Sの形式であってもよい。また、行番号11では、初期状態Tから、異常の状態T’に至るまでのアクションの情報などを出力させるようにしてもよい。
(Example of table monitoring program module 654)
1. Let T be the initial table;
2. E = formula of the result of the contradicting formula receiver program module 652;
3. X = predetermined number of times (eg 100 times);
4. for each (i = 1… X)
5. T '= T;
6. Y = predetermined number of times (eg 100 times);
7. for each (j = 1… Y)
8. if (T 'is finished)
9. Interrupt j loop to next i;
10. if (T 'satisfies formula E)
11. Output information such as T 'and the sequence of actions from the initial state T to that point;
12. return “find the contradiction”;
13. L = result of executable action specific program module 254;
14. Action selected at random from action a = L;
15. T '= result of executing a on T' in action execution program module 258;
16. return “no found contradiction”;
In the above program example, the logical expression E may be in the form of the structure S. In line number 11, action information from the initial state T to the abnormal state T ′ may be output.

<実施形態6>動作の概要
図7は、ゲームプログラム生成プログラムの動作のフローを示している。
ステップS700で、初期状態のテーブルを作成するプログラムモジュールが生成される。
ステップS702で、ゲームプログラムにより実行可能なアクションを特定するプログラムモジュールが生成される。
ステップS704で、プレイヤーによって選択されたアクションを受け取るプログラムモジュールが生成される。
ステップS706で、選択されたアクションを実行するプログラムモジュールが生成される。
ステップS708で、テーブルを更新するプログラムモジュールが生成される。
ステップS710で、ゲームの終了及びゲームの終了の結果を出力するプログラムモジュールが生成される。
以上の処理により、ゲームルール処理プログラムが生成される。
<Sixth Embodiment> Outline of Operation FIG. 7 shows a flow of the operation of the game program generation program.
In step S700, a program module for creating an initial state table is generated.
In step S702, a program module that specifies an action that can be executed by the game program is generated.
In step S704, a program module that receives the action selected by the player is generated.
In step S706, a program module that executes the selected action is generated.
In step S708, a program module for updating the table is generated.
In step S710, a program module that outputs the game end and the game end result is generated.
With the above processing, a game rule processing program is generated.

その他、プレイヤーシミュレーション(AI)プログラム、初期状態(ステージ)難易度測定プログラム、初期状態出力プログラムモジュール、テストプログラムについても、任意のタイミングで生成される。   In addition, a player simulation (AI) program, an initial state (stage) difficulty measurement program, an initial state output program module, and a test program are also generated at an arbitrary timing.

<実施形態7>生成されたプログラムに対するアノーテーションの付加
生成された各種のプログラムは、プレイヤーとのインターラクションを実現するように、UI、映像出力機能等を有する汎用プログラム282及び/又はオペレーティングシステム284との連携を図るため、必要なインタフェースをとることが望ましい。このインタフェースの作りこみを容易化するためには、生成されたプログラムに、プログラム製作者の理解を助けるためのアノーテーションが適切に付されていることが望ましい。
<Seventh Embodiment> Addition of Annotation to Generated Program Various generated programs are a general-purpose program 282 having a UI, a video output function, and / or an operating system 284 so as to realize an interaction with a player. It is desirable to take the necessary interface in order to cooperate with. In order to facilitate the creation of this interface, it is desirable that the generated program is appropriately annotated to help the program creator understand.

図2に示したように、アノーテーション付加部220cは、仕様情報解析部220aを介して得たゲームルールの仕様202から、適切なアノーテーションを作成し、生成されたプログラムに付加する。以下に、その具体例を示す。   As shown in FIG. 2, the annotation adding unit 220c creates an appropriate annotation from the game rule specification 202 obtained through the specification information analyzing unit 220a, and adds it to the generated program. The specific example is shown below.

「/**
* @brief アクションを表す構造体
*/
struct Action {
/** @brief 前提条件の命題の数 */
int num_zentei_jouken;
/** @brief 前提条件の命題の配列 */
int zentei_jouken[NUM_MEIDAI];
/** @brief 前提条件の命題の値 */
bool zentei_jouken_value[NUM_MEIDAI];
/** @brief 後状態で真となるべき命題の数 */
int num_true_effect;
/** @brief 後状態で真となるべき命題の配列 */
int true_effect[NUM_MEIDAI];
/** @brief 後状態で偽となるべき命題の数 */
int num_false_effect;
/** @brief 後状態で偽となるべき命題の配列 */
int false_effect[NUM_MEIDAI];
};」
"/ **
* Structure representing the @brief action
* /
struct Action {
/ ** @brief number of assumption propositions * /
int num_zentei_jouken;
/ ** @brief array of precondition propositions * /
int zentei_jouken [NUM_MEIDAI];
/ ** @brief Precondition value * /
bool zentei_jouken_value [NUM_MEIDAI];
/ ** @brief Number of propositions to be true in post-condition * /
int num_true_effect;
/ ** @brief array of propositions to be true in post-state * /
int true_effect [NUM_MEIDAI];
/ ** @brief Number of propositions that should be false in the post state * /
int num_false_effect;
/ ** @brief array of propositions that should be false in post-state * /
int false_effect [NUM_MEIDAI];
}; "

たとえば、上記の生成されたプログラムでは、「@brief」の後に書かれた記述がアノーテーションである。このアノーテーションを参照することによって、プログラム製作者は、生成されたプログラムの内容を、より容易に理解することができる。このアノーテーションは、生成されたプログラムと、他の汎用プログラム等とのインタフェースを、プログラム製作者が作りこむことを容易にさせることができる。   For example, in the generated program, the description written after “@brief” is an annotation. By referring to this annotation, the program creator can more easily understand the contents of the generated program. This annotation can make it easy for the program creator to create an interface between the generated program and other general-purpose programs.

<ハードウエア構成>
図8は、一実施形態のハードウエア構成800を示す図である。
ハードウエア構成800は、CPU802、メモリ804、通信制御装置806、入力インタフェース808、表示制御部810、外部メモリ制御部812及び出力インタフェース814を有する。
<Hardware configuration>
FIG. 8 is a diagram illustrating a hardware configuration 800 according to an embodiment.
The hardware configuration 800 includes a CPU 802, a memory 804, a communication control device 806, an input interface 808, a display control unit 810, an external memory control unit 812, and an output interface 814.

そして、通信制御装置806には、ネットワーク830(WIFI、有線LAN、広域ネットワーク(インターネット)、近距離無線通信等)が接続される。入力インタフェース808には、タッチ感知センサ等840などが接続される。表示制御部810には、ディスプレイ850が接続される。外部メモリ制御部812は、記憶媒体860を読み書きすることができる。出力インタフェースには、スピーカ等870などが接続される。
記憶媒体860は、RAM、ROM、CD−ROM、DVD−ROM、ハードディスク、メモリーカード等であってもよい。
The communication control device 806 is connected to a network 830 (WIFI, wired LAN, wide area network (Internet), near field communication, etc.). The input interface 808 is connected with a touch sensor 840 or the like. A display 850 is connected to the display control unit 810. The external memory control unit 812 can read and write the storage medium 860. A speaker or the like 870 is connected to the output interface.
The storage medium 860 may be a RAM, ROM, CD-ROM, DVD-ROM, hard disk, memory card, or the like.

以上説明した実施形態のプログラムは、ハードウエア構成800を備えるコンピュータにより実行され得る。また,実施形態のプログラムは,コンピュータに実行させる方法として,インプリメントされてもよい。本実施形態のプログラムの一部又は全部は、オペレーティングシステム284により実行されてもよい。また、プログラムの一部がハードウエアにより実現されてもよい。プログラムは記憶媒体860又はメモリ804に記憶されてもよい。   The program of the embodiment described above can be executed by a computer including the hardware configuration 800. In addition, the program of the embodiment may be implemented as a method for causing a computer to execute the program. Part or all of the program of this embodiment may be executed by the operating system 284. A part of the program may be realized by hardware. The program may be stored in the storage medium 860 or the memory 804.

なお,上述の実施形態において,プログラムのステップは、矛盾のない限り,同時に,又は順序を入れ替えて実行されてもよい。
以上の実施形態は,ハードウエアの装置としてインプリメントされ得る。
以上の実施形態は,請求項に記載された発明を限定するものではなく,例示として取り扱われることは言うまでもない。
In the above-described embodiment, the program steps may be executed simultaneously or in a different order as long as there is no contradiction.
The above embodiments can be implemented as a hardware device.
It goes without saying that the above embodiment does not limit the invention described in the claims, but is treated as an example.

202 ゲームルールの仕様
220 ゲームルール処理プログラム生成部
320 プレイヤーシミュレーション(AI)プログラム生成部
420 初期状態(ステージ)難易度測定プログラム生成部
520 難易度比較・初期状態出力プログラム生成部
620 テストプログラム生成部


202 Game Rule Specification 220 Game Rule Processing Program Generation Unit 320 Player Simulation (AI) Program Generation Unit 420 Initial State (Stage) Difficulty Level Measurement Program Generation Unit 520 Difficulty Level Comparison / Initial State Output Program Generation Unit 620 Test Program Generation Unit


Claims (8)

命題を用いて定義されたゲームの仕様から、ゲームマシンにゲームを動作させるゲームプログラムを生成するゲームプログラム生成装置であって、前記仕様は、少なくとも、ゲームの状態の定義と、プレイヤーからの指示に基づいて前記ゲームプログラムにより実行されるアクションの定義と、ゲームの終了の定義と、を含み、
前記ゲームプログラム生成装置は、
ゲームの状態を記憶するテーブルに、前記ゲームの仕様に含まれる複数の命題について、ゲームの初期状態における真理値が含まれるように、初期状態のテーブルを作成するプログラムモジュールを生成する、テーブル作成プログラム生成部と、
前記アクションの定義を用いて、前記テーブルを検索することで、前記ゲームプログラムにより実行可能なアクションを特定するプログラムモジュールを生成する、実行可能アクション特定プログラム生成部と、
前記プレイヤーによって選択されたアクションを受け取るプログラムモジュールを生成する、アクション受取プログラム生成部と、
前記プレイヤーによって選択されたアクションが、前記実行可能なアクションのうちの1つである場合、前記選択されたアクションを実行するプログラムモジュールを生成する、アクション実行プログラム生成部と、
実行された前記アクションの定義に基づいて、前記アクションが実行された後のゲームの状態を表す真の命題の全てを含むように、前記テーブルに格納された命題に変更を施すことで、前記テーブルを更新するプログラムモジュールを生成する、テーブル更新プログラム生成部と、
前記ゲームの終了の定義を用いて、前記テーブルを検索することで、ゲームの終了及びゲームの終了の結果を出力するプログラムモジュールを生成する、ゲーム終了プログラム生成部と、
を有する、ゲームプログラム生成装置。
A game program generation device that generates a game program for causing a game machine to operate a game from a game specification defined using a proposition, wherein the specification includes at least a definition of a game state and an instruction from a player. A definition of an action executed by the game program based on the definition of the end of the game,
The game program generation device includes:
A table creation program for generating a program module for creating a table in an initial state so that a truth value in the initial state of the game is included for a plurality of propositions included in the specification of the game in the table storing the game state A generator,
An executable action specifying program generating unit that generates a program module that specifies an action that can be executed by the game program by searching the table using the definition of the action;
An action receiving program generator for generating a program module for receiving an action selected by the player;
An action execution program generator that generates a program module for executing the selected action when the action selected by the player is one of the executable actions;
Based on the definition of the executed action, by changing the proposition stored in the table so as to include all of the true propositions representing the state of the game after the action is executed, the table A table update program generator for generating a program module for updating
A game end program generation unit that generates a program module that outputs a game end and a game end result by searching the table using the definition of the end of the game;
A game program generation device.
前記アクションの定義は、アクションの実行を可能とさせる前提条件となる真の命題の集合と、アクションの実行後に偽から真となる命題の集合と、アクションの実行後に真から偽となる命題の集合と、を含み、
前記実行可能なアクションを特定するプログラムモジュールは、所定のアクションについての前記前提条件となる真の命題の集合が前記テーブルに存在する場合に、前記所定のアクションが実行可能であると特定し、
前記テーブルを更新するプログラムモジュールは、実行されたアクションについて、アクションの実行後に偽から真となる命題の集合と、アクションの実行後に真から偽となる命題の集合とに整合するように、前記テーブルを更新する、
請求項1に記載のゲームプログラム生成装置。
The definition of the action includes a set of true propositions that are preconditions that enable execution of the action, a set of propositions that are false to true after the execution of the action, and a set of propositions that are true to false after the execution of the action. And including
The program module for specifying the executable action specifies that the predetermined action can be executed when a set of true propositions as the preconditions for the predetermined action exists in the table,
The program module for updating the table matches the executed action with a set of propositions from false to true after execution of the action and a set of propositions from true to false after the execution of the action. Update,
The game program generation device according to claim 1.
生成された前記ゲームプログラムを人間のプレイヤーに代わって、仮想的プレイヤーがプレイするプログラムモジュールを生成するプレイヤシミュレーションプログラム生成部、を更に有し、
プレイヤシミュレーションプログラム生成部は、
前記ゲームにより実行可能なアクションを特定するプログラムモジュールによって得られたアクションのうち、前記仮想的プレイヤーがゲームで有利になる確率の高いアクションを推定するプログラムモジュールを生成する、アクション推定プログラム生成部と、
前記アクションを推定するプログラムモジュールにより推定された1つのアクションを、前記アクションを受け取るプログラムモジュールに伝達するプログラムモジュールを生成する、アクション伝達プログラム生成部と、
を有し、
前記仮想的プレイヤーがゲームで有利になる確率の高いアクションを推定するプログラムモジュールは、少なくとも、前記選択されたアクションと、当該アクションが実行される前のゲームの状態、当該アクションが実行された後のゲームの状態、及びゲームの終了の結果のうちの少なくとも1つを複数回学習することで前記仮想的プレイヤーがゲームで有利になる確率の高いアクションの1つを推定する、
請求項1又は2に記載のゲームプログラム生成装置。
In addition to a human player, the generated game program further includes a player simulation program generating unit that generates a program module for a virtual player to play.
The player simulation program generation unit
An action estimation program generating unit that generates a program module that estimates an action with a high probability that the virtual player is advantageous in the game among actions obtained by the program module that identifies an action executable by the game;
An action transmission program generation unit that generates a program module that transmits one action estimated by the program module that estimates the action to a program module that receives the action;
Have
The program module for estimating an action with a high probability that the virtual player will be advantageous in the game includes at least the selected action, a state of the game before the action is executed, and after the action is executed. Inferring one of the actions that the virtual player is likely to be advantageous in the game by learning at least one of the game state and the result of the game end multiple times.
The game program generation device according to claim 1 or 2.
ゲームのルールの仕様と背反する論理式を受け取るプログラムモジュールを生成する、論理式受取プログラム生成部と、
前記仮想的プレイヤーによって前記ゲームプログラムをプレイさせて前記テーブルを監視するプログラムモジュールを生成する、テーブル監視プログラム生成部と、
を有し、
前記テーブルを監視するプログラムモジュールは、前記背反する論理式が、前記テーブルに存在する場合に、前記テーブルが不正である旨を報知する、請求項3に記載のゲームプログラム生成装置。
A logical expression receiving program generation unit that generates a program module that receives a logical expression that contradicts the game rule specification;
A table monitoring program generator for generating a program module for monitoring the table by playing the game program by the virtual player;
Have
4. The game program generation device according to claim 3, wherein the program module that monitors the table notifies that the table is invalid when the contradictory logical expression exists in the table.
前記ゲームの初期状態を変更するプログラムモジュールを生成する、初期状態変更プログラム生成部と、
変更された前記ゲームの初期状態を用いて、前記生成されたゲームプログラムを前記仮想的プレイヤーによって所定の回数プレイさせることで、前記ゲームの途中の状態又は前記ゲームの終了の結果から、前記ゲームの初期状態を用いたゲームプログラムの難易度を統計的に測定するプログラムモジュールを生成する、難易度測定プログラム生成部と、
を更に有する、
請求項3又は4に記載のゲームプログラム生成装置。
An initial state change program generating unit for generating a program module for changing the initial state of the game;
By using the changed initial state of the game to play the generated game program a predetermined number of times by the virtual player, the state of the game can be determined from the state of the game or the end of the game. A difficulty level measurement program generation unit that generates a program module that statistically measures the difficulty level of the game program using the initial state;
Further having
The game program generation device according to claim 3 or 4.
測定された前記難易度と、予め定められた難易度との差を比較した差の絶対値が、所定の閾値以下の場合には、変更された前記ゲームの状態の定義から得られた前記ゲームの初期状態を出力する、難易度比較・初期状態出力プログラムモジュールを生成する、難易度比較・初期状態出力プログラム生成部、
を更に有し、
前記難易度比較・初期状態出力プログラムモジュールは、前記差の絶対値が所定の閾値を超える場合には、前記ゲームの初期状態を出力せずに、前記ゲームの初期状態を変更するプログラムモジュールにゲームの状態の定義を変更するよう指示する、
請求項5に記載のゲームプログラム生成装置。
If the absolute value of the difference obtained by comparing the difference between the measured difficulty level and a predetermined difficulty level is equal to or less than a predetermined threshold value, the game obtained from the changed game state definition Output initial state, generate difficulty level comparison / initial state output program module, difficulty level comparison / initial state output program generator,
Further comprising
The difficulty level comparison / initial state output program module is a program module that changes the initial state of the game without outputting the initial state of the game when the absolute value of the difference exceeds a predetermined threshold. To change the state definition of
The game program generation device according to claim 5.
前記仕様に基づいて、ゲームプログラムにアノーテーションを付加するアノーテーション付加部を更に有する、
請求項1ないし6のうちいずれか1項に記載のゲームプログラム生成装置。
Based on the above specifications, further comprising an annotation adding unit for adding an annotation to the game program,
The game program generation device according to any one of claims 1 to 6.
命題を用いて定義されたゲームの仕様から、ゲームマシンにゲームを動作させるゲームプログラムを生成するゲームプログラムをコンピュータに生成させるプログラムであって、前記仕様は、少なくとも、ゲームの状態の定義と、プレイヤーからの指示に基づいて前記ゲームプログラムにより実行されるアクションの定義と、ゲームの終了の定義と、を含み、
前記プログラムは、
ゲームの状態を記憶するテーブルに、前記ゲームの仕様に含まれる複数の命題のうち、ゲームの初期状態において真である全ての命題が少なくとも含まれるように、初期状態のテーブルを作成するプログラムモジュールを生成するステップと、
前記アクションの定義を用いて、前記テーブルを検索することで、前記ゲームプログラムにより実行可能なアクションを特定するプログラムモジュールを生成するステップと、
前記プレイヤーによって選択されたアクションを受け取るプログラムモジュールを生成するステップと、
前記プレイヤーによって選択されたアクションが、前記実行可能なアクションのうちの1つである場合、前記選択されたアクションを実行するプログラムモジュールを生成するステップと、
実行された前記アクションの定義に基づいて、前記アクションが実行された後のゲームの状態を表す真の命題の全てを含むように、前記テーブルに格納された命題に変更を施すことで、前記テーブルを更新するプログラムモジュールを生成するステップと、
前記ゲームの終了の定義を用いて、前記テーブルを検索することで、ゲームの終了及びゲームの終了の結果を出力するプログラムモジュールを生成するステップと、
をコンピュータに実行させる、ゲームプログラム生成プログラム。

A program for causing a computer to generate a game program for generating a game program for causing a game machine to operate a game from a game specification defined using a proposition, wherein the specification includes at least a definition of a game state and a player A definition of an action executed by the game program based on an instruction from the game, and a definition of the end of the game,
The program is
A program module for creating an initial state table so that the table storing the game state includes at least all propositions that are true in the initial state of the game among the plurality of propositions included in the specification of the game. Generating step;
Generating a program module for identifying an action executable by the game program by searching the table using the definition of the action;
Generating a program module for receiving an action selected by the player;
Generating a program module for executing the selected action if the action selected by the player is one of the executable actions;
Based on the definition of the executed action, by changing the proposition stored in the table so as to include all of the true propositions representing the state of the game after the action is executed, the table Generating a program module for updating
Generating a program module that outputs a game end and a game end result by searching the table using the game end definition;
A game program generation program for causing a computer to execute.

JP2018081928A 2018-04-21 2018-04-21 Game program generation device and game program generation program Pending JP2019191786A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2018081928A JP2019191786A (en) 2018-04-21 2018-04-21 Game program generation device and game program generation program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2018081928A JP2019191786A (en) 2018-04-21 2018-04-21 Game program generation device and game program generation program

Publications (1)

Publication Number Publication Date
JP2019191786A true JP2019191786A (en) 2019-10-31

Family

ID=68390356

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018081928A Pending JP2019191786A (en) 2018-04-21 2018-04-21 Game program generation device and game program generation program

Country Status (1)

Country Link
JP (1) JP2019191786A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2021122725A (en) * 2020-02-06 2021-08-30 エヌエイチエヌ コーポレーション Game difficulty prediction method and device utilizing game play server of deep learning base
JP2023123018A (en) * 2022-02-24 2023-09-05 株式会社Precious Analytics Game evaluation method, device, and program
WO2024116387A1 (en) * 2022-12-01 2024-06-06 日本電信電話株式会社 Information processing device, information processing method, and information processing program

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002116911A (en) * 2000-10-06 2002-04-19 Revenet:Kk Automatic generation device for object-oriented program
JP2004089472A (en) * 2002-08-30 2004-03-25 Casio Comput Co Ltd Game information processing apparatus, and game information processing program
US20170282076A1 (en) * 2016-04-01 2017-10-05 Glu Mobile, Inc. Systems and methods for triggering action character cover in a video game
US20170357489A1 (en) * 2016-06-09 2017-12-14 Jeff Fleurimond System and method for developing applications

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002116911A (en) * 2000-10-06 2002-04-19 Revenet:Kk Automatic generation device for object-oriented program
JP2004089472A (en) * 2002-08-30 2004-03-25 Casio Comput Co Ltd Game information processing apparatus, and game information processing program
US20170282076A1 (en) * 2016-04-01 2017-10-05 Glu Mobile, Inc. Systems and methods for triggering action character cover in a video game
US20170357489A1 (en) * 2016-06-09 2017-12-14 Jeff Fleurimond System and method for developing applications

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2021122725A (en) * 2020-02-06 2021-08-30 エヌエイチエヌ コーポレーション Game difficulty prediction method and device utilizing game play server of deep learning base
JP7064559B2 (en) 2020-02-06 2022-05-10 エヌエイチエヌ コーポレーション Deep learning-based gameplay servers, game difficulty prediction servers, and gameplay service methods, as well as programs
US11738271B2 (en) 2020-02-06 2023-08-29 Nhn Cloud Corporation Method and apparatus for predicting game difficulty by using deep-learning based game play server
JP2023123018A (en) * 2022-02-24 2023-09-05 株式会社Precious Analytics Game evaluation method, device, and program
JP7519703B2 (en) 2022-02-24 2024-07-22 株式会社Precious Analytics Game evaluation method, device and program
WO2024116387A1 (en) * 2022-12-01 2024-06-06 日本電信電話株式会社 Information processing device, information processing method, and information processing program

Similar Documents

Publication Publication Date Title
CN112189188B (en) System, method, and machine learning support device for checking game program
CN105843734B (en) A kind of automated testing method, device and calculate equipment
US10384133B1 (en) Systems and methods for automatically measuring a video game difficulty
EP2888651B1 (en) Method for creating a mini-game
JP2019191786A (en) Game program generation device and game program generation program
US9875442B2 (en) Method, apparatus, and artificial intelligence editor for implementing artificial intelligence behavior
WO2017084283A1 (en) Data processing method and apparatus for mobile game
Horn et al. Opening the black box of play: Strategy analysis of an educational game
CN110457200B (en) Test case generation method and equipment, storage medium and electronic equipment thereof
CN110134375B (en) Game character behavior control method and device and readable storage medium
JP2012063868A (en) Method to generate combined parser by combining language processing parsers, and its computer and computer program
JP2023040035A (en) System, method, and program for inspecting game program, machine leaning support device, and data structure
US20240184660A1 (en) Method, program, system, and device for estimating cause of problem
Shirzadehhajimahmood et al. Using an agent-based approach for robust automated testing of computer games
JP4554499B2 (en) A scoring mechanism for automatically generated test programs
Williams et al. Identifying desirable game character behaviours through the application of evolutionary algorithms to model-driven engineering metamodels
JP5393941B2 (en) Game development device and game development method
US20230244954A1 (en) Evolutionary Techniques for Computer-Based Optimization and Artificial Intelligence Systems
CN106919388B (en) Table card game engine system
JP2007249826A (en) Test item generation device
Moncao et al. Shrinking a database to perform SQL mutation tests using an evolutionary algorithm
CN108159706A (en) A kind of game state control system and method
US20150118671A1 (en) Systems and Methods for Designing, Parsing and Mining of Game Log Files
Khan et al. Recovery of mobile game design patterns
JP2003099285A (en) Method and device for preparing test case related to function competition and program therefor

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20201116

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20211130

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20211207

A601 Written request for extension of time

Free format text: JAPANESE INTERMEDIATE CODE: A601

Effective date: 20220202

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20220607