Coder Social home page Coder Social logo

statemachineexamples's Introduction

Unreal Engine 4でブループリントでのステートマシンサンプル

対応Ver UE 4.14.0

解説

UE4.7にて追加されたブループリント コンポーネントと、更にブループリント インターフェースを使用し、 汎用的なステートマシンを実現するサンプルです。

フォルダー内に用意されている、『StateMachine』フォルダーを他プロジェクトに移行する事で使用できます。 『Examples』フォルダーには使用例となっているブループリントとアセットが格納されています。

基本的な使用方法

『StateMachineComponent』をブループリントアクターにコンポーネントとして追加します。 これがステートマシン全体の管理を司ります。 次に『StateComponent』を継承したブループリントコンポーネントを新規作成します。 これが個々のステートを実現するコンポーネントとなります。 作成したコンポーネントは必要に応じてブループリントアクターにコンポーネントとして追加しておきます。

あとは必要なステートに応じて同様のステートコンポーネントを追加します。 ステートコンポーネント内では自由にロジックを作成する事ができ、 『TransitionState』を使って簡単に別ステートへと遷移する事が出来ます。 具体的な使用例は『LandEnemyBP』や『FireEnemyBP』を参考に。

プロジェクト全体について

基本的にアセットに関してはフリー素材として使用が可能です。 自由に改変して使っていただいて構いません。 また、プロジェクトを改変して公開する場合にはメールやTwitterなどで一報をいただけると嬉しいです。

このプロジェクトはステートマシンとしてのAIの実装例だけでなく、2Dアクションゲームとしての最低限のサンプルや ブループリント コンポーネントの使い方、ブループリント インターフェースの使い方など、 様々な部分で実用的になるように考えて作っているつもりですので、ぜひ参考にしてみてください。

そしてここからわかったテクニックなどがありましたら、ぜひ私にも教えてください。

連絡先

Twitter : @aizen76

mail : [email protected]

statemachineexamples's People

Contributors

alwei avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.