To be honest, I feel like he never even planned for success, after all, his previous works were mid at best. It seemed like he was going to just half-ass his way through this last one, but somehow it became a success, even though he thought it would be his worst work. You could see it with the naming; Shrek the school, three shots the teacher's ability a pig that farts, and the protagonist three spoons of sugar