Where to locate overall game handling logic?
Lets say I have RTS game application. The user is starting the game app, first he should see a main menu:
I mainly use C++. The main menu is based on a widget blueprint and handled by a user widget class implementation. In a prototype game app I made the main menu working by initializing it at BeginPlay in a PlayerController, just for test purposes. But if the main menu is used to load e.g. a single player map it runs into ugly logic not showing the main menu, because BeginPlay is called each time when loading a map. I'm always facing the problem that my logic is badly misplaced due to not having information of how the UE4 game play framework components stick together. In the particular case I am asking myself where to locate the main menu handling code, due to it's overall for the game application.
At the point where the main menu appears, there is the starting point of my game application, and there is nothing specified what game user wants to do, but there is already setup a default for everthing. After the game user has made a choice at the menu then it's known what to do next, and how to setup the specific game requirements. I know there is a GameInstance, GameMode, GameState, PlayerState, and what they intended to be used for, but it's puzzling how they associated exactly together. They all come into play somehow in a magical way. Especially how to design a game architecture that fits plenty to even single player and multi player.
I have a few questions regarding the UE4 detail design:
i'll try cover basic things, you should know i prefer blueprints to C++, but core idea the same:
networking example on actor replication and relevancy from epics (and not only this topic) can be found here launcher->learn (scroll down to "Engine Feature Samples", because there're just docs link on top)->content example (click it and inside click download)->library (after download complete press "create project" on content example); after opening this project open level called "networking" from file menu (here are also other levels for other topics)
not replicated - this one fires only locally on each client and server;
run on server - this one used by clietns to ask server execute something (remote procedural call);
multicast - replicate this even from server to everyone else;
run on owning client - replicate this even from the server to owning client
their visual functionality can be seen in networking example of content example project;
p.s. if you didn't got idea on something various, try ask again after reading this, because your understanding may change and note i described common knowledges to properly setup multiplayer and some other thing, how you would implement final multiplayer/game up to you, same result can be achieved in different ways using this
Follow this question
Once you sign in you will be able to subscribe for any updates here