SymOntoClay is game AI experimental open source engine.


  Warning logo Purely experimental and very unstable project developed by only one person
Please read the page before starting

Getting started game development on Unity with SymOntoClay

Contens

Here is a tutorial how to use SymOntoClay in Unity scene.

You can see, learn and run this example in repository https://github.com/Symontoclay/demo1_linear_code.

Install SymOntoClay CLI

back to top

See here or here about installation SymOntoClay CLI.

Create new project on Unity

back to top

Create new project on Unity (if It's need) or use exisiting project.

The unity project should contain a humanoid NPC model.

Install SymOntoClay components for Unity

back to top

See here about installation components for Unity.

Write SymOntoClay DSL code

back to top

Get started with writing simple code for walking NPC by a path.

  1. Open a command prompt and navigate to Asset directory of your game.
  2. Create new SymOntoClay worldspace SymOntoClayDSLCode.
    soc new -world SymOntoClayDSLCode
  3. Navigate to directory SymOntoClayDSLCode.
  4. Create new NPC called MyNPC.
    soc new -npc MyNPC
    The NPC be created at path /Asset/SymOntoClayDSLCode/Npcs/MyNPC.
  5. Navigate to the created NPC and open file MyNPC.soc for editing.
  6. Write code:
    app MyNPC
    {
        on Init =>
        {
            "Begin" >> @>log;
            "The Beatles!" >> @>log;
            @@host.`go`(to: #@[20, -45]);
            "End of step 1" >> @>log;
            @@host.`go`(to: #@[10, 90]);
            "End of step 2" >> @>log;
            @@host.`go`(to: #@[10, -20]);
            "End of step 3" >> @>log;
            @@host.`go`(to: #@[10, -10]);
            "End of step 4" >> @>log;
            @@host.`go`(to: #@[5, -20]);
            "End of step 5" >> @>log;
            @@host.`go`(to: #@[14, 2]);
            "End of step 6" >> @>log;
            @@host.`go`(to: #@[20, -90]);
            "End of step 7" >> @>log;
            @@host.`go`(to: #@[20]);
            "End of step 8" >> @>log;
            "End" >> @>log;
        }
    }
  7. Save changes and close file MyNPC.soc.

Set up scene for using SymOntoClay components for Unity

back to top

Set up world

back to top

  1. Add component World to Terrain.
  2. Choose SymOntoClayDSLCode in property World File.

Set up Humanoid NPC

back to top

  1. Add component Humanoid NPC to target NPC.
  2. Choose MyNPC in property App File.

Add host endpoints to Humanoid NPC

back to top

Elementary (basic) actions are Unity ar even game specific because It could require interaction with animation, visual effects or something else.

You should implement host endpoints.

You can use ExampleSymOntoClayHumanoidNPC.cs as example. Copy and add this file to target NPC.

Run scene

back to top

Use Play in Unity Toolbar.

After starting Play mode you can see that NPC walks by defined in SymOntoClay DSL path.

Build game

back to top

Use standard Unity tools for building game.

SymOntoClay builds itself into Unity build pipeline.

Write more code

back to top

Learn more about SymOntoClay DSL.

See examples of using SymOntoClay's components for Unity.

Try SymOntoClay DSL examples.