Missed a tiny thing in the AIHandler.cs code Add: distanceToTarget = 0; //Check that we have a target if (target == null) SetTarget(); if(targetHPHandler.isDead) SetTarget(); In the GetDirectionToTarget function. It wasn't using the targetHPHandler at all which it should, otherwise it will keep shooting at dead players.
can you show us how the lobby owner can kick other players in the lobby (when the screen is ready) + how to exit the lobby while the player is already playing in the lobby( in the map)? (By KOPAMAN)
can you show us how the lobby owner can kick other players in the lobby (when the screen is ready) + how to exit the lobby while the player is already playing in the lobby( in the map)?
it might actually be useful and like even the user list can be good in game, and the owner of the lobby can kick people who joined the lobby in the "World1" scene for exemple
I don't think that it will use that much performance unless you have loads of them. The host has a lot of other advantages so this would even the playfield a bit (just kidding because if the host is overburden then all other clients will get a very bad experience). You can do a lot of optimization to get it to run even better but I don't think it is needed yet.
Hi! You can add the layers which should be used for the raycast, so either you use your teams for that or you can have some other way of detecting if there is a teammate, like using tags or attach a team script to it.
As of now I am using photon pun 2 for my RPG and its working as expected however the pain in the ass here is the enemy bots if the master client disconnects all of them will stop functioning even if the masterclient is in the background still the bots stop working also. Im also thinking of transferring to fusion. Do I still encounter it? I just wanted a Not Host Dependent Enemy AI that also syncs
Thanks 🙏 Nothing gets automatically destroyed by Photon Fusion however the code does destroy the bots when host migration is triggered. You can adjust the code so that bots are not destroyed when host migration happens.
Glad that you liked it. Most of the time in networking you can cheat which most games do. So do you really need it to be synced or is it enough to provide the data and then let each client handle it on its own. Unless you have 2 pc next to each other looking at the same object the players won't notice really.
@@PrettyFlyGames Thanks for response!.I want to sync it because I tried by providing data to each client and let them handle it It jitter most of the times but It not that much big deal and I want to ask if its a bug or not but I have many objects in my scene and the playes are laggging too much on the network but I disable render shadow in camera for objects in my scene it does not lagg anymore How can I fix it?
@@anirbanparam1087 If you have lag with shadows on and it works good with shadows off then it means you have a frame rate issue which is not related to the networking. I would advise that you add a FPS counter and then use the profiler + frame debugger to figure out what is taking the performance. If you are on webGL or lower end mobile platforms then you'll have issues with shadows on many objects so that will be tricky but you can tune the shadow distance and maybe everything doesn't need real time shadows.
@@PrettyFlyGames Well the game is not lagging but the other character movement on network are lagging(not my character from my pov) on the network only if the shadows are on.(There is no frame rate issue).
@@anirbanparam1087 that does sound very strange as shadows have nothing to do with the networking really. The networking will only sync the positions of the game objects and it doesn't care if shadows are enabled or not. If this also happens when you are the host then it is not related to networking as the when playing from the host it is just like playing a regular single player game.
i would love to see how the owner of the lobby can kick the player and i agree with @KOPAMANNN, i guess we need to leave the lobby during the ready scene and during the "world1" scene
You can kick a player from the host/server by calling Runner.Disconnect(PlayerRef); You can see how that is implemented in ReadyUIHandler.cs where the host will kick any unready player. To disconnect as a client you would call Runner.Shutdown() or networkRunner.Shutdown() if you don't call it from a script deriving from : NetworkBehaviour
Missed a tiny thing in the AIHandler.cs code
Add:
distanceToTarget = 0;
//Check that we have a target
if (target == null)
SetTarget();
if(targetHPHandler.isDead)
SetTarget();
In the GetDirectionToTarget function. It wasn't using the targetHPHandler at all which it should, otherwise it will keep shooting at dead players.
can you show us how the lobby owner can kick other players in the lobby (when the screen is ready) + how to exit the lobby while the player is already playing in the lobby( in the map)? (By KOPAMAN)
can you show us how the lobby owner can kick other players in the lobby (when the screen is ready) + how to exit the lobby while the player is already playing in the lobby( in the map)?
yes pls
we are following your tutorial with @KOPAMANNN , and we really need to know that. Pls could you show us how to do that? (you ROCK! :) )
it might actually be useful and like even the user list can be good in game, and the owner of the lobby can kick people who joined the lobby in the "World1" scene for exemple
it can be really good, @PrettyFlyGames
good idea!
nice!
Thanks 🙏
please continue this
In the near future no more episodes are planned for this. What would you like to see in the future?
Great tutorial!! One thing that got me thinking is since the host user has to manage the bots, would this cause a performance disadvantage for them?
I don't think that it will use that much performance unless you have loads of them. The host has a lot of other advantages so this would even the playfield a bit (just kidding because if the host is overburden then all other clients will get a very bad experience).
You can do a lot of optimization to get it to run even better but I don't think it is needed yet.
Hi question. Is it possible to add collision matrix to not hit your team mates?
Hi!
You can add the layers which should be used for the raycast, so either you use your teams for that or you can have some other way of detecting if there is a teammate, like using tags or attach a team script to it.
Adds a chat for players to communicate
As of now I am using photon pun 2 for my RPG and its working as expected however the pain in the ass here is the enemy bots if the master client disconnects all of them will stop functioning even if the masterclient is in the background still the bots stop working also. Im also thinking of transferring to fusion. Do I still encounter it? I just wanted a Not Host Dependent Enemy AI that also syncs
In Photon Fusion the new host can take over the handling of the AI if the old host disconnects.
Amazing but problem is when host player leave the game then Bots will also remove because after leaving the game all the host data will be destroyed
Thanks 🙏
Nothing gets automatically destroyed by Photon Fusion however the code does destroy the bots when host migration is triggered. You can adjust the code so that bots are not destroyed when host migration happens.
Thanks for the tutorial ! It was really good and I want to ask that how can I sync animation rig like using aim constraints in network?
Glad that you liked it. Most of the time in networking you can cheat which most games do. So do you really need it to be synced or is it enough to provide the data and then let each client handle it on its own. Unless you have 2 pc next to each other looking at the same object the players won't notice really.
@@PrettyFlyGames Thanks for response!.I want to sync it because I tried by providing data to each client and let them handle it It jitter most of the times but It not that much big deal and I want to ask if its a bug or not but I have many objects in my scene and the playes are laggging too much on the network but I disable render shadow in camera for objects in my scene it does not lagg anymore How can I fix it?
@@anirbanparam1087 If you have lag with shadows on and it works good with shadows off then it means you have a frame rate issue which is not related to the networking. I would advise that you add a FPS counter and then use the profiler + frame debugger to figure out what is taking the performance. If you are on webGL or lower end mobile platforms then you'll have issues with shadows on many objects so that will be tricky but you can tune the shadow distance and maybe everything doesn't need real time shadows.
@@PrettyFlyGames Well the game is not lagging but the other character movement on network are lagging(not my character from my pov) on the network only if the shadows are on.(There is no frame rate issue).
@@anirbanparam1087 that does sound very strange as shadows have nothing to do with the networking really. The networking will only sync the positions of the game objects and it doesn't care if shadows are enabled or not. If this also happens when you are the host then it is not related to networking as the when playing from the host it is just like playing a regular single player game.
can you show us on how to convert it to mobile platform sir thank you
There are lots of videos showing how to add touch input to Unity. Then you simply wire that to the input instead of reading the keys + mouse.
photon fusion 2.0 tutorial update?
Once it is fully released. Now it is on RC status.
@@PrettyFlyGames Ok great thanks.
i would love to see how the owner of the lobby can kick the player and i agree with @KOPAMANNN, i guess we need to leave the lobby during the ready scene and during the "world1" scene
You can kick a player from the host/server by calling Runner.Disconnect(PlayerRef); You can see how that is implemented in ReadyUIHandler.cs where the host will kick any unready player.
To disconnect as a client you would call Runner.Shutdown() or networkRunner.Shutdown() if you don't call it from a script deriving from : NetworkBehaviour