I was reading up on the unity MLAPI and read in the documentation that basic scene management is offered. https://docs-multiplayer.unity3d.com/docs/mlapi-basics/scene-management. However as far as I could see this is limited to placing all of the connected clients and their player prefabs in the same scene. For this use case this works pretty good, I was wondering if anyone has experience using MLAPI and managing different scenes for different players. Basically running a multiplayer game where player X could be in a different scene than player Y, whilst still being able to move to another players scene and see the state of the scene that player caused. A bit how games such as Diablo 3 work. I have no idea where to begin with such an implementation, any pointers would be greatly appreciated!
Related
I'm currently learning how to use Netcode for GameObjects and have just gotten the client, host, and server working as well as a movement script for the players that only effects each player individually. the only problem with it now is that when a new player is spawned, any existing players camera is changed to the camera that is spawned within the prefab of the new player. I have looked around online for a solution and this is the closest thing I could find but it's not done using Netcode for GameObjects and I'm not sure how to translate the information in the video over.
Any idea how i could achieve this?
I want to create a simple multiplayer game in unity 3d using photon pun 2 free.
Im trying to implement a shared camera, a camera that doesnt follow any Player, stays stationary and everyone sees the same thing.
I ve run into the issue where Only the master client sees the changes and other clients have the scene frozen As if the camera didnt update for them at all
So how to fix that, how to make the camera update for everyone not just the host?
I'm making my own match 3 multiplayer game, the concept is to have two people face off against each other person can face off another person by swapping tiles to make a line of the same form. I want to introduce multiplayer by connecting two players together and allowing each person to see their opponent's screen, as well as syncing their moves. So far, I have a simple match 3 game (I created one using different tutorials, mainly this playlist) and followed a simple multiplayer tutorial (Mirror) for a player to host or be a client. My problem is that I have no idea how to show both players their opponent's screen to each other. I even found an example of what I want the multiplayer mode in my game to be like. Can anyone point me in the right direction, please and thank you.
Additional information:
I'm using mirror for multiplayer
I created a network manager gameobject and added the necessary components to it. I also added the game pieces into the 'registered spawnable prefabs' and created an empty gameobject, called player for the player prefab.
Each game piece has a network transform and network identity component attached.
The player prefab object has a camera child under it to.
This is what I want my game to look like:
Overall, I want to have player's view each other's screen:
As you can see, both player's are connected, what I want to do it to allow each player see their opponent's screen. Does anyone have an idea on how I can do it?
Thank you! :)
I'm currently making a 2d platformer game with unity. I'm going to build game world with rooms (like in Hollow Knight and many other metroidvania games). So, my first idea is to have each room as a separate prefab with virtual camera and exits linked to other rooms on scene. And to have several scenes (smth like each scene contains a set of "thematic" rooms).
I have another idea but i'm not sure if it gonna work properly in terms of perfomance. The idea is simple - to have single game scene and instantiate\destroy game rooms dynamically and seamless. So the game will have current room and all adjacent rooms loaded (with some depth maybe, i.e. all adjacent rooms with depth R), when player changes room - some new rooms are instanciated and others destroyed. This feels like a good idea, cause after creating dynamic room system you can just concentrate on creating and linking rooms. But i'm afraid it can lead to some perfomance problems (i.e. game freezes when player moves from one room to another if there is a big enough room nearby). And i guess there can be a lot more unexpected problems.
So it's kind of open-type question. What do you think about this "dynamic" approach? Is it worth trying? If you have expirience building similar games, what design approach did you use?
Typically, creating and destroying objects in-game is a no due to performance issues.
From my high school game dev teacher, a better way to do it is to preload everything outside the camera, and just move needed resources into view as needed for a randomly generated scene.
If you're looking for a static scene, I would just preload everything that I need for that specific scene.
I have a 2D game/demo I am working on for learning purposes for Unity Networking and I have come to a predicament on how I should handle multiple scenes in my game because as we all know most games have more than 2 scenes and players are not always in the same scene (someone is in the scene HouseLrg while the other is in MainWorld scene).
Now the best thing I have come across is :
SceneManager.LoadScene (newScene, LoadSceneMode.Additive)
But when I use this I notice that the scene that I am loading literally overlaps the scene I was currently on. So my questions are :
1) Is there something else besides LoadScene(string, LoadSceneMode.Additive) that would work for having players in different scenes?
2) If LoadScene(string, LoadSceneMode.Additive) is the solution I am looking for; would I have to just edit the position/location of my entire scene so it isn't in the same positions as other scenes so that when I load it "Additive" there is no overlap? Or is there something I can do that is "isLocalPlayer" based so that the player making the scene change is the only one that goes through it?
Help me become less ignorant please because, "Knowledge is Power!"
Thanks!