i'm back from a holiday in germany and resuming work. its proving a little tricky, i wrote up a list of things to do before i left but of course info settles out of the brain after several days of drinking wheat beer.

Buildings and explosives

hope no feds are reading this.

in the few days this week that i was able to get to work, i looked into explosives and how they can be implemented and it quickly lead to a Hal Changes A Lightbulb moment where it required that i look into buildings, which means looking into building cells, which means looking into prpjectile mechanics.

the idea is that buildings should be easy to make and that their properties lend them to making other things, such as doodads and neutral or civilian structures.

the list of wishes for building cells:

  • have unusual shapes, with accurate physics
  • be easily spritable
  • be easily placable for larger arrangements
  • easily mix cell types (to make large rich buildings)
  • listen to events from specific cells (for command areas vs mags)
  • dispatch events to specific cells (building destruction)
  • would be nice if most buildings could be somewhat unique
  • would be nice if it can be large polygonal areas (terrain)

and this lead to a more actionable list

  • physical meterials should be a resource, not hard coded
    • so we can reuse a preset group to make it easier for the player
      • this should include the sprite? then we can just clip the srpite to fit
      • probably looks like shit
  • cell as a unique prop inheriting area2d so we can easily setup different shapes
  • each cell has a sprite with damage level conditons
  • all live under a controller who tracks them
  • enemy controller exposes a number of functions that can be signaled to from the controller or specific parts
  • parts can have a material attached and their hp recalculated either individually or as a group or not at all

so i got to work making a building generator and it worked quite well. the idea is that cells are designed to be placed mostly by hand with sprites attached that map to their physical shape, but that a constrction helper can belt out a skyscraper of them pretty easily.

with the abstraction of materials, i could also define what sort we want in the game, its a normal looking list but if we include a hp per volume calculation in a material, we can make sure that all isntances of a material feel similar to shoot at

Projectiles

this lead pretty quickly into realising theres something wrong with projectiles. making a large building and shooting it just doesnt feel quite right, mostly as the way that damage is divided over parts isn’t very clear.

this itself has a cause that is summarised quite easily:

how big is a projectile cell?

its a simple question but it raises more still. is a slug like 5mm? if so, then is a case 5mm? if so then with a 1x1 bullet you end up with a roughly 400ms muzzle velocity but that isn’t going to break a concrete block

this is not a solved problem as of this writing and needs more research. i can push on without it but it’ll all be building on sand until i have a clear idea.