camps are generated only by bases that have an army
2 camps are generated by each base with an army (regardless of whether it has a command center or not)
the level of camps is determined by the maximum between the base's defense level and offense level
define X=max(OL,DL)
the OL and DL are rounded down (that is, a 32.9 offense is level 32 for the purposes of these calculations)
for X <= 47 your offense base generates 2 camps in the range (X-1,X+3)
for X >= 50 camps are in the range (X-1,X)
for 47<50 camps are in the range (X-1,50)
in my experience, the distribution is roughly uniform over these ranges
tunnels do not have any influence on camps (tunnels only spawn outposts)