Physics
Try to think about what happens when a cannon ball traveling through the air hits something. The ball will have a certain mass and velocity, and thus a certain amount of kinetic energy that can potentially do damage.
What happens with the cannon ball itself after a collision? Does it bounce, fall down, break apart, roll, catch fire or explode? It could bounce (for example, if it hits the ground at a grazing angle), but if it hits a stone wall it is likely to just lose all its kinetic energy, fall down, and maybe roll away.
What happens at the point of impact? A stone wall reacts differently from a wooden roof. And there is a small chance that you hit a person or some piece of equipment.
As mentioned by Zibelas, all these things might need to be handled differently.
As for materials that crack when hit by a cannon ball, you could perform a detailed simulation of how the material reacts, but I don't think that will fit with your visual style, and will be a lot of work to code and to run. Instead make some simplifications. Keep some basic physics in mind: a cannon ball has a limited amount of kinetic energy that it can impact. When this energy is transfered into the material, there are several ways that this energy can be distributed, including:
- The object as a whole can inherit the kinetic energy, and thus start moving
- The energy can be fully dissapted as heat
- A crack can be created
Usually, it will be a combination of all of the above. Ok, now looking just at cracks, depending on the material there is a preference for the direction of a crack, and once a crack starts, it will likely continue in the same direction. But typical materials have impurities, and there will be points where it becomes more favourable to change the direction of a crack. To simulate this, I would use the following algorithm:
- From the point of impact, spend a fraction of the energy for a crack that continues approximately in the direction of impact. The amount of energy spent determines the length of that crack.
- Then, make a random choice at the end of that crack:
- Change the direction of the crack
- Split into two branches, each going in their own direction
- Then repeatedly advance all the cracks until you have spent all energy.
You can tweak the parameters, such as the chance to bifurcate a crack, until you find it generates a pleasing crack pattern.
Apart from that, you want to check whether a crack line intersects an existing crack or if it hits the edge of the object that is cracking. In that case, there will be a piece of material that has now become completely loose. You can decide to give it a bit of kinetic energy from your remaining energy budget, and send it flying.
Rendering
It seems like you can just draw the crack lines using a black line with similar properties as the outlines used in the drawing of the castle. But cracks just don't suddenly appear in one go. Creating a convincing animation might be hard. However, think again of the physics of a cannon ball impact: there will be dust and fine particles that will be disturbed, and could form a small smoke-like cloud. This cloud will dissipate in a few seconds, and might move along the direction of the wind. The cloud will hide the crack formation, so you don't have to worry about that. You can also make a few small particles erupt from the point of impact to give it a more dynamic look. It should be easy to add some randomization to these things, so they will look different every time.