christmas is over and will be missed.
the last few weeks changes have been pretty big as i’ve already found myself in techdebt.
the way that projectiles are made, the raycasts they use, and the reflection between zones for trajectory calculation were all a bit overcomplicated, and last week i tried to add buildings and it all went wrong.
i wanted to make the enemy more complicated. a game mechanic i want to include is visible destruction of the enemy for player feedback, as well as “important” points within an enemy,to encourage the player to aim for one bit of an enemy over another.
lets say every enemy is a skyscraper and within that skyscraper are rooms that take care of things like
- ammo storage
- command
- transport
aiming for ammo may blow the whole building but is likely to be armoured, while command would at least stop them being able to shoot back for a while.
high quality artists rendition
to do this i naively just made another 2d cell matrix and had any raycast that enters it start a small situation as the projectile goes though rooms. this turned out to be complex to do well and ran like shit. too many systems on systems.
so i’m doing away with the 3d raycast system, we’ll do everything in 2d with the much simpler 2dspace raycast. after doing some tests, this is also about 60-70% more efficient.
this turned out to be quite nice so far, as i can do internal building physics and drop calculations in the same steps, even if those steps are slightly less efficient; there are overheads with using area2d.
later on i can also relink this to a 3d scene if i want to go back to a 3d representation, as long as the physics are just simulated in 2d first.
