Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
The GKC system for creating a Map system for your Player and Points of Interest.
Once a new player has been created, if you want to use the map system, you need to drag and drop the Map System prefab (with the same name) in the folder Assets/Game Kit Controller/Prefabs/Map System.
Once the hierarchy contains these two elements:
Then, go to Character gameObject, Map System inspector, and press the button Map Floor and Icons.
Go to Floors, and press the button Search Floor List. The floors configured in the Map Creator inspector will be configured automatically.
If you don’t need to use the map system, don’t configure the above steps and it will be disabled.
If you want to use the map system, you need to drag and drop the Map System prefab (with the same name) in the folder Assets/Game Kit Controller/Prefabs/Map System.
Once the hierarchy contains these two elements:
Inside the hierarchy of the Map System gameObject, go to Floor List and to Map Creator inspector.
Go to Floors List and press Add Floor button.
This element will contain all the map parts for the same floor. At the same time, every map part contains a group of empty transforms which are used as a vertex to create the map part mesh, like a room, a corridor, a wall, etc…
In the hierarchy, you can see that inside the Floor List transform, a new transform has been added as a parent to that floor, and inside that floor, the first map part.
Open the first element of the floor list, which already contains the first map part, to the Map Tile Builder inspector, and press the button Add Transform in the Vertex Position list.
For example, if you press this button 4 times, 4 empty transforms will be attached inside the MapPart-001, used as the vertex for the mesh that will be created.
For an easy workflow, in the Map Tile Builder, go to Gizmo Settings and enable the Use Handle For Vertex and configure the radius as you need.
You can also move the transform 001 to 004 to place the vertex to make the shape that you need.
You can add as many vertexes as you need, to make rooms or places simple, for example, squares or rectangles to circular rooms, hexagonal, etc…, just press the button Add Transform.
When the game starts, the shape is created, looking like this:
You can remove any of these vertexes by pressing the X button and both the object in the scene and in the list are removed.
Initial steps for setting up the Game Kit Controller's Map System
Once a new player has been created, if you want to use the map system, you need to drag and drop the Map System prefab (with the same name) in the folder Assets/Game Kit Controller/Prefabs/Map System.
Once the hierarchy contains these two elements:
Then, go to Character gameObject, Map System inspector, and press the button Map Floor and Icons.
Go to Floors, and press the button Search Floor List. The floors configured in the Map Creator inspector will be configured automatically.
If you don’t need to use the map system, don’t configure the above steps and it will be disabled.
IMPORTANT: THE CLOSE COMBAT ANIMATIONS (KICK AND PUNCHES) ARE NOT INCLUDED IN THIS ASSET, BUT THE SYSTEM THAT USES THEM. YOU CAN FIND THOSE COMBAT ANIMATIONS AND MORE IN THE FREE ASSET TAICHI CHARACTER PACK, WHICH WAS USED TO TEST THIS SYSTEM. TO USE IT, JUST SET THE ANIMATIONS IN THE COMBAT LAYER OF THE ANIMATOR.
This can be used to place names in any room or to place the floor name shown on the map. For this, go to Text Mesh List in the Map Tile Builder inspector and press Add Text Mesh.
A new text mesh is attached inside the map part transform.
Configure in the inspector the size and content and place where you need it.
If you press play, the text will be shown in both the Minimap and map window menu.
You can add as many text mesh as you need in every map part. You can see in the gizmo, that every text mesh is linked with its map part owner.
To remove any of these meshes, press the X button, and both the object in the scene and in the list are removed.
Go back to the Floor List gameObject, to the Map Creator Inspector, and press the button Add Floor again.
Like before, a new floor transform will be added to the hierarchy.
Also, in the scene, a gizmo shows the position of every floor, so move the new floor position according to your level scene.
This will be used to know where the player is according to the closest vertical distance to the floor list (used by default). Now you can start to add new map parts to the new floor.
For example in this image, there are two floors using two cubes and two map floors configured, so the closest floor map to the player will be rendered in the map window.
With the new floor added to the list, don’t forget to go to the Map System inspector and press Search Floor List.
And this is shown in the map menu by floor:
This is useful to use parts already created of a floor for equal or similar rooms or shapes. For this, go to the map part that you want to copy, Map Tile Builder inspector, and press the button Duplicate Map Part.
Then, like before, another map part is created, with the same hierarchy that the copied, so you can move it to the place you need. The text meshes are copied too.
To remove a map part from a floor, go to the Map Creator inspector and press the button X, and both the object in the scene and the list are removed.
In this case, don’t forget to update the floor list in the Map System inspector, like before.
If you want to remove a map part, go inside the floor which has that part and press the X button, and both the object in the scene and the list are removed.
If instead of using vertical distance to know the closest floor where the player is, you can use triggers to change between floors. This can be used better for closed spaces levels, instead of opened.
For this, go to the Map Creator inspector, and in the floor that you need, open the Trigger To Change Floor list and press the Add Trigger button.
And like before, the gameObjects are created and attached to the proper hierarchy elements.
Like this, place this trigger where you want the map floor to be changed to Floor 0. This system is made to use two triggers for a zone, it means, one trigger to change to floor 0 and one trigger to change to floor 1 in every place the floors are changed, both of them close (for example, if the building has two stairs, to walk between both floors, there will be 4 triggers, two for every stair).
This can be appreciated here, in the demo mansion, there are two triggers in the stairs of the hall, one to change to Floor 1 and another for Floor 0. Also, a gizmo is used to show the link from every trigger to its floor.
Once the triggers are placed, go to the Map System inspector, go to Map Settings, and set to false the option Get Closest Floor To Player By Distance.
You can add as many triggers as you need for every floor. Also, you can remove any of these triggers with the X button and both the object in the scene and the list are removed.
The map can be shown in the map or you can select if a certain floor or map part is not shown, so the player needs to reach that zones or get a map pickup of that zone, to make it visible in the map window.
For this, go to Map Creator Inspector and open the Map Parts List of a floor.
Then, you can select every map part state of that floor one by one, using the Enabled option.
You can also, enable or disable entire floors with the options Disable All Floor Parts and Enable All Floor Parts.
Once some map parts have been disabled, you can configure the trigger that will show the map part when the player reaches that zone. For this, go to the map part that you need, Map Tile Builder inspector and press the button Add Trigger Event to Enable Map Part.
A trigger is automatically created, but you can add as many triggers as you need for the same map part (for example a room with three doors, so it will be activated no matter the door the player uses to enter).
Next, select the MapPartEnabledTrigger_1 in the inspector and the hierarchy will show this element, select it there and place every trigger where you need it.
As you can see, in this picture, this trigger is used to show the Main Hall of the mansion when the player enters it.
Also, the trigger shows this gizmo, making it easier to see in the scene.
To remove any trigger, press the X button, and both the object in the scene and the list are removed.
Show a hidden map part with another color until it is visible
This can be used to show that map part as hidden but showing its shape, but not its text mesh. For this, go to the Map Tile Builder inspector and enable the option Use Other Color If Map Part Disabled (make sure the option Map Part Enabled is false).
In this case, a color field appears to be configured:
In the above pictures, this can be appreciated, on the left, the main hall hasn’t been found yet, and on the right, the player has found it with the map part trigger.
Once you have a list of icons, go to an object that you want to be shown on the map (an enemy, a door, etc…) and add the component Map Object Information.
In this component, you can configure a name, a description, the type of icon, the floor where this icon is shown, an offset for the icon, and the map part where the icon belongs, for example, a save station inside a room.
The Map Icon Type field will show the same list of icons configured in the Map System previously.
The Floor number field works in the same way, it will show the list of floors configured in the Map System, used to configure in which floor the map icon is shown.
Another field, called Visible in all floors can be selected to show that map icon at every moment in the map window, no matter the current floor where the player is.
For example, a Save Station with the next configuration will show this info in the map window:
Once you have configured all the Map Object Information components in the scene, go to Map System inspector, and press the button Set Map Object Information ID.
This is used in the Map System to manage the map icons properly.
In the Map System inspector, you can configure the icons used in the map window (which are assigned in the map object information). To add new ones or configure them, go to the option Map Floor And Icons.
And then, to Map Icon Types.
In this list you can add a new type of icon:
For this, press the button Add Icon, configure a name, drag and drop one of the other icons already made, set the image you need, and make a prefab of it. Configure that prefab in this list.
This is useful to hide map parts or floors at the start of the game, so the player can unlock these zone maps with pickups for example.
For this, once some floors or map parts are disabled, drag and drop the Map Inventory Prefab, in Prefabs/Inventory/Usable.
In that object, go to the Map Zone Unlocker inspector and press the button Search Floor List to get the configured map floors in the Map Creator.
Open every map floor list that you need and select the map parts that this pickup will unlock.
So like this, when the pickup is grabbed by the player, these zones will be shown in the map window.
For example, in the mansion demo, there are three map unlocker pickups, one that enables all the floor 0 and the other 2, which enable half of the map of floor 1.
Floor 0 before and after unlocking the map.
In this case, the first floor map is disabled and the player picks one map unlocker and then the other.
This can be used to hide icons in the map on hidden map parts, so if a map part is not enabled, the icons inside that map part are disabled too and once the map part is enabled, the icons will be shown in the map as well.
For this, go to the Map Object Information inspector and enable the option Belong To Map Part.
Then, select the Map Part Owner, which means the map part that contains that icon. Use the list of map parts to select where the icon belongs. This list is shown according to the Floor Number configured in the inspector.
The list of floors is configured automatically from the map floors configured in the Map Creator inspector.
Like this, if you select the floor-000, it will appear the map parts list of that floor. In the left picture, the map part list shown belongs to the ground floor. In the right picture, the map part list belongs to the first floor.
In this example, the Map Object Information is used for a save station in the main hall room, which is disabled until the player enters the room. Also, 3 doors are configured with the same unlock values.
To make the terrain visible in the map system, follow these steps:
Assign the layer Terrain to the terrain gameObject.
Inside the Map System gameObject, there is a camera, to render the tile meshes created with the map creator. In that camera, add the layer Terrain in the culling mask.
Make sure to create at least an empty floor in the Map System component in the Character gameObject, it doesn't need to have any map part.
Then, the terrain will be visible in editor mode in the mini window and ingame.
Once you have created all the map floors (or if you have added or removed them on the floor list) go to Character gameObject, Map System inspector, and press the button Map Floor and Icons.
Go to Floors, and press the button Search Floor List. The floors configured in the Map Creator inspector will be configured automatically.
If you don’t need to use the map system, don’t configure the above steps and it will be disabled.