Cave Story

Once upon a time a weird pixel thing woke up in a cave and had no memory so he randomly walks out of a dead end in a cave and finds a city, discovers he's a robot, and do some game plot spoiling stuff.