Initialization #
The initialization is the last step mentioned in the tutorial, but it is actually the most important node to run. There are two nodes for initialization: InitializeGametimeSystem and InitializeGametimeSystemFromData. You can call them any place you want, but I suggest you put them inside Level Blueprint to easily get access to reference to existing levels.
-
InitializeGametimeSystem
-
Startup Item Set
If the tile size of the input item set differs from the system, the initialize will fail.
-
Existing Tiled Levels
You may include existing tiled levels to be controlled by this system. However, there are two restrictions on included levels.
- No overlapping in boundary
- Specific transform (location snap to tile size, no rotation and scale) you can press these buttons to check it.
-
Unbound
If false, the system will only work inside the extent of included existing tiled levels.
-
-
InitializeGametimeSystemFromData
-
InData
Check out Save and Load.
-
Tiled Level Inside Data
If that existing level is already inside data, you should still specify them here.
-
Binding events #
In order to bind your gameplay logic and add any visual or sound feedback, you may want to bind your custom events to related delegates. Checkout Gametime Subsystem Delegate.
Custom data binding #
To support custom data binding, all you need to do is to create your data table with a KEY variable that can link to the tiled items inside your tiled item set. This plugin provides an automatic approach to help you make such linkage. The GUID in each tiled item will become the RowName in your data table.
- Make linkage
Set the data table and click Initialize Data. New empty rows will populate with RowName the same as item ID, while existing rows will stay unchanged. If you add new item to item set after setup this linkage, just click Create Row For Custom Data and the new row will generate in your data table.
- Edit inside tiled item set
As the linkage is setup properly, you can edit the data just below the detail panel for each item. It’s much intuitive to come up with descriptions for these items now.
- Query it for what you want.
Now you can easily query the data for your needs. EX: Check whether resource cost is affordable.
Edit the data in data table editor and in tiled item set editor at the same time may occasionally crash the editor. Once the linkage is made, you should just work in tiled item set editor.
AI Navigation #
If you want your AI agent update its navigation path in response to Build / Remove item in runtime. Like this:
All you need to do is to set runtime generation for nav mesh as dynamic. (Project Settings -> Navgation Mesh -> Runtime -> Dynamic)
Save and Load #
All placement info is stored in Gametime Data (type: Tiled Level Game Data) within your TiledLevelGametimeSystem. You can just create a save game object and add a new variable from type Tiled Level Game Data to save it. To load existing saved data, you can retrieve the data from your save game and call InitializeGametimeSystemFromData.
Check out Saving and Loading Your Game if your are not familiar with.
Here’s a sample for it’s setup:
Auto paint integration #
Use auto paint in gametime is supported. Checkout Auto nodes. With the same logic, activate preview, move preview, and apply to position.
Packaging issues #
To use the Tiled Level Gametime System, you must inform your game instance of its existence. If not, the packaged project will omit this system. Let your game instance know about the system during initialization by creating a game instance class and setting it in your project settings. Override the Init method to include any necessary references from your Build System, such as printing its name. With these steps, the system should function correctly.
Still happen in UE5.5
Restriction rule #
Hidden feature in V2.0, which allow you define specific area and allow/disallow player to add/remove item. This feature will come back in future updates.