I want to create a peer to peer game like risk of rain.
Funny you mention Risk of Rain, since it had the very same issue of not providing any kind of automatic port forwarding, so you had to do it manually. This, of course, only applies to the person creating a server; so in a game where one guy is the host and 10 people connect as clients, only the host would have to know how to configure their router. You may just go this exact route for your own game, but then again, it's an additional obstacle that may or may not be irritating to players. Not everyone knows how to properly configure a piece of hardware. Some are happy enough they know how to turn on the computer.
From what I understand, it goes a little like this: The peers connect to a master server that takes their packets and sends them along.
You're correct. The "master server" would be a publicly accessible PC with a static, known IP address that can be hard coded into your game client. Once a client establishes a connection to said server, the server may (temporarily) store their information so it knows who's connected at all times. This information can then be passed on to every other connecting client to negotiate direct connections between them. That's really just the very basic gist of it, as you said, so if you don't already know how to set up such a middle-man kind of server (let alone making it publicly available 24/7), I reckon this is not really a viable option for you.
The only way to establish a true peer-to-peer environment, without the need of
any third party or service in between, would be port forwarding - basically meaning that whoever opens a session as host will have their ports configured in such a way that they are reachable by everyone else, so they can act as the authoritative server. Again, if you don't want to tell your customers to do this by hand (what if they don't know how?) then the only solution left are probably extensions doing the dirty work for you; after all, if you knew how to do this yourself, you wouldn't be asking for help.
Important thing to note: extensions are not a 100% surefire guarantee it'll work, simply because you cannot trust that every user's router is supporting or properly configured for UPnP and/or NAT-PMP, but it's better than nothing and definitely eliminates at least
some of the hassle. Also, depending on the type of extension, it may limit your project to certain platforms (for example if it's a DLL, you can only use it for Windows applications).
Currently, there's only one extension on the marketplace (that I know of) that's offering automatic port forwarding; it's called "DLCEXT - Jack Of All Trades" and was written by me. It also comes with a set of other features that you may or may not want/need in your game, but that's besides the point. I created it because not long ago I was in the very same spot you're in right now: I wanted to make an
online multiplayer game, but GMS2 doesn't come with native functions for NAT traversal, and quite literally
every single post I found on the internet either offered no solution at all, said you would need to rely on third party stuff, or the conversation derailed into other topics over time, still not being of any help.
So, this is me giving back to anyone looking for an answer to this question.
Edit: if you're nevertheless adamant on going for the hole punching route, I recommend reading some articles that go into more detail, like this one:
https://bford.info/pub/net/p2pnat/
Hopefully, it'll provide you with enough information to consider whether this is the best approach for your project.