Engineering environment-mediated coordination via nature-inspired laws