Skip to content

Debugging Help

IsaacMulcahy edited this page May 20, 2023 · 26 revisions

Logging

This is logging that is done within the Unity Console

Start Up

When a scene starts the system will log how many of each type of the Job System was loaded into the Civil Manager

Failed Action or Method

When an action fails a Warning console log will be created, providing the Guid reference of the Action as well as the name and the item needed. This will then make the NPC try another method so a log will be made stating the Method failed providing the id and name if available.

Gizmos Colour Code

Gizmos are only shown on selection of the object and provide some useful information.

Houses

Desc Colour
Entrance Black

Workplaces

Desc Colour
Entrance Black

NPC

Desc Colour
Home Entrance Green
Workplace Entrance Blue
Look At Location Magenta
Way point path Red
Method from Job System N/A
Action from Job System N/A

Frequently Known Issues

The Region can't find a Workplace nor House

A Workplace or House must be on layer 'Civil' and have a collider for it to be found by the AI system, this was implemented to increase performance by removing the need to check each GameObject to see if it has the component.

The Region has a House and Workplace but no NPC is created

A Workplace requires Job data to be added, this is done by selecting the Workplace and adding to the JobData field, this section has a Job type (This is the name of the Job) and can have more than one position. The Houses has a default of five max residents but this could have been changed so is worth checking.

The Region has a House with more than zero max residents and a Workplace with Jobs setup but no NPC is created

This is down to the local Region character pool not having a character which fits the requirements. This could be either from the character pool being empty or the job needs a unique one (e.g. it doesn't use the shared pool and need a specific one defined).

A Item exists within the scene but the NPC can't find it?

An Item must be on layer 'Resource' and have a collider for it to be found by the AI system, this was implemented to increase performance by removing the need to check each GameObject to see if it has the component. If it is a check for 'owned' Items then the workplace of the NPC needs a reference to it in Assets.

My NPC get's stuck trying to reach a location

A common cause of this is the node height being too far from the ground, this results in the NPC never getting close enough to trigger the action as completed. Reasoning Y-axis is taken into account is to allow for 3D movement.

What happens if a stage fails?

A breakdown of what happens is explained here

Why are they not heading to work?

Each job type and workplace can have their own work times, make sure the time is between them. Local workplace times need to be enabled, if not the global job workplace time will be used. Time can be checked by looking at the Game Manager

They all have jobs and work places which are valid but they are doing nothing?

A common cause of this is not having the AI Orchestrator added to the scene. If you add this GameObject in this will resolve the issue