I was think about how SE might go about implementing these battles and I also considered the non-battle classes and how to get them involved.
The role of melee/magic classes would be obvious, defend the Hamlet against attacks from crazed beastmen/raiders and whatnot.
However I had an idea, and who knows how feasible it is but have parts of the environment or armor of the defending NPC's be destructible.
For example, after a particularly tough battle perhaps some battlements or a guard tower and perhaps the gates themselves became damaged. Carpenters could do a little mini-game craft to help with the repairs. Perhaps some of the defending NPC's have damaged armor or need new weapons after their became broken or lost in battle. It could work similar to the repair command but with higher gains and perhaps a gil or point reward for trading for unique items.
As for the gathering classes, I initially thought that perhaps the items around the camp could need repair from unique items you would go on a fetch quest to get similar to normal gathering leves. But that may inhibit the crafter classes from being able to fix things as well. I'd need more input if this seemed viable. If it is then botanist could gather materials to repair gates, miners materials to fix weapons, or other metal items. As for fishers, well soldiers gotta eat...
I'm interested in everyones ideas on this as well, but I felt it would be more immersive and give everyone a shot at helping out no matter what you like to do.