A rise in events across Portsmouth has been credited for halving the number of unauthorised encampments from 2023 to 2024.