On a related note, has anyone observed what factors are taken into account when autoresolving city-defend/city-attack battles?

I need to see if I can make the outcome worse for the attacker - as far as I can see at present, walls seem to make little difference :(