Kainga
  • Home
  • Devlog
  • FAQ
  • Contact
  • Newsletter
  • Presskit

​

The Fire System

5/9/2020

1 Comment

 
While adding natural disasters to my game I hit a problem: all the problems affect the lowlands more than highlands. I removed resources from the highlands to encourage players to risk going to the lower levels. But it wasn't enough. There was no risk involved with building a city on the highlands and wandering below to get resources. 

The solution came with fire. Since the highlands were already dry (not many trees) it only makes sense to have fire be an issue in the flat, grassy lands above.

The narrative behind this idea is that in the lower, swampier lands fire spreads slowly whereas in the highlands, fires spreads quickly and dramatically through the grasses, covering the entire area quickly. If your city is unprepared for a wall of fire to potentially sweep through your town, the results could be dramatic loss of population.
The way that fire works is taken from the write-up by Jean-Francois Levesque on the fire propagation system in Farcry 2 . Once a fire is started, it spawns a grid of potential fire-boxes. Each fire-box has a certain health that gets damaged by nearby fires. Once the health reaches 0 it also ignites and begins damaging surrounding fire-boxes.  The amount of time a fire-box lives for decreases as the fire spreads to keep the fire from spreading forever.
You can see the fire boxed are extended by 2 squares every time a fire box successfully catches on fire. Fire boxes damage their neighbors, and the speed of the fire's spread is dictated by 3 main factors, what soil is below the fire, the wind's direction, and the weather.

The soil type below the fire dictates how much damage the firebox takes before it ignites itself. You can see in the above gif the fire has a harder time spreading on the green grass.

There is a global wind direction, that dictates the movement of smoke particles. I check to see if the firebox's neighbor is in the same direction as the wind direction, and if it is,  add some bonus damage to make that box ignite sooner.

The last check, is to see if it is raining, foggy or somehow wet. I have a simple booleon that dictates if the box "IsDamp" and if it is, then the amount of damage it deals is reduced, slowing the spread of the fire.

Maybe you can see what's happening clearly here when I used my old fire effect:
Picture
You can also see, that fireboxes can hit other objects like trees and people which activates a Function on through an Interface that allows a huge variety of actors to be affected by fire.

Here you cans see my OLD and NEW fire effects next to each other.
Picture
Picture
I still like the old fire effect, so I use it for my campfires now.
​
So how can you fight such ravaging fires to protect your town?
Units can battle the fire by carrying  water to the site of the fire and dousing it. However, you have to have a water source like a watershaft with a winch, stepwell, or the Ceramics Workshop to produce water jugs.
Picture
Alternatively, some specific wildlife might help you fight the fires if you learn to coexist with them!
Picture
1 Comment
Zébraeus
5/10/2020 10:18:03 am

Very interesting article about the fire system and how it spreads.
I especially love the final firefighting snail! Do snails always have the same power or may it change between two games? As sometime, the snails can spead fire ^^

Reply



Leave a Reply.

    Erik Rempen

    I create, design and develop video games I'm interested in playing.

    Archives:​
    Early Access
    Kickstarter

    Missions
    Production Buildings
    Making Wakes
    The Beastmaster
    Basic Units
    Basic Resources
    The Fire System
    Presentation
    Re-Imagined
    ​Creating Water
    ​
    Cliffside Stairs
    Watchtowers
    ​
    Melee and Ranged Units
    Unit Organization
    Farming
    ​Carrying Ladders
    ​Weather and "Seasons"
    Technology
    ​Ladders and Elevation
    landmasses
    Structure Design
    Animating 2D units in a 3D world
    ​Setting the Theme
    Setting the Focus
Proudly powered by Weebly
  • Home
  • Devlog
  • FAQ
  • Contact
  • Newsletter
  • Presskit