Minigame in Open World Game

Hello Guys i am making an oline openworld where players can play some minigames, this minigames are played in the “world” level so other players can see the minigames, for example i am coding a car race, the player go to the location where is the race and can play the race, for the moment is not a multiplayer race but a race where you have to beat other player “times”, now my question is how i can store information and setting the “architecture” of this part of the game for example i have to make the blueprint and also Race Data in
-Player State
-Game Mode
-Game State
-Third Person BP
Or what else? i’ m not able to understand where i have to make the bluperints and variables.
Thanks a lot!

I’m assuming the game itself is multiplayer. In that case you probably need to break your logic into different chunks. PlayerState and GameState are replicated classes which means they are read only for clients. Game mode is a server only class. You don’t have a game mode object on clients(proxies). If you try to get game mode instance in a multiplayer game on client side it would be None(nullptr in C++).
So that said, what I would do in this case is put the controls and movement (and other gameplay logic) in your character BP (You might want to have a different pawn/character for the minigame and change to that for the duration of the mini game). This class/BP should have proper replication on the server side. Then for non game play logic like wining conditions, saving records, updating leader board, etc. use the replicated data on server side in the game mode class. After that update the game state and player state classes on the server side and replicate the update on the client side then use those data to show desired output to players.

1 Like

OKok i’ll try this, but for example i have the “standard game mode”, of the openworld, the game mode of the minigame will be separated or i have to include the minigame in the main game mode?
rembering always that the minigame is played in the openworld and other players can see player doing the minigame

You get one game mode object per master level, so if the mini game happens in the same level as your open world level then you have to use the same blueprint. You can just use different custom events/function for your mini game inside the your standard game mode…
Alternatively you can make players load into another level when they go to the mini game location in your original level so you will have a different game mode BP for your mini game

Okok Thanks a lot in these days i’ll try and let you know