LevelKit GUI: Difference between revisions

From Off Grid Wiki
Jump to navigation Jump to search
(added pictures)
No edit summary
 
(30 intermediate revisions by 5 users not shown)
Line 1: Line 1:
== Getting Started ==
==Overview==
Inside of the Unity Levelkit project, you will find a menu for Offgrid, and all of the tools we have made to help you build and debug your levels.
[[File:LevelKitTools-window 01.png|thumb|400px|none|Where to find the LevelKit Tools window]]
 
 
==Levelkit Tool==
===Create Tab===
[[File:Create tab.png|400px]]
 
Once you're in the level Kit project and have opened the LevelKit tool you should be presented with this UI
 
Enter your:
* mission's "Name"
* a "Description"
* the "District" on the map you want it to show up in. ("Map" district is only used for conversations done at map screen, and should not be used for actual levels).
* the "Location" - this can be a anything, mods with the same Location name will show up on the same tile. *NOTE - at time of writing there is no way to select between two levels on the same tile so for now best to give unique Locations to different mods / levels
* and hit the "Create new Mod"
 
This will create your mission based on a template, it will open up the missions folder in your file browser as well as dropping you into the missions scene in Unity
 
===Build Tab===
[[File:Build tab.png|400px]]
 
The build tab allows you to compile your level so that you can test or upload your level.
 
'''Current level'''
 
This drop down box will allow you to create a new level or select an existing level.


* Download Unity
'''Save level info'''
* Download LevelKit


Open up the LevelKit project in Unity
The save level info page will allow you to save any information put within the text fields above.
This includes :
*Level Name
*Level Description
*District
*Location


This should give you a fresh and unsaved 'new scene' called 'Untitled'
'''Open level folder'''  


If you have already been playing with the level kit or already made an Off Grid level and want to make another, then hit Ctrl+N for create a new unsaved scene
This will open up the folder in which your mod level is stored.
(dont use 'create scene' this will create a named saved scene which will conflict with the levelkit tool)


In your new scene...
'''Open mission script'''


=== Creating a new level ===
This will open your Mission Script for your mod within your preferred code editor.


Go to the menu Item for Off Grid and select 'LevelKit Tool'
'''Lightmaps'''


[[File:LevelKitTools-window 01.png|thumb|400px|none|Where to find the LevelKit Tools window]]
By default your Lightmaps are built automatically, when you make a change to the level. By clicking the button "Build on Demand" will stop the lightmaps automatically being created.This will help with performance while you are creating your mod. Selecting the checkbox "On Build" will allow you to generate the lightmaps as you compile your mod.
 
'''Navigation mesh'''
 
A navigation mesh is used to set areas that the AI can navigate.The navigation mesh by default is generated when you compile your mod.This can be changed by unchecking the "On Build" checkbox. The navigation mesh can also be built on demand when you select the "Build Now" Button.
 
'''Build Level'''
 
The "Build Level" button will allow you to compile your level so that you can test or upload your level. The text on this button will change to let you know if any changes have been detected.
 
===Tweaks Tab===
[[File:Tweaks tab.png|400px]]
 
'''Fix Up Architecture'''
 
This will allow you to make small adjustments to your level geometry. Fixing issues with small gaps in your geometry caused by odd rounding on the GameObject transform component.This will allow you to make your geometry conform to a single decimal.
 
'''Fill Vertex Colours'''
 
Using Fill vertex will flood the object with a new vertex colour specified by the colour bar.This is ideal for objects that only have a single colour as it will flood the entire object.
 
===Validate Tab===
[[File:Validate tab.png|400px]]
 
The Validation Tab checks that objects within your mod are set up correctly. Be sure to check this before building your mod.Some errors can be fixed using the "fix" button that appears next to the error.
 
===Networking Tab===
[[File:Networking tab.png|400px]]
 
'''Testing'''
 
In order to test your mod in game you will need to "send" it to the game via the networking tab.
 
Open the game via steam as normal.
 
In options you will need to enable developer mode.
 
Then in the Level Kit tools window, click on the Networking tab and click the 'Search for game' button. Your window should now look like the above.
 
Once you have connected to the game click "start" to run your level. Clicking "stop" will stop your level and return you to the main menu. "Stop networking" will remove the connection between the Level Kit and the game.
 
Troubleshooting note: If you see this message in the console "[Net] Failed to connect "No connection could be made because the target machine actively refused it." You do not have developer mode enabled. Turn ths on in the Off Grid game options.
 
== Your mission folder ==
 
Your mission folder contains all the files that the game will read when loading your mission, here's an overview:
 
{| class="wikitable"
|-
! Folder !! Description
|-
| Bundles/ || This folder shouldn't be edited by users, it contains [https://docs.unity3d.com/Manual/AssetBundlesIntro.html Unity asset bundles]
|-
| level.lua || This contains metadata about the mission that's read in by the game, see [[Level.lua | here]] for more information
|-
| Scripts/ || The scripts folder should contain all the Lua files that your mission will run
|-
| Scripts/Example_mission.lua || This is the main mission script, see [[Mission Scripting]] for more information
|-
| Scripts/Conversations/ || Your [[Conversations | conversation scripts]] should be placed here
|-
| Scripts/Devices/ || Your [[Device Scripting | device scripts]] should be placed here
|}
 
