Dark Theme

Click here for InteliMap PRO on the Unity Asset Store



Description

InteliMap PRO is the tool for you to use if you are looking to improve your 2D map design workflow, or if you want to create stunning AI generated tilemaps. It's main features are editor tools for you to easily and quickly create entire environments that look handcrafted, it also includes tools for highly performant runtime generation.

InteliMap PRO is the successor to InteliMap AI Tilemap Generator. Now with massively improved build times and many new features!

InteliMap supports any 2D tilemap, allowing you to simply use any tilemap you desire and start creating quicky, no coding required! Designed to be as simple and hassle-free as possible, this is sure to be the ideal asset for your game.

Features:

PRO Features:

Includes third-party tilemap assets. All third-party assets used are public domain. More information can be found in the Third-Party Notices.txt file in the package.

Links

Guides

This quick start guide is intended to get you using InteliMap AI Tilemap Generator as quickly as possible. If you'd like to learn more please watch the advanced guide as well, thank you!

This advanced guide will teach you many tips and tricks for InteliMap PRO. It includes information on all the different settings, how to use prefabs as tiles, and how to use the API to create your own runtime generation behaviour.

Trailers

InteliMap PRO is a tool that allows you to create stunning AI generated tilemaps, no coding required! Up to 32x faster build times compared to the original InteliMap and now with many new features! Buy now on the Unity Asset Store!

Getting Started

InteliMap PRO works using a system of builders and generators. First an InteliMapBuilder analyzes some example environment, this will generate a GeneratorData scriptable object. This scriptable object can then be used with an InteliMapGenerator component in order to generate tilemaps.

To begin this process first make sure you have added a tilemap to your scene, and created an example map using a tile palette of your choice (this is done exactly the same as in vanilla Unity, if you would like to learn how, watch the beginning of the Quick Start Guide). Next you'll want to add an IntelliMapBuilder component to any object in your scene. Now you'll need to add the example tilemap as a BuildMap for the builder, there are two ways to do this.

  1. On the left side of the scene view there will be a tool bar. When you have selected an object with an IntelliMapBuilder component, there will a tool with a hammer icon. Simply selecting that tool and dragging a box over the example map will add that area to the builders build maps.
  2. Clicking the plus icon on the build maps list will add a new build map. On the new entry you can select the map layers and bounds you would like to use. You can add multiple layers to build a multi-layered tilemap.

After you added all your build maps, you can simply click Build Generator on the builder. This will prompt you to pick a location to save the GeneratorData scriptable object, once you select a location, the training will begin. This may take a short time, but once it is done the generator data will be trained and ready to be used in an InteliMapGenerator component. To create that component you can simply click Create Generator Component on the builder. To get started using the generator, you have three options.

  1. On the left side of the scene view there will be a tool bar. When you have selected an object with an InteliMapGenerator component, there will be a tool with a map icon. Simply selecting that tool and dragging a box over the area you would like to generate will generate in that area.
  2. The InteliMapGenerator component includes a few buttons that will cause it to instantly generate at that generators boundsToFill. Change the bounds to whatever you would like, then hit the Generate button.
  3. You can also generate during runtime, this can be done either on scene start, or however else you like according to your custom runtime behaviours. You can read more about runtime generation in section 4.

Runtime Generation

On Start

By default, InteliMapGenerator's generateOnStart property is set to true. This means that if that InteliMapGenerator component is enabled. Then upon the scene starting (MonoBehaviour.Start), the area corresponding to that components boundsToFill and areaToFill will be generated.

How to Create Custom Runtime Behaviour

If you need more functionality than just generating on start, you will need to interact with the InteliMapGenerator through a script. In this short step by step guide you will learn how to create your own custom runtime generation behaviour with InteliMap.

Step 1: First create the component you wish to use to control this runtime generation. To do this right click on the assets panel, then Create > C# Script. This script will be responsible for controlling, in this example I'll be naming this script RuntimeExample. All of InteliMap PROs code is under the InteliMapPro namespace, thus you must should put using InteliMapPro; at the top of your project. At the end of step one your script should look like this (extra comments have also been included):

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using InteliMapPro; // needed to interact with InteliMapGenerator

public class RuntimeExample : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
    
    }

    // Update is called once per frame
    void Update()
    {
    
    }
}

