Having some kind of plan ahead of time about how to deal with different scenarios is good.
Dogs are good. Perverts, thieves, thugs and drunk idiots instinctively want to avoid barking dogs.
I believe that being blinded by a very bright flashlight and a blast of pepper spray to the eyes would cause 95%% of assailants to retreat or at least hesitate in their assault.
There are a lot of variables with this subject.
I believe the most important is location and your judgement and mental ability to avoid locations where trouble is more likely to occurr. If you find yourself in a bad location, have the ability to decide to leave. While no place can be 100% safe some are clearly much better than others. Evaluate the kind of people who are around. The presence of women, children and older people tends to moderate the attitude of a group. Retirees boondocking
outside Quartzsite most likely will not attack you. Ex convicts living at the Slabs might steal your stuff. Look for clues like a large number of anonymous persons with easy access coming and going in the area (such as a highway rest stop). One of the things criminals bank on is anonymity, that is getting away without being identified. Campers getting drunk, playing loud music or otherwise being inconsiderate of those around them is a clue that things may go bad later on.
The next variable is the way you present to world both physically and mentally. Being a jerk certainly increases your chance of getting assaulted. Appearing as someone who is lost or weak or vulnerable also invites a certain element to victimize you.
There is an FBI study that shows that an inordinate number of police officers who are killed are perceived as being very nice guys. The tough ones are more likely to make it through their career alive. There is something about appearing genuinely nice that implies weakness and can invite or trigger an attack.
Another variable is you and your perception of your ability and your actual ability to deal with the fast moving physical and mental dynamics of a confrontation. Consumption of alcohol or drugs negatively affects those abilities. Even one glass of wine or a proper dose of prescription drugs. Being intoxicated significantly increases your chances of being assaulted or victimized.
Now consider the suspect or assailant and his state of mind and/or intoxication at the time. Most people make the mistake of assuming that logic and reason guide him. If he reaches a point where he will actually do an unprovoked assault or break in to a camper he knows is occupied he has issues or attitudes that you can not overcome by being nice or having a debate with him.
Be aware that being armed can wind up going very badly very quickly. If you think you can pull out a gun, wave it like a magic wand and take control of a situation like you see on TV you are sadly mistaken. 40% of police officers who get shot get shot with their own guns. Some officers who do shoot a suspect are then ruled to be wrong. The legal aspects of the use of deadly force are complex. Officers have been trained and judged and see themselves as being qualified to do all of this. Being qualified means having the perception and ability to accurately evaluate, classify legal aspects and physically deal with the fluid (changing) dynamics of a confrontation. That includes not allowing the emotional reaction of being victimized to cloud
judgement and prompt inappropriate actions. I can tell you that things happen fast in an armed confrontation.
If you do successfully repeal an attack by shooting someone you may still be alive and uninjured but you will not emerge completely unscathed. Your camping trip will be messed up. You will completely loose control of your life for a time, perhaps a long time. You must immediately notify the authorities that you did the shooting. Not doing so indicates you are wrong. You must obtain medical assistance and/or provide first aid for a seriously injured suspect. If you don't and he dies, a justified shooting can turn into a murder charge. You will need to keep your mouth shut and get a lawyer to do the talking to the police no matter how right you are. You will have become a shooting or homicide suspect and determining if you were right or wrong will be done by others who do not know you, do not have sympathy for you and who will be looking to find any fault they can with your actions. You will likely be in a jail cell while this is being decided. Yes, that would be better than being dead or seriously injured but it is an ordeal that I will go to great lengths to avoid.