this week i’ve been very sick, so theres not much work to show. the only progress was into changing the projectile vector calculation system and i had to abort on doing that half way though.
preface, projectiles aren’t actually projectiles in BA, they’re made up of 3 arrays; position, vector, and munition. we then simulate the movement of a projectile sprite each tick to make it look like its flying.
previously, we used a custom area2d (AreaCells) to check how far a projectile had gone. these are spaced out at regular intervals (usually about 15 cells total) and a projectile only recalculates its trajectory when it enters a new AreaCell.
this has the handy feature of being very, very fast. it easily let 300,000 projectiles fly around at the same time as each only only really had ~15 updates max. but it has a few problems:
- it doesn’t have enough resolution for shot arcs
- it favours angled shots way, way to much.
- so if you fire directly up, the bullet goes to space. if you aim at 45º, your projectile might fly over the whole map, but 40º may have it only fly half way.
- 300k projectiles is cool but its without gameplay reason now that the idea of the game has matured.
in order to change this, i wanted to instead use rays of a preset length that fires an arbitrary number of times. it’ll be mostly the same; when you fire a projectile, it will send a ray out and it grabs something at collision. it then stores this collision and waits until the projectile reaches that location then acts on it.
the difference will be that instead of firing an infinite ray, it’ll fire a preset distance. if it hits nothing, it does a drop calculation (much like we currently do for AreaCells), if it does hit something then its business as usual.
in this setup AreaCells will instead be used as atmospheric volumes. an AreaCell will have gravity and air resistance properties so we can do stuff like shooting into low orbit by just putting an AreaCell in the sky.
the calculations for drop need to change a lot of course, as they are set up for preset cell distances. this has lead to some weird issues with gravity not be applied properly. working on this part was the point where i realised i was properly sick and not making good decisions.
tune in next week for hopefully more useful stuff.