Connection & Basic Movement | How to Make a Multiplayer Game With Fusion 2 - Part 1

  Рет қаралды 11,391

Photon Engine

Photon Engine

Күн бұрын

Welcome to part one of this new tutorial series where we’ll be using Photon Fusion 2 to build a multiplayer game in Unity. In this video we set up the connection and implement basic player movement.
Watch Part 2: • Game Loop & Leaderboar...
Download the Starter Project: doc.photonengine.com/fusion/c...
Photon Dashboard: dashboard.photonengine.com/
Tutorial Series Playlist: • Fusion Multiplayer Tut...
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Photon Links
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
► Photon: www.photonengine.com/
► Photon Fusion Intro: doc.photonengine.com/fusion/c...
► Photon Fusion SDK: assetstore.unity.com/packages...
► What's New in Fusion: doc.photonengine.com/fusion/c...
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Timestamps
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
0:00 Intro
0:36 Downloading the Starter Project
1:27 Getting a Photon App ID
2:02 Setting Up the Connection
2:31 Spawning Players
4:42 Input Sampling
8:52 Player Movement
11:58 Camera Movement
14:56 Fixing View Obstructions
15:24 Everything Working
15:43 Outro
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
About This Video
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
In this beginner tutorial series you'll learn how to make a multiplayer game in Unity, using Photon Fusion 2. In this first video, we go over the process of getting a Fusion app ID and then using the starter project as the base, we set up a connection, spawn players and implement basic player movement. By the end you'll be able to join a friend's lobby and see each other moving around!
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
About Photon Fusion
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Photon Fusion is a high performance state synchronization networking library for Unity. Fusion is built with simplicity in mind and integrate naturally into the common Unity workflow, while also offering advanced features like data compression, client-side prediction and lag compensation out of the box.
Under the hood, Fusion relies on a state-of-the-art compression algorithm to reduce bandwidth requirements with minimal CPU overhead. Data is transferred as partial chunks with eventual consistency. A fully configurable area-of-interest system is supplied to allow support for very high player counts.
Learn more: doc.photonengine.com/fusion/c...
#Multiplayer #UnityTutorial #PhotonFusion #Unity #GameDev #PhotonEngine

