Where to put game initialization logic?
Hello, I'm making a Trading Card Game and I am a little confused as to where to put the game initialization logic. by game initialization I mean all the stuff that are general for the game like spawning some initial actors, setting up initial cameras, etc.
For example in my game a normal match has 1 player and 1 AI controlled pawn, a field, two decks belonging to each player, etc.. I wanted to know if for example to spawn the field and cards should i put that logic inside the player controller or in the GameMode or create a class that handles all that and put it in the level as an actor?
asked Sep 03 '14 at 02:20 AM in Using UE4
You can put that in Gamemode and load anything you want from there. You can have multiple gamemode to handle different thing like MainMenu Gamemode : show your main screen with menu, login .. Normal Gamemode: 1 player vs 1 Ai like you said, then maybe Multiplayer Gamemode,
When you want to test it also very easy to test, just change Gamemode in World setting of your level you can test any specific mode you want.
answered Sep 03 '14 at 02:40 AM
I think a good place to put the initailization logic in this case would be at Level Blueprint with BeginPlay event. This way game data will be driven by level blueprint to keep game mode and player controller independent.
answered Sep 03 '14 at 03:28 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here