Step 2: Next you'll need to be able to interact with an InteliMapGenerator. To do this add a public InteliMapGenerator variable, this will allow you to set your generator through the inspector. Now to generate you will want to call the StartGenerationAsync() method of that generator (if you want seeded generation, you can use the StartGenerationAsyncWithSeed(int seed) method). The reason you should use the asynchronous version of the generation instead of the synchronous version is because the asynchronous versions are non-blocking, whereas the synchronous versions are blocking and may cause a lag spike if the area to fill is large enough.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using InteliMapPro; // needed to interact with InteliMapGenerator

public class RuntimeExample : MonoBehaviour
{
    public InteliMapGenerator generator; // the generator to use for runtime generation

    // Start is called before the first frame update
    void Start()
    {
        generator.StartGenerationAsync(); // starts the generator upon Start
        // generator.StartGenerationAsyncWithSeed(1234); // also for generating with a seed
    }

    // Update is called once per frame
    void Update()
    {

    }
}

Step 3: Now that you have the basic generation working, you can do anything you'd like with the generator by moving its boundsToFill property and then calling StartGeneration. For example, if you wanted to make a side scrolling environment, you could you could incrementally move the boundsToFill's position to the right, and then call generate. One thing to note is to make sure the bounds overlap with what is already placed, if there is no overlap then the generator will not bother to meaningfully connect the tiles and you will end up with rough boundaries between the generated areas.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using InteliMapPro; // needed to interact with InteliMapGenerator

public class RuntimeExample : MonoBehaviour
{
    public InteliMapGenerator generator; // the generator to use for runtime generation

    public int chunkSize = 16;
    public float timePerChunk = 1.0f;

    // Start is called before the first frame update
    void Start()
    {
        generator.StartAsyncGeneration(); // starts the generator upon Start
        // generator.StartGenerationAsyncWithSeed(1234); // also for generating with a seed

        // Set the generators bounds to fill size to match the chunk size (+1 to ensure an overlap)
        generator.boundsToFill.size = new Vector3Int(chunkSize + 1, generator.boundsToFill.size.y, generator.boundsToFill.size.z);
    }

    // Update is called once per frame
    void Update()
    {
        // Increase the timer
        timer += Time.deltaTime;

        if (timer > timePerChunk)
        {
            // Reset the timer
            timer = 0.0f;

            // Tell the generator to generate
            generator.StartGenerationAsync();

            // Move the generators position to the right
            generator.boundsToFill.position += new Vector3Int(chunkSize, 0, 0);
        }
    }
}

Tips and Tricks

How to maximize speed

In order to maximize the speed of InteliMap, there are a few things you should keep in mind.

Most importantly is you should try to keep the amount of unique tiles as low as possible, this is because the machine learning model needs to make a unique prediction for each unique tile and because the time complexity algorithm used to resolve the contraints during generation is proportional to the cube of the number of unique tiles. Some things you can do keep the unique tile count low is to make sure you don't have duplicate tiles. InteliMap counts unique tiles based on the tiles that compose it, even if it may look exactly identical to another tile.

You should also try to keep the build maps as small as possible. It is sometimes better to split up a large build map into multiple smaller ones in order to gain speed. Note that this is only recommended when the generator does not use positional or border information as inputs, as splitting up the build map would cause it to use different inputs than intended.

Finally you should also use an approriate amount of training threads to build a generator. This currently defaults to 16, but it can be increased for even more performance if your machine has enough resources for all the threads. As a general rule of thumb, this value should be equal to the amount of cores on your CPU.

How to Pick Builder Settings

The epochs value is how many times to train the generator on the build maps. For simple maps this can be as little as a few hundred to a thousand, but for more complicated maps it may need to be larger than that.

One of the most important settings of the builder is the neighborhood radius. This is the radius around a tile that can influence what that tile becomes. The higher this value is, the longer building and generation may take. For most environments this should be set to around 2 or 3.

Advanced Generator Settings

The advanced generator settings are what determines how the generator will behave. The connectivity of the generator is how it will enforce which tiles are allowed to be connected to each other. There are also additional settings that allow the generator to use the position of a tile relative to the bounds of generation as an input.