Пікірлер: 59
@PhotonEngine
@PhotonEngine 4 ай бұрын
Thanks for watching! Watch Part 2: kzfaq.info/get/bejne/qNBgd8SFndyVZ3U.html Download the Starter Project: doc.photonengine.com/fusion/current/tutorials/multi-climb Photon Dashboard: dashboard.photonengine.com/ Tutorial Series Playlist: kzfaq.info/sun/PLAkOwsOxpAvriKhkf8LQKB9DPONAfSEya
@tomweiland
@tomweiland 4 ай бұрын
This tutorial really helped me to learn how to use Fusion! Keep the quality content coming 😉
@paradonmusic
@paradonmusic 4 ай бұрын
Where have I seen this guy before? 🤔
@tomweiland
@tomweiland 4 ай бұрын
@@paradonmusic ඞ
@copperdevs
@copperdevs 4 ай бұрын
@@paradonmusic i wonder where
@preloadingwastaking
@preloadingwastaking 4 ай бұрын
Hmmm i wonder where... I feel like this person is the one who made this tutorial, but i'm probably wrong ;)
@BadBanana
@BadBanana 4 ай бұрын
Is this you Tom? Grats on employment with Photon Proud of you sir 👏
@Meepeh.
@Meepeh. 4 ай бұрын
We do love photon around here
@mesopable
@mesopable 3 ай бұрын
These videos truly highlight the power of Photon services. Great networking, easy implementation, freedom for developers. Keep on rocking Photon crew!
@PhotonEngine
@PhotonEngine 3 ай бұрын
Thanks for watching and for the kind words! I'll make sure to pass them on to the team ❤
@FarSam25
@FarSam25 29 күн бұрын
you guys are amazing! keep it up !❤❤
@klimklymenko3585
@klimklymenko3585 3 ай бұрын
Keep it up! Looking forward for more Fusion tutrorials
@PhotonEngine
@PhotonEngine 3 ай бұрын
Thanks for watching! Here is the second part of the series: kzfaq.info/get/bejne/qNBgd8SFndyVZ3U.html
@fholm
@fholm 4 ай бұрын
Awesome tutorial, absolutely loved it!
@cjdev16
@cjdev16 4 ай бұрын
Nice tutorial
@PhotonEngine
@PhotonEngine 4 ай бұрын
Glad you liked it!
@hamdikhouaja5410
@hamdikhouaja5410 4 ай бұрын
Finally, Officiel tuto for Fusion2! Thank you !! Is it possible to make another tuto for Shared Mode as Host ??
@PhotonEngine
@PhotonEngine 4 ай бұрын
Thanks for the feedback! There is more content to come and we will consider your suggestion, but in the meantime consider taking a look at the Shared Mode Basics tutorial on our website (if you haven't already): doc.photonengine.com/fusion/current/tutorials/shared-mode-basics/overview We also just released our Fusion Quiz Network Sample which is a great sample to get started with Fusion Shared Mode: doc.photonengine.com/fusion/current/game-samples/fusion-quiz-network
@a-cj8xu
@a-cj8xu 4 ай бұрын
Thank you! how to load a scene and keep score, runner etc.. when an object is triggered?
@user-es4fx7wo6r
@user-es4fx7wo6r 8 күн бұрын
honestly its very owerwhelming and alot complexity for new ppls. As new to Fusion (almost new to multiplayer but still) - there is so much components and classes that u adding and start to use right away like its obvious, but i have only questions - "what is this?", "how it works?" , etc, insane amount of new terminology and classes that wasn't explained at all.
@diegodrago7801
@diegodrago7801 4 ай бұрын
Does anyone know any good tutorial to implement this but with the Meta Avatars SDK or with ReadyPlayerMe or any other good avatar provider?
@StarTair18
@StarTair18 2 ай бұрын
This is great, but it's too complicated. When using Pun you only need like 3 additional lines of code and then slap on some components and there you have a multiplayer game
@GameDevASMR
@GameDevASMR 3 ай бұрын
Very cool tutorial thanks. I have a question, why is the camera logic part of the networking logic? As each client has its own camera, and camera shouldn't impact gameplay/logic, I thought the camera would not be networked, and so you would implement camera logic like in any Unity project? (each client has only one camera, positioned based on its own character and inputs, so no networking at all)
@PhotonEngine
@PhotonEngine 3 ай бұрын
Thanks for watching! You are correct-each client has its own camera, and the camera logic itself should not be (and in fact _is_ not) networked. If you look at the CameraFollow class, none of the code in there has anything to do with networking and it could just as well be used in a singleplayer game. However, we do network the mouse input (like other input) because the player's view direction needs to be synchronized so that the server can correctly execute logic that depends on/is affected by it (such as calculating the movement direction or raycasting in the correct direction for things like grappling and shooting).
@hieptranngoc2584
@hieptranngoc2584 4 ай бұрын
we need this, how to get list of players in room and how to invite friend thanks
@Malonik
@Malonik 9 күн бұрын
I'm a noob, I'm up to the inputmanager script section and my visual studio isn't doing what the one in the vid does. So when I try and do the quick actions nothing happens or comes up. That hasn't been a huge drama up to this point as I can just pause and manually copy from the video however in this step the lines go off the edge of the video so I can't see what's there to copy it. Any idea why my VS isn't behaving the same? Or is there somewhere I can pull the code from to get me through this step?
@Malonik
@Malonik 9 күн бұрын
I figured out what was going wrong, in unity I needed to go into edit > preferences > external tools and set the external script editor as visual studio. I'm not sure if you did this and I missed it but thought I'd update here in-case anyone else runs into the issue. :)
@lilboiUK
@lilboiUK 4 ай бұрын
Haha wish i'd of seen this a few days ago
@limegeeg
@limegeeg 4 ай бұрын
Does it works with Unity WebGL?
@hieptranngoc2584
@hieptranngoc2584 3 ай бұрын
where is the tutorial for host seft server for photon fusion and chat thanks
@Pa3BeDka_Gaming
@Pa3BeDka_Gaming 3 ай бұрын
I am waiting for the continuation and completion of this topic.
@PhotonEngine
@PhotonEngine 3 ай бұрын
Thanks for your patience! We've just uploaded the second part: kzfaq.info/get/bejne/qNBgd8SFndyVZ3U.html
@_dodoaldhah6744
@_dodoaldhah6744 Ай бұрын
I'm making an online game and I'm having a problem on input collisionenter
@chetnaya411
@chetnaya411 22 күн бұрын
Is this tutorial using shared mode or host mode ?
@ashdev
@ashdev 4 ай бұрын
can you make tutorial on multiplayer vehicles? or converting any existing movements to work in multiplayer.
@PhotonEngine
@PhotonEngine 4 ай бұрын
Thank you for the suggestion! We will make more tutorials in the future. In the meantime have you seen our Fusion Karts Sample? assetstore.unity.com/packages/templates/tutorials/karts-multiplayer-photon-fusion-213885 We also recently had a stream where we did a post mortem on our upcoming Quantum Racing sample. There are a lot of great takeaways for handling vehicles for multiplayer in the stream: kzfaq.info/get/bejne/j8qGodVyq63PeHk.html For Circle Members we also have Vehicle samples for Quantum: doc.photonengine.com/quantum/current/game-samples/arcade-racing/overview doc.photonengine.com/quantum/current/game-samples/keo-vehicular-combat doc.photonengine.com/quantum/current/technical-samples/vehicle-physics
@ashdev
@ashdev 4 ай бұрын
@@PhotonEngine quantum is ecs. Its complex for me. I wanted simple . I also checked battle royal project but the code is very large. Overwhelming 🤕. Is there a very basic project that just explains most aspects of fusion?. It will be very nice if you make a tutorial just like this but everything from scratch. Or using any existing non multiplayer controller and make it multiplayer. Large code base and complexity is barrier to entry. I have no knowledge about multiplayer at all. Any guidance will be very helpful thanks 🙏.
@erickpassos
@erickpassos 4 ай бұрын
@@ashdev >Or using any existing non multiplayer controller and make it multiplayer. We don't do this because this is the wrong approach when creating a multiplayer game. If you want to build a multiplayer game right, that plays well and smoothly, you start with multiplayer tech from day one. And Vehicle Physics is one of the most complex things to do right in multiplayer. There is no simple solution for "turn my single-player vehicle physics in unity multiplayer" (that plays right/well).
@ashdev
@ashdev 4 ай бұрын
@@erickpassos ok got it.
@JadenAllen
@JadenAllen 4 ай бұрын
Yoooo its tom
@tomweiland
@tomweiland 4 ай бұрын
👀
@nnNothing
@nnNothing 3 ай бұрын
i think, PUN is still Better Fusion integration on Unity is like Hell, worse than Unity Networking (NetCode)
@mk-3079
@mk-3079 4 ай бұрын
I tried following and it's all nice and well but what if I want to make my own lobby and game scene...Like it's easy to do when you have Menu class that's already made but that's not really a tutorial is it. Is there somewhere a simple no nonsense guide on Photon Fusion where when I create a game and transition to game scene where I can spawn a player. I tried this tutorial but without Menu Class you provided GameLogic is not getting called. How difficult it is to simply when I StartGame and transition to a next scene that I can simply debug.log(player spawned) or something like that...Enough with abstract bullshit classes
@mk-3079
@mk-3079 4 ай бұрын
Is there some secret code in all of yours Menu classes and interfaces that makes GameLogic actually be called and actually spawn a player? Because when I simply write the same code as in Asteroid project simple lobby code it doesn't get called...
@PhotonEngine
@PhotonEngine 4 ай бұрын
We have plenty of samples showing how to transition from a menu scene into a gameplay scene such as the Asteroids Simple Sample. Player spawning is done via the INetworkRunnerCallbacks which is explained in the video here and also in the Fusion starter tutorial on our websites.
@W1LdnKai
@W1LdnKai 4 ай бұрын
You ever get this set up and working etc?
@mk-3079
@mk-3079 3 ай бұрын
@@W1LdnKai I did. It was one line of code in Arguments when Spawning. That's why I couldn't get even the Debug.Log through
@DarekB2
@DarekB2 2 ай бұрын
6h looking why if (GetInput(out NetInput input)){} is null.... still nothing.
@PhotonEngine
@PhotonEngine Ай бұрын
Troubleshooting coding issues is difficult via KZfaq comments, so if you're still looking for help resolving this please join the community Discord server (you can find the link in your Photon Dashboard) and post a question there. To make it as easy as possible to help you, please include: - The code that's not working as expected. What is it doing or not doing? - Any errors you're getting. - What you mean by "is null". Are you getting a NullReferenceException on that line, is GetInput always returning false, or does the _input_ never contain your key presses?
@user-uc2pf3zt1t
@user-uc2pf3zt1t 3 ай бұрын
I downloaded the project and ran it it works fine but when some other person from US try to enter the room they can not , i am from india and my friends from here can join but not from US , Kindly help
@PhotonEngine
@PhotonEngine 3 ай бұрын
Are you clicking "quick play"? That will create or join a lobby in the region that is selected in the settings menu (which defaults to "best," aka the closest one to you ping-wise). If you and your American friend both click "quick play" you'll be on different regions and so you'll be put in separate lobbies. However, if you create a lobby and send your friend the room code, they should be able to join your lobby via the "party menu" button. Hope that helps!
@FarSam25
@FarSam25 15 күн бұрын
​@@PhotonEngine same problem here and the solution above not working
@RapidRealityRJC
@RapidRealityRJC 3 ай бұрын
Invalid token '=>'?
@PhotonEngine
@PhotonEngine 3 ай бұрын
Thanks for watching! If you're getting an error and looking for help to solve it, you'll need to provide more context (what is the full error message, which line of code is producing it, etc). Double check that you don't have any typos on that line, and consider joining our Discord server as it's much easier to troubleshoot issues there than in the KZfaq comments section.
@BlackMesaEmployee
@BlackMesaEmployee 4 ай бұрын
tom weiland w
@tomweiland
@tomweiland 4 ай бұрын
A common occurrence 😏
My Wife and I Made an Indie Game and it Made Millions!
14:45
Eastshade Studios
Рет қаралды 1,1 МЛН
Using Image Recognition to DESTROY Fruit Ninja
10:08
CodeNoodles
Рет қаралды 603 М.
Does size matter? BEACH EDITION
00:32
Mini Katana
Рет қаралды 20 МЛН
Happy 4th of July 😂
00:12
Alyssa's Ways
Рет қаралды 68 МЛН
WHAT’S THAT?
00:27
Natan por Aí
Рет қаралды 13 МЛН
Despicable Me Fart Blaster
00:51
_vector_
Рет қаралды 26 МЛН
Adobe is horrible. So I tried the alternative
25:30
Bog
Рет қаралды 760 М.
Photon Quantum Now Free For Developers
9:06
Gamefromscratch
Рет қаралды 13 М.
LEARN TO MAKE A MULTIPLAYER GAME WITH PHOTON FUSION IN 2024!
19:48
How to Make a Multiplayer Game - The Lobby
24:47
Blackthornprod
Рет қаралды 86 М.
I'm Never Using Tmux The Same Again!
6:58
DevOps Toolbox
Рет қаралды 15 М.
I tried Discord Bot Makers...
14:19
FaceDev
Рет қаралды 107 М.
Dear Game Developers, Stop Messing This Up!
22:19
Jonas Tyroller
Рет қаралды 696 М.
🔥🔥🔥🔥 The GREATEST Beginner GameDev Crash Course EVER 🔥🔥🔥🔥
1:02:54
Does size matter? BEACH EDITION
00:32
Mini Katana
Рет қаралды 20 МЛН