I am making a multiplayer game, using multiple tutorials and threads for reference to help get me started. All of these seem to do anything server related in the game instance blueprint (ex:server travel, start/destroy session, etc). Is it needed for this to be in the game instance? Can I do it directly in the widget blueprint when you click the designated button? I am using the steam subsystem. Thanks!
There no “need”, but this is common practice, as people want to keep session information on persistent object that don’t get destroyed together with the map on map change and game instance is most common persistent class that is accessible and usable in blueprints only projects. UE4 is more set up for game with match cycle with beginning and end, so all actor class (including GameMode and PlayerController) get destroyed on map change and level restart, to keep them on clean state at new map start and make matches set up a lot easier. Without that you would need to create reset code for each game implementation, practically for every class, with this you don’t really need to care about it everything starts anew. So to keep any data out of that cycle you forced to use Game Instance.
But for example Server Travel should be usable else where on server side, as server will perform action regardless if object calling it will get destroy in process, same as level restart and normal level switching. But UI runs on client, so you will need to send call to server to preform that action anyway, but this could be gamemode as well.