Hello everyone!

Here we are with another development blog, and we sincerely hope that you will enjoy it as much as we did enjoy writing it.

Before we start we want to say sorry for missing the development blog schedule, our team was working on many projects and because of that, we didn't catch the time to write a development blog.

In this development blog, we will talk about our Survival Engine, our Day and Night system, and we will also show some screenshots!

Survival Engine


Our "survival engine" is a conditional rule system that affects survival variables such as health, stamina, food, water, etc... Every variable is a custom class called STAT, this class has a base value and value that is calculated depending on the stat modifier.

The survival engine allows us to create rules that the engine will use to do something on every given custom tick (you can read more about our custom Tick System on our blog, by clicking here).

Depending on custom modular rules survival engine analyses all variables and then triggers an action gives a sign that some event happened or, modifies the other variables by adding stat modifiers.

Our survival engine is integrated with our Game Manager window, and you can see a screenshot of Survival Engine below!

This image shows the Survival Engine inside of the Game Manager Window.

Values Dropdown


Every survival stat has three modifiable variables, those are:

  • Base Value,
  • Rate Value and,
  • Start value.

The base value is a maximum default value that is expandable.

The rate value is applied to every set tick (you can read more about our custom Tick System on our blog, by clicking here).

and the start value is a default value.

The base value is used to increase the boundaries of those stats, while start is only used when the first/new save is made.

Survival Engine Actions


Our survival engine has different types of actions, and they are:
  • If a rule is met apply effects,
  • If a condition is met, override effects,
  • If an event is triggered, apply effects,
  • If rules are met, return true.

We will cover every one of them, so you can learn a little bit more about it.

If a rule is met apply effects


In this example, we created a modular rule that if health goes under 30% of its base value, the survival engine will multiply the health rate with 0. With this we get a rule that when the health goes below 30%, the player's health won't regenerate.

This image shows 'If a rule is met apply effects' action in Survival Engine.

If a condition is met, override effects


In this example, we have two triggers
  • isSprinting and,
  • isWalking.

if we set isSprinting to true, then we will multiply stamina rate by a negative number so it goes down. This means when we run our stamina decreases.
If isWalking is true, then it will multiply itself by 0.3, which means that the stamina will recovery three times less than when we don't move.

This image shows 'If a condition is met override effects' action in Survival Engine.

If an event is triggered, apply effects


These are simple events, in this example, you can see that when we run the "Jump" event the survival engine will decrease the stamina by 20.

This image shows 'If an event is triggered apply effects' action in Survival Engine.

If rules are met, return true


These types of actions are more like checkers than actions. In this example we have a StaminaLow checker, if its values match with current values it will return true, so StaminaLow returns true if stamina is lower than 30.

This image shows 'If an event is triggered apply effects' action in Survival Engine.

That was our survival engine, it is really easy to work on it, and it helps us a lot and saves a lot of time. Now let's take a look at our day-night system!

Day and Night System


Day and Night system is a modular system that controls the world time and calculates the position of celestial objects (sun, moon, stars) on the sky and it takes in factors such as days in a year, etc...

Like every other system, it has its own preset system inside of our custom game manager.

This image shows the day and night system inside of the game manager!

The day and night system on its own is really simple, but its charm is in modules that get the time of day variable as an input and they control the game based on that variable.

For example, we can make a skybox module. This is a module that for example controls the sun intensity and other variables. It can take the values from presets depending on what the time of day currently is, on the image above we can see a list of specific intensity values based on in-game hours.

The Skybox module will take sin lerp and choose the best intensity and then do the function. For example, we also have a clock module that takes a value from 0 to 1 and makes it into an hour.

This image shows the clock module code!

There's a lot more to our day and night system and we will make sure to show it to you in some of the next development blogs.
Below you will be able to view a short prototype timelapse of our day and night system.



Video may be lower quality due to YouTubes compression. (If you wish to see a higher quality video, or to see more keep an eye on our social medias)
Have issues while viewing the video? Watch it directly on youtube by clicking here.