Пример #1
0
 void Awake()
 {
     testNumber   = 0;
     subject      = new LocationSubject();
     count        = 0;
     localObjects = new List <ObjectMemory>();
 }
    /// <summary>
    /// Create and register a new location
    /// </summary>
    /// <param name="center"></param>
    /// <param name="radius"></param>
    public GameObject CreateLocation(Vector3 center, float radius)
    {
        //first, pull the genaric LocationSubject from the masterSubjectList and create prefab
        LocationSubject locFromMaster     = masterSubjectList.GetSubject(DbIds.Location) as LocationSubject;
        GameObject      newLocationObject = Instantiate(locFromMaster.Prefab, center, Quaternion.identity);

        newLocationObject.transform.localScale = new Vector3(radius * 2, 0.1f, radius * 2);

        //grab our connected script and create a fresh LocationSubject
        LocationObjectScript script        = newLocationObject.GetComponent <LocationObjectScript>() as LocationObjectScript;
        LocationSubject      newLocSubject = new LocationSubject();

        //now lets set the values to make a new locationSubject card
        newLocSubject.Name        = "Location " + Time.time;
        newLocSubject.Description = "New Location " + Time.time;
        newLocSubject.Radius      = radius;
        newLocSubject.Coordinates = center;
        newLocSubject.Layer       = 1;

        //add the next id available
        newLocSubject.SubjectID = masterSubjectList.GetNextID();
        script.InitializeFromSubject(masterSubjectList, newLocSubject);

        //now add our card to the master list
        if (!masterSubjectList.AddSubject(newLocSubject))
        {
            Debug.Log("FAIL ADD");
        }
        //store to the script attached to our new object
        return(newLocationObject);
    }
Пример #3
0
    /// <summary>
    /// Begin path finding to a new location.
    /// </summary>
    /// <param name="newLocation">The location to move to.</param>
    internal void MoveToNewLocation(LocationSubject newLocation)
    {
        if (newLocation == null)
        {
            Debug.Log("AnimalObjectScript::MoveToNewLocation() \n    Error: null location");
            return;
        }

        if (destination != null)
        {
            if (destination.SubjectID == newLocation.SubjectID)
            {
                return;
            }
        }
        // remove chase target if we're moving to a location
        chaseTarget = null;
        destination = newLocation;
        isCurrentLocationExplored = false;
        // queue up the waypoints for the new location

        // flip a coin on which method of area waypoints to use
        if (UnityEngine.Random.Range(0.0f, 1.0f) > 0.5f)
        {
            destinationWayPoints = newLocation.GetAreaWaypoints(npcCharacter.SightRangeNear);
            if (destinationWayPoints.Length > 1)
            {
                destinationWayPoints = ShiftToNearestFirst(destinationWayPoints);
            }
        }
        else
        {
            destinationWayPoints = newLocation.GetAreaWaypoints(npcCharacter.SightRangeNear, 1);
            if (destinationWayPoints.Length > 1)
            {
                destinationWayPoints = destinationWayPoints
                                       .OrderBy(o => Vector3.Distance(transform.position, o))
                                       .ToArray();
            }
        }
        // debugging- show generated waypoints in editor interface
        for (int i = 0; i < destinationWayPoints.Length; i++)
        {
            Color waypointColor = Color.red;
            if (subject.SubjectID == DbIds.Plinkett)
            {
                waypointColor = Color.blue;
            }
            if (subject.SubjectID == DbIds.Gobber)
            {
                waypointColor = Color.yellow;
            }
            Vector3 wayPtTop =
                new Vector3(destinationWayPoints[i].x,
                            0.25f + ((float)i / destinationWayPoints.Length) * 0.5f,
                            destinationWayPoints[i].z);
            Debug.DrawLine(destinationWayPoints[i], wayPtTop, waypointColor, 10.0f);
        }
        currentWaypointIndex = 0;
    }
Пример #4
0
    private void AiSafety()
    {
        // If safety is the top priority, combat is an unsafe action.
        // Stop combat, run for your life.
        status.UnsetState(NpcStates.Fighting);
        // if we have a nest assume it is safe and go there first
        if (HaveNest())
        {
            // if not at nest move there first
            if (objectScript.Location.SubjectID != definition.Nest.LocationSubjectID)
            {
                objectScript.MoveToNewLocation(db.GetSubject(definition.Nest.SubjectID) as LocationSubject);
                return;
            }
        }

        // don't have nest or we're at nest and it isn't safe. move to safe location
        LocationSubject safeLocation = FindSafeLocation(objectScript);

        if (safeLocation != null)
        {
            objectScript.MoveToNewLocation(safeLocation);
        }
        else
        {
            AiExplore();
        }
    }
    /// <summary>
    /// !!!  FOR TESTING ONLY DO NOT USE !!! <para/>
    /// Place a new location in the world and add it to the MasterSubjectList.
    /// </summary>
    /// <param name="newPosition">The center point of the new location</param>
    /// <param name="newRadius">The radius of the new location.</param>
    public GameObject T_PlaceLocation(Vector3 newPosition, float newRadius)
    {
        LocationSubject newLocation = new LocationSubject(masterSubjectList.GetSubject(DbIds.Location) as LocationSubject);

        newLocation.Name        = "Location " + Time.time;
        newLocation.Description = "New Location " + Time.time;
        newLocation.Radius      = newRadius;
        newLocation.Coordinates = newPosition;
        newLocation.Icon        = null;
        newLocation.Layer       = 1;
        //add the next id available
        newLocation.SubjectID = masterSubjectList.GetNextID();

        GameObject           location1 = Instantiate(newLocation.Prefab, newPosition, Quaternion.identity);
        LocationObjectScript locScript = location1.GetComponent <LocationObjectScript>();

        locScript.InitializeFromSubject(masterSubjectList, newLocation);
        locScript.Relocate(newLocation);

        if (!masterSubjectList.AddSubject(newLocation))
        {
            Debug.Log("FAIL ADD");
        }
        return(location1);
    }
Пример #6
0
 /// <summary>
 /// Relocate and resize using location subject card
 /// </summary>
 /// <param name="newLocation"></param>
 public void Relocate(LocationSubject newLocation)
 {
     //resize and reposition if we have a valid location subject
     if (newLocation != null)
     {
         gameObject.transform.localScale = new Vector3((float)newLocation.Radius * 2, 0.1f, (float)newLocation.Radius * 2);
         gameObject.transform.position   = newLocation.Coordinates;
     }
 }
Пример #7
0
 /// <summary>
 /// Create new LocationSubject object based on an existing one.
 /// </summary>
 public LocationSubject(LocationSubject newLocation) : base()
 {
     name            = newLocation.Name;
     description     = newLocation.Description;
     icon            = newLocation.Icon;
     coordinates     = newLocation.Coordinates;
     radius          = newLocation.Radius;
     prefab          = newLocation.Prefab;
     layer           = newLocation.Layer;
     relatedSubjects = newLocation.RelatedSubjects;
 }
Пример #8
0
    /// <summary>
    /// Copy an existing LocationSubject.
    /// </summary>
    public override Subject Copy()
    {
        LocationSubject newLocationSubject = new LocationSubject();

        newLocationSubject.subjectID       = subjectID;
        newLocationSubject.name            = name;
        newLocationSubject.description     = description;
        newLocationSubject.icon            = icon;
        newLocationSubject.prefab          = prefab;
        newLocationSubject.relatedSubjects = relatedSubjects;

        newLocationSubject.coordinates = coordinates;
        newLocationSubject.radius      = radius;
        newLocationSubject.layer       = layer;
        return(newLocationSubject);
    }