Note that for hexagonal maps, the horizontal axis actually corresponds to the y direction, and similarly the vertical axis of a hexagonal map actually corresponds to the x direction. Thus if you want the connectivity of the top and bottom of a hexagonal map enforced, you would actually need to enable the left and right settings of enforce border connectivity.

Advanced Training Settings

The amount of training threads is the most important value that will determine the speed of the build. As a general rule of thumb, this value should be equal to the amount of cores on your CPU.

The learning rate can also highly influence the speed of the build, currently this defaults to some relatively low numbers, and thus training can be sped up by increasing these. However, increasing these too high may result in some numbers overflowing into NaN values, ruining the generator.

How to Pick Generator Settings

There are two values on the InteliMap Generator component that can influence the behaviour of the generation. These being temperature and randomOrder.

Temperature influences the randomness of the generator, this should be increased if the generator is producing very "bland" generation, it can also be decreased if the generator is producing undesireably wild generation. Note that this value is unclamped and can be set to as far positive or as far negative as you wish, however setting this value to extreme will impact performance. As a general rule of thumb, this value shouldn't surpass +10 or -10.

Random order determines what percentage of tiles will be placed completely randomly instead of being based on the confidence of the generator. If this is set to 0, then during generator, the next tile is always based off what tile the generator has the highest confidence in (this is similar to how wave function collapse works). If this is set to 1, then the generator will decide the next tile to place completely randomly. This should be increased if the generator is producing a lot of unwanted repeating patterns.

Training and Retraining a Generator

After a generator data object has been created. It can continue to be trained simply by placing the object back into the InteliMap Builder, then training again. This will recompute all the connectivity data for the component and continue training the weights and parameters of the machine learning model. Note that retraining the generator will not change many of its settings such as neighborhood radius or what to use as inputs.

Thus, if you want to recompute the connectivity data for a generator, but don't want to modify its parameters. You can train it for 0 epochs, this will reset the connectivity but not affect the parameters.

Using a Prefab as a Tile

If you would like to use a prefab as a tile, there is a very simple way to do that. You need to create a PrefabTile instance, then when that tile is included in a build map, InteliMap will recognize it like any other tile, and when that tile is generated it will also be generated with the prefab.

To do this, first create a PrefabTile instance by in your project going Create > InteliMap Pro > Prefab Tile. Now that you have created a prefab tile instance, you can set the sprite and prefab variables to whatever you would like. Afterwards, you can then add that tile to a tile palette and draw with it just like you would any other tile. Note that the prefab of the tile may not be shown in the tile palette, however it will still have that prefab in the scene. InteliMap stores tiles using the TileBase class, so it will recognize anything that extends from TileBase (such as PrefabTile in this example).

Script Reference

Everything in InteliMap PRO is under the InteliMapPro namespace.

Major Objects

InteliMapBuilder

Used for building InteliMapGenerators, which can be used to create AI generated tilemaps. Intended to be used while creating your scene, then removed before release. You can build during runtime, however it is not recommended due to the sometimes long build times.

public class InteliMapBuilder : MonoBehaviour

InteliMapGenerator

Can be used with a GeneratorData scriptable object to create AI generated tilemaps, can be used in the editor or at runtime.

public class InteliMapGenerator : MonoBehaviour

Minor Objects

GeneratorBuildResult

An enumerator of the result code of the most recent build from an InteliMapBuilder.

public enum GeneratorBuildResult

DirectionalBools

A struct that allows storing four bools that correspond to the four orthogonal directions.

public struct DirectionalBools

GeneratorMap

A single entry in the InteliMapBuilder's build maps.

public class GeneratorMap

GeneratorAdvanced

A class used to store all the advanced settings related to the generator for the InteliMapBuilder.

public class GeneratorAdvanced

TrainingAdvanced

A class used to store all the advanced settings related to the training for the InteliMapBuilder.

public class TrainingAdvanced

Connectivity

An enum dictating how to enforce which tiles can connect to which other tiles. Four way connectivity (Connectivity.FourWay) means only the orthogonal connections are enforced, eight way (Connectivity.EightWay) means diagonal connections are also enforced. Hexagonal connectivity (Connectivity.Hexagonal) should be used on hexagonal grids.

public enum Connectivity

Contact Information

If you have any questions or inquires please email intelimapai@gmail.com.