I think it is best to learn both. Most people I know say you should always learn the formal first, because the informal comes easily usually as you learn!
I play korean online games and usually people do talk formally to each other when they are strangers. It is impolite even in the games. But if they know you are a foreigner, they may let it go! Also, many will use korean slang online, so you might want to learn some of that eventually too! (: