Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Zara Survival Engine

Discussion in 'Assets and Asset Store' started by Vagrod, Nov 12, 2020.

  1. Vagrod

    Vagrod

    Joined:
    Aug 4, 2017
    Posts:
    82
    Zara is now available in a form of Unity Asset!

    What is Zara?
    Zara is a code-only solution to add survival functionality to your project, including:
    • Weather-aware Health Engine that controls dozen of parameters, like
      • Body temperature
      • Blood pressure
      • Heart rate
      • Stamina
      • Fatigue
      • Blood level
      • Oxygen level
      • Food level
      • Water level
      • Warmth level
      • Wetness level
    • Disease Engine with treatment. By default, includes diseases:
      • Flu
      • Angina
      • Blood poisoning
      • Food poisoning
      • Hypothermia
      • Hyperthermia
    • Disease Monitors
    • Medical Agents
    • Injury Engine with treatment. By default, includes injuries like
      • Light injury
      • Light cut
      • Fracture
      • Open fracture and more
    • Pills and injections
    • Bandages, splints, etc.
    • Inventory Engine with crafting
    • Clothes and Clothes Groups
    • Built-in Sleeping mechanics
    It's too much info to post everything here, so visit Zara Github page for the detailed description.
    Zara is well-documented. Visit Zara wiki, it has all you need to get started.

    You can use asset -- or visit Releases section of Zara Github, download the latest version, then copy Zara folder into your Unity project -- and you're done (couple of interfaces need to be implemented for Zara to know the time of day, player stats and weather outside). No complex set up needed (see Getting Started wiki section).
    After that you can start blending it into your game. Change, remove and add your own inventory items, crafting recipes, diseases, injuries, clothes, do whatever you want to implement the functionality you need.

    Zara fully supports saving and loading of its entire state in a single line of code. You can extend this functionality any way you like: everything is detailed in this article -- How State Management works.

    Zara is a good starting point if you do not already have, for example, your own inventory system, in which case you'll have to integrate the two.

    Oh, and it's free and opensource ;)

    If you have any questions regarding Zara usage or integration, ask me here :)
     
  2. GreatPepperoni

    GreatPepperoni

    Joined:
    Jul 10, 2020
    Posts:
    1
    Hi, I am planning to use this in a project but can’t figure out how to implement it. I’ve looked through the documentation and still can’t figure it out. Is there any way you could help me?
     
  3. Vagrod

    Vagrod

    Joined:
    Aug 4, 2017
    Posts:
    82
    Hi!
    The easiest way to add Zara is to look at .NetCore example. You can grab as is "Person" class, "IPerson" interface, "WeatherDescription" and "PlayerStatus" classes. This particular "Player" has "name" in its constructor, but you can get rid of it, it was needed for the demo only. Remove the code under the region "Demo App: displaying Output", it is just for the demo.

    First of all, initialize Zara randomizer somewhere:
    Code (CSharp):
    1. ZaraEngine.Helpers.InitializeRandomizer(UnityEngine.Random.Range);
    Then somewhere in your code you just create an instance of "Player" and pass to it functions that return current game time and current time of day. In netcore demo, time of day is always evening, but you can write your logic there to determine it, based on the current game time for example. You also tell Zara your weather conditions, an instance of that "WeatherDescription" class.
    Code (CSharp):
    1. _person = new Person("you can get rid of this name");
    2.  
    3. var weather = new WeatherDescription();
    4. weather.SetTemperature(27f);
    5. weather.SetWindSpeed(0.1f);
    6. weather.SetRainIntensity(0.15f);
    7.  
    8. _person.Initialize(weather, () => _gameTime, () => _timeOfDay);
    assuming "_person", "_gameTime" and "_timeOfDay" are class-level variables.

    After that you have an instance of "Player", and all you need to do is to call "_person.Update(Time.deltaTime);" somewhere in Unity's "Update".
    If your weather changes, you tell Zara about it by calling methods shown above, on a _person.Weather object.
    And when your character in the game changes its activity (starts/stops running, walking, swimming, goes under the water, swims up, etc) you tell Zara abut it by calling the appropriate methods on a _person.Player object.
    Of course, game time must tick, so be sure to progress it in some Unity's "Update", in the rate you want.

    You can have any number of such "persons" if you need to.