I spent most of my life up to the age of 18 as a severe recluse. I had a small group of friends who I hung out with exclusively, and even with them only occasionally since we didn't go to school with each other. I spent the vast majority of my time alone. And when I did meet new people, I was abrasive to say the least. Not anything close to a friendly person. I wasn't the nerd type of shut in, more the very angry type. Definitely some questionable behaviour.
That really only changed when I left home (Ireland) and moved to Alaska for work. Leaving home and my specific group of friends that I'd had my entire life to a place that I knew literally nobody kind of reset me. Especially since I settled in a town with about ~500 people, it's very difficult to live on the fringe of society. People started inviting me to things even though I was kind of off. I started making new friends, and learned to let up on being a constant hard ass. Or at least to be make it into a joke when I was. I basically did a 180 as a person. Went out every night, made new friends by taking to randoms, had girlfriends, threw parties etc. Somehow I ended up being a very social person. Shit, I got hired to work with people on a cruise ship purely based on my sociability. I have zero issue making friends or talking to new people.
Honestly I think that what changed was that I didn't have any expectations to live up to here. Nobody knew who I was. Nobody expected me to be that guy who doesn't talk to anyone unless he's trying to kick up shit. Nobody expected me to be an asshole. I feel like I was really trying to live up to what people expected out of me back home. In an entirely new place I got to decide who I was and how people viewed me from scratch.