Priority effects and habitat complexity affect the strength of competition