this week was about reinvention and reenforced the idea that a negative result can still be a result. i spent the first half of the week remaking how building cells were constructed, with the idea that they’d use a texture per material and be generated as simple polygons. this proved to be a massive pain in the ass and looked like ass too, so instead i’m sticking to good old cells with extras.

buildings

buildings are a core part of the game as they protect the components of the enemy that allow them to shoot back, such as the magazine or command centre of an enemy bunker.

they also give the player richer targets to shoot at and let the player see the effect of their projectile in a more understandable way.

from this i take that buildings should be realistic, they should have properties that let them behave like real structures; different material properties, the ability to collapse, become unstable, etc.

generally there are 4 materials planned

  1. wood or drywall
  2. concrete
  3. rebar concrete
  4. steel armour

theres a good chance that there will be more in future. the volume calculation of materials really helped here too and makes it feel much more predictable, but the cell size needed to change. 5px per m was far too little and made it very pokey to shoot at early game enemies, so its been doubled.

building destruction

i’d like buildings to be destructible but in a satisfying way. buildings are mostly cell based entities and upon their destruction we’ll cover the removal of the cell with debits and explosions, but theres more to that as well.

this has to be satisfying in two ways; both for the player and for the developer (eg ergonomics). buildings are mostly hand crafted by making smaller components then combining them.

buildings are made of cells but i want them to have dependancies on each other so destroying one weakens another or triggers an outright collapse. so heres how the construction system works:

cell based building parts can be quick generated with a dev side construction script, this lets me take a prefab drywall office room and turn it into a 18 story skyscraper or a flat reenforced bunker very quickly. then i can add personalisations to a given building. radars doodads on the roof, cannons to shoot, armour blocks, etc.

**an auto generated building with **

the support dependancy tree enabled

then the game takes all the hitboxes of these added items and inflates them by ~10%, then for each hitbox it checks it’s intersections with its neighbours and the direction of that int

ersection to determine the buildings dependency tree. each cell then has its own “supports” list which it tells to die when it dies, leading to satisfying building collapses.

all buildings register themselves with a destruction manager if they support something else, so when a large number of building parts are destroyed together we can batch process the particles, and we can calculate their direction to make it look like the debris is falling down the building face

here is the destruction in process

for now we dont have anything smart like structural integrity (can you blow a hole in the side of a building and it still stand?). this is probably something i’ll add later on and where the destruction manager will probably again take a starring role.

terrain

another minor change this week was the introduction of polygon terrain. this is simple for now but makes it easier to draw more complex shapes of terrain without mine crafting cells together.

**the terrain. the non updated texture adds inadvertent **

**sedimentary layers **