Пример #9
0
 /// <summary>
 /// Chase the target until ChaseStop() is called.
 /// </summary>
 /// <param name="target">The object scripte of the game object to chase.</param>
 internal void ChaseStart(SubjectObjectScript target)
 {
     // remove destination while chasing a target
     destination = null;
     if (chaseTarget != null)
     {
         if (chaseTarget.GetInstanceID() != target.GetInstanceID())
         {
             chaseTarget = target;
         }
     }
     else
     {
         chaseTarget = target;
     }
 }
    public void TestSet2()
    {
        // testing location waypoint generation
        float                testLocationRadius = 6.0f;
        float                testSightRadius    = 2.0f;
        Vector3              loc1Offset         = new Vector3(-testLocationRadius - (2 * testSightRadius), 0, 0);
        Vector3              loc2Offset         = new Vector3(0, 0, -testLocationRadius - (2 * testSightRadius));
        GameObject           loc1      = T_PlaceLocation(loc1Offset, testLocationRadius);
        LocationObjectScript locScript = loc1.GetComponent <LocationObjectScript>();
        LocationSubject      locSub    = locScript.Subject as LocationSubject;

        Vector3[] locs = locSub.GetAreaWaypoints(testSightRadius, 1);
        if (locs.Length > 0)
        {
            for (int i = 0; i <= locs.Length - 1; i++)
            {
                //Debug.Log(i + " : " + locs[i].x + "," + locs[i].y + "," + locs[i].z + "\n");
                T_PlaceLocation(locs[i], testSightRadius);
            }
        }
        else
        {
            Debug.Log("  -- loc1 !  -- No waypoints generated.");
        }

        GameObject           loc2       = T_PlaceLocation(loc2Offset, testLocationRadius);
        LocationObjectScript loc2Script = loc2.GetComponent <LocationObjectScript>();
        LocationSubject      loc2Sub    = loc2Script.Subject as LocationSubject;

        Vector3[] locs2 = loc2Sub.GetAreaWaypoints(testSightRadius);
        if (locs2.Length > 0)
        {
            for (int i = 0; i <= locs2.Length - 1; i++)
            {
                //Debug.Log(i + " : " + locs[i].x + "," + locs[i].y + "," + locs[i].z + "\n");
                T_PlaceLocation(locs2[i], testSightRadius);
            }
        }
        else
        {
            Debug.Log(" -- loc2 !  -- No waypoints generated.");
        }
    }
Пример #11
0
    /// <summary>
    /// UpdateRelatedInLocation finds objects inside the location and adds them to the relatedSubjects locally
    /// </summary>
    public void UpdateRelatedInLocation()
    {
        LocationSubject locationSubject = subject as LocationSubject;

        if (locationSubject == null)
        {
            return;
        }

        //grab collides within the area of our location and create a list of objects
        int layerMask = ~((1 << 8) | (1 << 9)); // filter out terrain and locations

        Collider[] hitColliders = Physics.OverlapSphere(locationSubject.Coordinates, locationSubject.Radius, layerMask);

        List <int> foundSubjectIDs = new List <int>();

        localObjects.Clear();
        for (int i = 0; i < hitColliders.Length; i++)
        {
            // get the base script class for our objects
            SubjectObjectScript script = hitColliders[i].GetComponent <SubjectObjectScript>() as SubjectObjectScript;
            if (script == null)
            {
                Debug.Log("SubjectObjectScript was not assigned to " + hitColliders[i].name);
                continue;
            }

            //tell each Object that it is within our location
            script.Location = subject as LocationSubject;

            //record each subjectID found if not already recorded
            int foundID = script.Subject.SubjectID;
            if (!foundSubjectIDs.Contains(foundID))
            {
                foundSubjectIDs.Add(foundID);
            }

            //record object quantites for NPC memory
            ObjectMemory existingMemory = localObjects.Find(o => o.SubjectID == script.Subject.SubjectID);
            if (existingMemory != null)
            {
                existingMemory.Quantity++;
            }
            else
            {
                localObjects.Add(new ObjectMemory()
                {
                    Quantity = 1, SubjectID = script.Subject.SubjectID
                });
            }
        }

        //Compare to old so that we may not need to publish to master
        int[] newRelated = new int[foundSubjectIDs.Count];
        newRelated = foundSubjectIDs.ToArray();

        if (newRelated.Length != subject.RelatedSubjects.Length)
        {
            isChanged = true;
        }
        else
        {
            for (int i = 0; i < newRelated.Length; i++)
            {
                if (newRelated[i] != subject.RelatedSubjects[i])
                {
                    isChanged = true;
                    break;
                }
            }
        }

        //Store output in local subject copy
        subject.RelatedSubjects = foundSubjectIDs.ToArray();
    }
