Understanding When to Use Game Modes and General Organization
This is a fundamental and organizational but basic type of question(s) that I'm trying to wrap my head around. I've read the documentation on Game Modes, and watched a few videos but it's still unclear to me how to answer your own questions on when and what to do when adjusting Game Modes. So in an effort to better understand how Unreal manages data, I'll try and make more specific questions here and hopefully get some insight from you awesome people.
I have more questions regarding the organization of these blueprints but I'll start here. Any reading or insight would be really helpful, as I'm not sure how to ask these types of questions in documentation or video hunting on youtube.
asked Sep 16 '18 at 09:58 AM in Blueprint Scripting
1) A game can contain more than 1 Game Mode blueprint. Because you can use game mode to set current level player controller, hud and spawn actor type, so with one level, you can have DeathMatch game mode, with DeathMatch player controller, while on another level, you can have CaptureFlag game mode, with CaptureFlag player controller, each game mode can has it's own game rule and win/lose condition, etc etc... So in short, it is to divide your blueprint into smaller module, for ease of coding/update/ understanding...
2) No you don't have to create game mode for pause menu and start menu. And this also mean you don't need pawn class to control said menu, in fact you can choose to have none as your game mode pawn class.
3) Unless it is a big menu like main menu, or some task that require user to work purely on menu, or you would love to implement level streaming system, then I would recommend you do that. Pause menu and inventory menu typical doesn't exist on separate map, unless again, there is some task that user need to work purely on menu, I usually just implement some widget and add them to viewport whenever I need them and remove/ hide them from viewport when I done with them. The point is that it cost less to create 1 widget then show/hide or add to viewport/remove it 100 times than create 100 widget every time you need it, especially if you also use Tick function inside each widget.
My project only has one GameMode, and its main purpose is to be a container that sets all the other gameplay-critical stuff like which GameState Class, default Playercontroller etc. although it does handle a few things for managing players, starting stuff on levels etc. This is largely because my project is a multiplayer only game so Gamestate is doing most of what you would use GameMode for but in a multiplayer scenario.
My menus stand alone. I have a level mainly for menus to setup the game options but i also have some of these same menu widgets pop up during gameplay on other levels. It is the Viewport, not the level which contains them, unless youre using 3D widget actor components (those exist in the level). But even those dont have to be tied to the level, you can just spawn, show/hide, enable/disable or destroy them at will regardess of what level or how you are using them.
answered Sep 16 '18 at 08:42 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here