I MADE A MISTAKE! The formula for explosions without a roof should be
damage = damageatonetile * (distance ^ -2)
Quadratic would be quite a lot different than the exponential we have now. Exponential damage deals most of the damage in the middle, while quadratic deals more damage at point-blank and very long range.
Playing around with the numbers, and I think having the center tile deal four times as much damage as it currently does, and having the adjacent tiles deal three times as much damage as they currently do makes the best damage spread.
The formula would become (setting base_damage to four times the current value)
damage = (distance == 0) ? base_damage : base_damage * 0.6 * distance ^ -2;
At point blank range it does 4 times the damage, adjacent tiles receive three times as much damage, and two tiles away, the damage is 94% of what the current implementation has. However, damage rapidly reduces the further away you go. At 5 tiles, a 100 damage explosive used to do 33 damage, but now the equivalent 400 damage explosive would do just 9.6 damage. 25 tiles away, and quadratic does more damage again (0.384 instead of 0.378), but since we are dealing almost no damage, it might not matter…
It is a right royal pain that we can’t calculate how much more focused the explosion would be in a closed room, or a hallway, because that is where explosives are much more useful. (My formula for a closed room in my previous comment is reasonably accurate)
Your exponential formula is exactly what you would expect for an explosion in a hallway.
So … I might try to work out a more accurate algorithm. I have an idea … but I also have a job I need to go to >.> [Edit] Actually, Coolthulhu suggested that even if I were to get an accurate algorithm for how much each damage each tile should get, it might not be possible to deal damage to both creatures and structures… is that the case?[/Edit]