Пример #12
0
    // Update is called once per frame
    void Update()
    {
        if (!npcCharacter.IsDead)
        {
            MetabolizeTickCounter += Time.deltaTime;
            if (MetabolizeTickCounter >= npcCharacter.Definition.MetabolizeInterval)
            {
                int healthChange = npcCharacter.Metabolize();
                MetabolizeTickCounter -= npcCharacter.Definition.MetabolizeInterval;
                if (healthChange > 0)
                {
                    GameObject.FindGameObjectWithTag("GameController").GetComponent <PlacementControllerScript>().PopMessage(healthChange.ToString(), gameObject.transform.position, 2);
                }
                else if (healthChange < 0)
                {
                    GameObject.FindGameObjectWithTag("GameController").GetComponent <PlacementControllerScript>().PopMessage(healthChange.ToString(), gameObject.transform.position, 0);
                }
            }

            AiCoreTickCounter += Time.deltaTime;
            if (AiCoreTickCounter > AiTickRate)
            {
                npcCharacter.AiCoreProcess();
                AiCoreTickCounter -= AiTickRate;
            }

            // ===  Movement ===
            if (destination != null) // traveling to a new location
            {
                if (destinationWayPoints.Length != 0)
                {
                    float distance = Vector3.Distance(destinationWayPoints[currentWaypointIndex], transform.position);
                    if (distance > (npcCharacter.SightRangeNear))
                    {
                        MoveTowardsPoint(destinationWayPoints[currentWaypointIndex], npcCharacter.MoveSpeed);
                    }
                    else if (distance > 0.25)
                    {
                        MoveTowardsPoint(destinationWayPoints[currentWaypointIndex], npcCharacter.MoveSpeed * 0.85f);
                    }
                    else
                    {
                        if (currentWaypointIndex == destinationWayPoints.GetUpperBound(0))
                        {
                            // we have arrived at the final waypoint for this location
                            isCurrentLocationExplored = true;
                            npcCharacter.AddSearchedLocation(destination.SubjectID);
                            // remember the location now that it is explored fully
                            UnityEngine.Object[] scripts = FindObjectsOfType(typeof(LocationObjectScript));
                            LocationObjectScript inspectLocationScript = scripts.Single(o =>
                                                                                        (o as LocationObjectScript).Subject.SubjectID == destination.SubjectID)
                                                                         as LocationObjectScript;
                            inspectLocationScript.TeachNpc(npcCharacter);

                            npcCharacter.Inspect(inspectLocationScript.gameObject);

                            destinationWayPoints = new Vector3[0];
                            destination          = null;
                        }
                        else
                        {
                            currentWaypointIndex++;
                        }
                    }
                }
            }
            else if (chaseTarget != null) // chase the target
            {
                float distance = Vector3.Distance(chaseTarget.transform.position, transform.position);
                if (distance > 0.75)
                {
                    MoveTowardsPoint(chaseTarget.transform.position, npcCharacter.MoveSpeed);
                }
                else
                {
                    Vector3 targetDir = chaseTarget.transform.position - transform.position;
                    transform.rotation = Quaternion.LookRotation(targetDir);
                    chaseTarget        = null;
                }
            }
        }
        else // this animal is dead
        {
            if (!isDead) //newly dead
            {
                Inventory.Add(new InventoryItem(DbIds.Meat, 5));
                isDead    = true;
                decaytime = 20.0f;
            }
            decaytime -= Time.deltaTime;
            UpdateDeadnessColor();
            if (decaytime < 0)
            {
                Destroy(this.gameObject);
            }
        }

        // Debug: near vision range
        DrawDebugCircle(transform.position, npcCharacter.SightRangeNear, 20, new Color(0, 0, 1, 0.5f));
        // Debug: far vision range
        DrawDebugCircle(transform.position, npcCharacter.SightRangeFar, 20, new Color(0, 0, 0, 0.3f));
    }
    // Update is called once per frame
    void Update()
    {
        // ------------------------------------------------------------------------
        // ------------------------ START CAMERA MOVEMENT -------------------------
        // ------------------------------------------------------------------------
        if (lastSelector != null)
        {
            cameraDestination = new Vector3(lastSelector.transform.position.x,
                                            cameraDestination.y,
                                            lastSelector.transform.position.z);
        }
        else if (Input.GetMouseButton(2))
        {
            // panning camera
            float mouseY = Input.GetAxis("Mouse Y");
            if (mouseY != 0)
            {
                cameraDestination = new Vector3(cameraDestination.x,
                                                cameraDestination.y,
                                                Camera.main.transform.position.z + mouseY * (cameraDestination.y / 25));
            }
            float mouseX = Input.GetAxis("Mouse X");
            if (mouseX != 0)
            {
                cameraDestination = new Vector3(Camera.main.transform.position.x + mouseX * (cameraDestination.y / 25),
                                                cameraDestination.y,
                                                cameraDestination.z);
            }
        }
        float mouseWheelDelta = Input.GetAxis("Mouse ScrollWheel");

        if (mouseWheelDelta != 0)
        {
            Vector3 camPosition = Camera.main.transform.position;
            cameraDestination = new Vector3(camPosition.x,
                                            camPosition.y - mouseWheelDelta * (camPosition.y),
                                            Camera.main.transform.position.z);
        }
        if (Vector3.Distance(Camera.main.transform.position, cameraDestination) > 0.1f)
        {
            Camera.main.transform.position = Vector3.Slerp(Camera.main.transform.position, cameraDestination, Time.deltaTime * 20.0f);
        }
        // ------------------------------------------------------------------------
        // ------------------------ END CAMERA MOVEMENT ---------------------------
        // ------------------------------------------------------------------------

        if ((lastSelector != null) && (lastSelector.transform.parent != null))
        {
            SubjectObjectScript script = lastSelector.transform.parent.GetComponent <SubjectObjectScript>() as SubjectObjectScript;
            _ID.text          = "ID: <b>" + script.Subject.SubjectID.ToString() + "</b>";
            _Name.text        = "Name: <b>" + script.Subject.Name.ToString() + "</b>";
            _Description.text = "Desc: <b>" + script.Subject.Description.ToString() + "</b>";

            testPanel.SetActive(true);
            PlantSubject plantSub = script.Subject as PlantSubject;
            if (plantSub != null)
            {
                PlantObjectScript plantScript    = script as PlantObjectScript;
                Subject           produceSubject = masterSubjectList.GetSubject(plantSub.ProduceID);
                float             maturePercent  = Mathf.Min(plantScript.CurrentGrowth / plantSub.MatureGrowth, 1.0f);
                plantPanel.SetActive(true);
                animalPanel.SetActive(false);
                locationPanel.SetActive(false);
                _Produce.text   = "Produce: <b>" + plantSub.ProduceID.ToString() + " - " + produceSubject.Name.ToString() + "</b>";
                _Growth.text    = "Growth: <b>" + plantScript.CurrentGrowth.ToString() + " / " + plantSub.MaxGrowth.ToString() + "</b>";
                _Maturity.text  = "Maturity: <b>" + maturePercent.ToString() + "</b>";
                _Inventory.text = "Inventory: <b>" + plantScript.InventoryPercent().ToString() + "</b>";
            }
            else
            {
                AnimalSubject animalSub = script.Subject as AnimalSubject;
                if (animalSub != null)
                {
                    animalPanel.SetActive(true);
                    plantPanel.SetActive(false);
                    locationPanel.SetActive(false);
                    AnimalObjectScript animalScript = script as AnimalObjectScript;
                    _Health.text = "Health: <b>" + animalScript.GetHealth().ToString() + "</b>";
                    _Safety.text = "Safety: <b>" + animalScript.GetSafety().ToString() + "</b>";
                    _Food.text   = "Food: <b>" + animalScript.GetFood().ToString() + "</b>";
                }
                else
                {
                    LocationSubject locationSub = script.Subject as LocationSubject;
                    if (locationSub != null)
                    {
                        locationPanel.SetActive(true);
                        plantPanel.SetActive(false);
                        animalPanel.SetActive(false);
                        _Center.text = "Center: <b>" + locationSub.Coordinates.ToString() + "</b>";
                        _Radius.text = "Radius: <b>" + locationSub.Radius.ToString() + "</b>";
                    }
                    else
                    {
                        locationPanel.SetActive(false);
                        plantPanel.SetActive(false);
                        animalPanel.SetActive(false);
                    }
                }
            }
        }
        else
        {
            //testPanel.SetActive(false);
        }

        //Place or use tool
        if (placeID < 1)
        {
            if (placeID < -1) //placeID == -2
            {
                if (!IsOverMenu() && (Input.GetMouseButtonDown(0)))
                {
                    centerPosition = Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, Camera.main.transform.position.y));
                    SelectAtPosition(centerPosition, 0.4f);
                }
            }
            else if (placeID < 0) //placeID == -1
            {
                //setting to Damage
                if (!IsOverMenu() && (Input.GetMouseButtonDown(0)))
                {
                    centerPosition = Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, Camera.main.transform.position.y));
                    if (HarmAtPosition(centerPosition, 1.0f))
                    {
                        PopMessage("Kill!", centerPosition, 0);
                    }
                }
            }
            else //placeID == 0
            {
                //setting to delete objects
                if (!IsOverMenu() && (Input.GetMouseButtonDown(0)))
                {
                    centerPosition = Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, Camera.main.transform.position.y));
                    if (DeleteAtPosition(centerPosition, 1.0f))
                    {
                        PopMessage("DELETED", centerPosition, 1);
                    }
                }
            }
        }
        else // is placeable
        {
            if (!placementStarted)
            {
                //Since we have not started, we can look for our mouse for placement
                if (!IsOverMenu() && (Input.GetMouseButtonDown(0)))
                {
                    //Set the center based on mouse position
                    centerPosition = Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, Camera.main.transform.position.y));

                    //We will let everything start with a radius of 0.5
                    if (CheckPlacementPosition(centerPosition, 0.5f, null))
                    {
                        if (placeID == 2) //this is a location, which requires 2 steps
                        {
                            placedObject = Instantiate(locationStart, centerPosition, Quaternion.identity);
                            //calculate our edge and manipulate the scale until finalized
                            edgePosition = Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, Camera.main.transform.position.y));
                            float distance = Vector3.Distance(centerPosition, edgePosition);
                            if (CheckPlacementPosition(centerPosition, distance, placedObject))
                            {
                                placedObject.transform.localScale = new Vector3(distance * 2, 0.1f, distance * 2);
                            }
                            placementStarted = true;
                        }
                        else
                        {
                            //Use the id to pull the Subject card
                            Subject newSubject = masterSubjectList.GetSubject(placeID);
                            if (newSubject != null)
                            {
                                placedObject = Instantiate(newSubject.Prefab, centerPosition, Quaternion.identity);
                                if (placedObject != null)
                                {
                                    SubjectObjectScript script = placedObject.GetComponent <SubjectObjectScript>() as SubjectObjectScript;
                                    script.InitializeFromSubject(masterSubjectList, newSubject);
                                    placementStarted = true;
                                }
                            }
                        }
                    }
                }
            }
            else
            {
                //We have started to place - is it a location?
                if (placeID == 2)
                {
                    //calculate our edge and manipulate the scale until finalized
                    edgePosition = Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, Camera.main.transform.position.y));
                    float distance = Vector3.Distance(centerPosition, edgePosition);
                    if (CheckPlacementPosition(centerPosition, distance, placedObject))
                    {
                        placedObject.transform.localScale = new Vector3(distance * 2, 0.1f, distance * 2);
                        lastDistance = distance;
                    }

                    //Look for a second mouse click to finalize the location
                    //No more changes to distance
                    if (!IsOverMenu() && (Input.GetMouseButtonDown(0)))
                    {
                        placementStarted = false;
                        Destroy(placedObject); //get rid of our temp area
                        //create a new location using the above values
                        CreateLocation(centerPosition, lastDistance);
                    }
                }
                else
                {
                    //We can finalize everything else automatically
                    placementStarted = false;
                }
            }
        }
    }
