We develop an agent-based model on a lattice to investigate territorial development motivated by markings such as graffiti, generalizing a previously-published model to account for K groups instead of two groups. We then analyze this model and present two novel variations. Our model assumes that agents’ movement is a biased random walk away from rival groups’ markings. All interactions between agents are indirect, mediated through the markings. We numerically demonstrate that in a system of three groups, the groups segregate in certain parameter regimes. Starting from the discrete model, we formally derive the continuum system of 2K convection–diffusion equations for our model. These equations exhibit cross-diffusion due to the avoidance of the rival groups’ markings. Both through numerical simulations and through a linear stability analysis of the continuum system, we find that many of the same properties hold for the K-group model as for the two-group model. We then introduce two novel variations of the agent-based model, one corresponding to some groups being more timid than others, and the other corresponding to some groups being more threatening than others. These variations present different territorial patterns than those found in the original model. We derive corresponding systems of convection–diffusion equations for each of these variations, finding both numerically and through linear stability analysis that each variation exhibits a phase transition.