Pex was originally envisioned as a muscle-bound moron to parody such popular American heroes as Sylvester Stallone's Rambo. Unfortunately, no British actors of appropriate age and build were available, and so John Nathan-Turner suggested turning the concept completely on its head, by casting a small, slender actor who was clearly not the physical specimen Pex made himself out to be.
Julie Brennon (Fire Escape) was married to Mark Strickson whom played the Fifth Doctor's companion Turlough.
The Blue Kang Leader was unnamed on-screen, but was given the name Drinking Fountain in Stephen Wyatt's novelisation.
Stephen Wyatt based his story in part on the J.G. Ballard novel "High Rise", which depicts a luxury apartment building which descends into savagery.
The robot cleaners were added because Andrew Cartmel was concerned about the lack of monsters in the story.