Another quick update - this lunchtime I got scenery working, so the tree in the example pictures now stands out in front of the grid and blocks movement and line of sight. In the future I hope to be able to set scenery to partially block LoS, or block LoS but not movement (curtain) or vice versa (fence), but for alpha 1 at least it'll be a relatively simple implementation.
I also forgot to mention before that for an example, I've implemented a simple elemental-magic system, so (for example) water spells will do more damage to a target with the 'fire' attribute, and less to one with 'earth'.
It reminds me of another area I'd be interested in suggestions for, though, and that's damage resolution. Attacks (at least with the example damage resolvers) come down to an 'attack' stat versus a 'defence' stat. Presently I have a fairly simple algorithm to determine damage based on attack and defence:
Code: Select all
#calculate damage - goes up more rapidly with zero or negative def
if (target.Stats.Defence < 1):
defence = 2 - target.Stats.Defence
damage = attack * defence
else:
damage = (attack/target.Stats.Defence)+ 0.5
damage = int(damage * 10)
So this produces a set of damage results a bit like this:
Code: Select all
DEF
0 0.5 1 1.5 2 3 4 5
+-----+----+----+----+----+----+----+----+
1 | 20 | 15 | 15 | 12 | 10 | 8 | 8 | 7 |
|-----+----+----+----+----+----+----+----+
ATT 3 | 60 | 45 | 35 | 25 | 20 | 15 | 13 | 11 |
|-----+----+----+----+----+----+----+----+
5 | 100 | 75 | 55 | 38 | 30 | 22 | 18 | 15 |
+-----+----+----+----+----+----+----+----+
...which has some odd discontinuities, such as between Def 0.5 and 1 or Def 3 and 4 for Att 1. Now, it's probably good enough to run a game on, but the code also isn't very elegant and it's full of arbitrary numbers, so it probably doesn't make a very good bit of example code, either. Can anyone think of, or does anyone know of, a decent
f(attack,defence) => damage resolution algorithm that's simple and clean enough to make a good example without having much in the way of arbitrary numbers or special cases (e.g. for 0s)?
(The elemental-damage effects are all taken care of by modifying the attack value before it goes into this algorithm, so water vs. fire gives attack * 2, while water vs. earth gives attack * 0.5; I expect armour equipment to modify defence scores, for the most part, so I'm not - at least for the purposes of examples - interested in incorporating that kind of thing into the damage resolution directly.)