==The Project File Structure==
<syntaxhighlight source lang="lua" line>
 
/Levels/
|-- SomeMod/
|      |-- Mission-1/
|      |      |-- Bundles/
|      |      |-- Content/
|      |      |      |--
|      |      |-- level.json
|      |      |-- strings.lua
|      |      |-- missionImage.png
|      |-- Mission-2
|      |      |-- Bundles/
|      |      |-- Content/
|      |      |-- level.json
|      |      |-- strings.lua
|      |      |-- missionImage.png
|      |-- mod.json
|-- OtherMod/


Enter the levels name and a brief description to give contect in the level selection screen.
</syntaxhighlight>


[[File:CreateNewLevel.png|thumb|400px|none|Creat a new level - Don't use the standard Unity workflow of Create>Scene]]


Hit create and the LevelKit tools will generate all the files and folders you require for organising your mission and building it, along with a player spawn and a gneric room for you to start creating from. At this point you can hit build and you can play already - although your level will be a grey walking simulator to start with ;).


[[File:Level-GeneratedFiles.png|400px|thumb|none|The editor tool will generate the files and folders needed]]
[[Category:Modding]]

Latest revision as of 19:43, 11 February 2024

Overview

Inside of the Unity Levelkit project, you will find a menu for Offgrid, and all of the tools we have made to help you build and debug your levels.

Where to find the LevelKit Tools window


Levelkit Tool

Create Tab

Once you're in the level Kit project and have opened the LevelKit tool you should be presented with this UI

Enter your:

  • mission's "Name"
  • a "Description"
  • the "District" on the map you want it to show up in. ("Map" district is only used for conversations done at map screen, and should not be used for actual levels).
  • the "Location" - this can be a anything, mods with the same Location name will show up on the same tile. *NOTE - at time of writing there is no way to select between two levels on the same tile so for now best to give unique Locations to different mods / levels
  • and hit the "Create new Mod"

This will create your mission based on a template, it will open up the missions folder in your file browser as well as dropping you into the missions scene in Unity

Build Tab

The build tab allows you to compile your level so that you can test or upload your level.

Current level

This drop down box will allow you to create a new level or select an existing level.

Save level info

The save level info page will allow you to save any information put within the text fields above. This includes :

  • Level Name
  • Level Description
  • District
  • Location

Open level folder

This will open up the folder in which your mod level is stored.

Open mission script

This will open your Mission Script for your mod within your preferred code editor.

Lightmaps

By default your Lightmaps are built automatically, when you make a change to the level. By clicking the button "Build on Demand" will stop the lightmaps automatically being created.This will help with performance while you are creating your mod. Selecting the checkbox "On Build" will allow you to generate the lightmaps as you compile your mod.

Navigation mesh

A navigation mesh is used to set areas that the AI can navigate.The navigation mesh by default is generated when you compile your mod.This can be changed by unchecking the "On Build" checkbox. The navigation mesh can also be built on demand when you select the "Build Now" Button.

Build Level

The "Build Level" button will allow you to compile your level so that you can test or upload your level. The text on this button will change to let you know if any changes have been detected.

Tweaks Tab

Fix Up Architecture

This will allow you to make small adjustments to your level geometry. Fixing issues with small gaps in your geometry caused by odd rounding on the GameObject transform component.This will allow you to make your geometry conform to a single decimal.

Fill Vertex Colours

Using Fill vertex will flood the object with a new vertex colour specified by the colour bar.This is ideal for objects that only have a single colour as it will flood the entire object.

Validate Tab

The Validation Tab checks that objects within your mod are set up correctly. Be sure to check this before building your mod.Some errors can be fixed using the "fix" button that appears next to the error.

Networking Tab

Testing

In order to test your mod in game you will need to "send" it to the game via the networking tab.

Open the game via steam as normal.

In options you will need to enable developer mode.

Then in the Level Kit tools window, click on the Networking tab and click the 'Search for game' button. Your window should now look like the above.

Once you have connected to the game click "start" to run your level. Clicking "stop" will stop your level and return you to the main menu. "Stop networking" will remove the connection between the Level Kit and the game.

Troubleshooting note: If you see this message in the console "[Net] Failed to connect "No connection could be made because the target machine actively refused it." You do not have developer mode enabled. Turn ths on in the Off Grid game options.

Your mission folder

Your mission folder contains all the files that the game will read when loading your mission, here's an overview:

Folder Description
Bundles/ This folder shouldn't be edited by users, it contains Unity asset bundles
level.lua This contains metadata about the mission that's read in by the game, see here for more information
Scripts/ The scripts folder should contain all the Lua files that your mission will run
Scripts/Example_mission.lua This is the main mission script, see Mission Scripting for more information
Scripts/Conversations/ Your conversation scripts should be placed here
Scripts/Devices/ Your device scripts should be placed here

The Project File Structure

/Levels/
|-- SomeMod/
|       |-- Mission-1/
|       |       |-- Bundles/
|       |       |-- Content/
|       |       |       |-- 
|       |       |-- level.json
|       |       |-- strings.lua
|       |       |-- missionImage.png
|       |-- Mission-2
|       |       |-- Bundles/
|       |       |-- Content/
|       |       |-- level.json
|       |       |-- strings.lua
|       |       |-- missionImage.png
|       |-- mod.json
|-- OtherMod/