Пример #14
0
    public MasterSubjectList()
    {
        masterSubjectList = new List <Subject>();

        //`-.,.-'-.,.-'-.,.-'-.,.-'-.,.-'
        maxID = DbIds.Plinkett; // == Plinkett
        //,.-`-.,.-`-.,.-`-.,.-`-.,.-`-.,
        NpcDefinition plinkettNpcDefinition = new NpcDefinition()
        {
            Memories           = new List <SubjectMemory>(),
            AttackDamage       = 10,
            FoodHungry         = 60,
            FoodMax            = 100,
            FoodMetabolizeRate = 1,
            HealthDanger       = 40,
            HealthMax          = 50,
            HealthRegen        = 1,
            MetabolizeInterval = 1,
            MoveSpeed          = 5,
            Nest           = null,
            SafetyDeadly   = -10,
            SafetyHigh     = 10,
            SightRangeFar  = 10,
            SightRangeNear = 2.5f,
            StarvingDamage = 3,
            Traits         = new NpcCharacterTraits(NpcTraits.Herbivore)
        };
        AnimalSubject plinkett = new AnimalSubject()
        {
            Definition      = plinkettNpcDefinition,
            Description     = "A herbivore.",
            GrowthTime      = 5,
            Icon            = new UnityEngine.Sprite(),
            InventorySize   = 1,
            LootID          = 5,
            MatureTime      = 200,
            MaxGrowth       = 400,
            Name            = "Plinkett",
            RelatedSubjects = new int[0],
            SubjectID       = maxID,
            Prefab          = Resources.Load("GameObjects/Plinkett") as GameObject
        };

        masterSubjectList.Add(plinkett);

        //`-.,.-'-.,.-'-.,.-'-.,.-'-.,.-'
        maxID = DbIds.Location; // == Location
        //,.-`-.,.-`-.,.-`-.,.-`-.,.-`-.,
        LocationSubject NewLocationOne = new LocationSubject()
        {
            Coordinates     = new UnityEngine.Vector3(1, 1, 1),
            Description     = "A very positional kind of location",
            Icon            = new UnityEngine.Sprite(),
            Layer           = 1,
            Name            = "Location",
            Radius          = 2,
            RelatedSubjects = new int[0],
            SubjectID       = maxID,
            Prefab          = Resources.Load("GameObjects/LocationMarker") as GameObject
        };

        masterSubjectList.Add(NewLocationOne);

        //`-.,.-'-.,.-'-.,.-'-.,.-'-.,.-'
        maxID = DbIds.Bush; // == Bush
        //,.-`-.,.-`-.,.-`-.,.-`-.,.-`-.,
        PlantSubject Bush = new PlantSubject()
        {
            SubjectID       = maxID,
            Name            = "Bush",
            Description     = "A Berry Bush",
            Icon            = new UnityEngine.Sprite(),
            RelatedSubjects = new int[0],
            Prefab          = Resources.Load("GameObjects/Bush") as GameObject,

            ProduceID     = 4,
            ProduceTime   = 2,
            MaxGrowth     = 30,
            GrowthTime    = 1,
            MatureGrowth  = 2,
            InventorySize = 3
        };

        masterSubjectList.Add(Bush);

        //`-.,.-'-.,.-'-.,.-'-.,.-'-.,.-'
        maxID = DbIds.Berry; // == Berry
        //,.-`-.,.-`-.,.-`-.,.-`-.,.-`-.,
        FoodSubject Berry = new FoodSubject()
        {
            SubjectID       = maxID,
            Name            = "Berry",
            Description     = "A Juicy Berry",
            Icon            = new UnityEngine.Sprite(),
            RelatedSubjects = new int[0],

            BuildDirections = null,
            MaxStack        = 10,
            FoodType        = 0,
            FoodValue       = 10
        };

        masterSubjectList.Add(Berry);

        //`-.,.-'-.,.-'-.,.-'-.,.-'-.,.-'
        maxID = DbIds.Meat; // == Meat
        //,.-`-.,.-`-.,.-`-.,.-`-.,.-`-.,
        FoodSubject Meat = new FoodSubject()
        {
            SubjectID       = maxID,
            Name            = "Meat",
            Description     = "It was once muscle...",
            Icon            = new UnityEngine.Sprite(),
            RelatedSubjects = new int[0],

            BuildDirections = null,
            MaxStack        = 10,
            FoodType        = 1,
            FoodValue       = 10
        };

        masterSubjectList.Add(Meat);

        //`-.,.-'-.,.-'-.,.-'-.,.-'-.,.-'
        maxID = DbIds.Gobber; // == Gobber
        //,.-`-.,.-`-.,.-`-.,.-`-.,.-`-.,
        NpcDefinition gobberNpcDefinition = new NpcDefinition()
        {
            Memories           = new List <SubjectMemory>(),
            AttackDamage       = 10,
            FoodHungry         = 50,
            FoodMax            = 100,
            FoodMetabolizeRate = 1,
            HealthDanger       = 40,
            HealthMax          = 100,
            HealthRegen        = 1,
            MetabolizeInterval = 1,
            MoveSpeed          = 5,
            Nest           = null,
            SafetyDeadly   = -10,
            SafetyHigh     = 10,
            SightRangeFar  = 10,
            SightRangeNear = 2,
            StarvingDamage = 5,
            Traits         = new NpcCharacterTraits(NpcTraits.Carnivore)
        };
        AnimalSubject gobber = new AnimalSubject()
        {
            Definition      = gobberNpcDefinition,
            Description     = "A carnivore.",
            GrowthTime      = 5,
            Icon            = new UnityEngine.Sprite(),
            InventorySize   = 1,
            LootID          = 5,
            MatureTime      = 200,
            MaxGrowth       = 400,
            Name            = "Gobber",
            RelatedSubjects = new int[0],
            SubjectID       = maxID,
            Prefab          = Resources.Load("GameObjects/Gobber") as GameObject
        };

        masterSubjectList.Add(gobber);

        // \/ \/ DO NOT CHANGE \/ \/
        maxID = DbIds.LastIndex;
        // /\ /\ DO NOT CHANGE /\ /\
    }