A good ending is unlocked after a bad ending. On a new playthrough, there will be a branch leading to the good ending right at the start of the game.