this week focused on the state manager, as well as more projectile calculations

looks

the new 2d setup looks like ass tbh, so much so that i can’t figure out what is happening some of the time. to remedy this i added more feedback on firing and hitting of building rooms, as well as an ammo switcher.

firing effect

new projectile calculations

ammo switcher showing off different kinds of ammo

if you’re thinking “all of these look like total fucking shit” then you’re reading my thoughts but we don’t have graphics in the real sense yet
also blogger really sucks for these kinds of videos

munition damage calculations

how much is too much when it comes to simulation? it’s a pretty typical question as too much sim can detract from gameplay and dev time.

what we want is a simulation that is simple to use while still being complex enough to allow for real decisions. it doesnt need to be super accurate but accuracy to the real world can come with some advantages; anyone studious enough to know things in real life may be at an advantage, likewise learning in a game can transfer out. i had this with oxygen not included: it ended up teaching me a lot about thermodynamics (by showing what they do and don’t do).

I’m not sure if this sim idea is like that but the idea behind our new munitions sim is this:

  1. a bullet is made of blocks
  2. a building is made of rooms
  3. both have HP and hardness

when a bullet hits a room of a building:

  1. we check how heavy it is and how fast its moving this gives us its power (0.5mv^2)
  2. we then check how hard the next part of the bullet is vs the room, and divide the power between them (hardness 1:20 means that the building takes 95% of the damage, and the bullet 5%.
  3. we remove their share of the power from their HP
    1. if the bullet block is out of hp, pick the next and repeat
    2. if the room is out of hp, allow the bullet to fly on to the next with only some of it’s speed remaining

This lets bullets get broken as they pierce a building as well as lets us configure rooms with a few dials. players can make informed decisions about what they put into a munition.

state changes

in order to let each munition carry its own state, we needed to make states more malleable. so each state can now export whole or part of itself as a dict array to be reimported by other states. this also let us get the undo/redo functionality going and paved the way for copy paste

it also required a rearrangement of concerns. each factory entity now comes with all the parts needed to be loaded into a munition, no more abstractions. this means that we can give something like cases an explosiveness rating, but we could give ratings to other parts as well.

as all of this is read on the fly while the munition is in the air, it means factory parts could be included into a munition. changing the balance using pistons? adding grinders to the front? making a missile that drops bombs? all speculative but possible, as we can run the factory sim on each bullet if we wish.