I have a group of humanoid creatures that is in a foreign country and looking to set foothold there. They are not interested in exploring and do only want to survive. They can provide for themselves through foodsources in their encampment.
They live in a small camp that will eventually evolve into a castle. They know how to abuse heights in combat. E.g. position archers on hills, put the camp on a hill, etc.
What reason would this society have to use melee weapons in combat?
Tech level is medieval, no magic or very low magic.
I am thinking of a scenario where the camp is attacked by multiple soldiers in heavy armor. If the "defenders" can spot the "attackers" early enough, shouldn't ranged weapons like ballistae, trebuchets or catapults always be more effective than meele weapons?
The question boils down to:
How can I explain Melee units in a society that only focuses on surviving and will never attack? I am looking for any possible answers that improve the meaning of meele combat but don't render ranged combat impossible, just not that huge of an advantage against meele. This can be anything from weather/seasons/attackers armor etc.