Auto-translated
I couldn't find any information anywhere about how to play Heroes 4 online without using Hamachi or any other programs. But this game did have the option to connect via the global network. Here's how to create a lobby and invite people:
1) Create a game via TCP/IP, and you need to specify port 2302, which is the only one supported.
2) Make sure your firewall isn't blocking incoming connections; your network device must support UPnP (i.e., you need a router; you won't be able to host from a mobile internet connection).
3) Choose a map. Only after this is done is the lobby created. The IP address is shown in the chat, but we don't need it because it's a local address. You can find the public IP address on the website https://2ip.ru/. Share that one.
4) For other people to connect, they need to enter the IP address. After a while, the room will appear in the list. If this doesn't happen, the host isn't visible on the global level.
Also, the reason why your server might not be visible or unable to connect to another server could be if you ever installed the Radmin VPN program, which permanently (or until you uninstall the program and clean the registry) breaks many network features.