Quote: "But I can't ping the public IP."
Your router may be denying all ICMP requests (ICMP is the protocol ping uses). It is a common thing these days for security reasons. I just tried pinging my own public IP and it doesn't respond.
There seems to be some confusion here. As already mentioned, the person who hosts the game and is
not in the same network as the other players will have to forward his port. If you're at a LAN party and all players are in the same network, then no port forwarding is required.
For example, at a LAN party, you might have the address 192.168.1.8. When you host the game, it will bind to a port which you have to specify (let's say port 2224) and listen for incoming messages. Your friend with IP address 192.168.1.12 will now be able to connect to your game at 192.168.1.8:2224, because they are in the same subnet.
Most home networks usually have only one subnet 192.168.1.0/8. The "8" in this notation means there are 8 bits worth of available addresses, i.e. any device connecting can obtain an address between 192.168.1.2 and 192.168.1.254. (Address 192.168.1.1 is reserved for the router, address 192.168.1.0 is reserved, and address 192.168.1.255 is reserved for broadcast messages).
People that aren't in your local network will not have access to your subnet 192.168.1.0/8. There exists no address they can type in that could connect them with your local network. After all, they themselves are likely in their very own local network with address space 192.168.1.0/8. All they see is your public IP address 183.171.162.129, which is available globally on the internet. However, if they try to connect to 183.171.162.129:2224, they will get the "connection refused" error. Why? Because port 2224 is closed, obviously. There's no application serving that port in that network.
So in order for this to work, the host of the game has to map the port from his computer 192.168.1.8:2224 to a port on the router, say 183.171.162.129:2224. This is called "port forwarding". The port doesn't have to be 2224, you can also map something such as:
192.168.1.8:2224 <-> 183.171.162.129:65532
Once the port is forwarded and open, all messages sent to 183.171.162.129:2224 will be automatically forwarded to the port in the internal network 192.168.1.8:2224. All outgoing messages will also be forwarded back.