Quantcast
Channel: Photon Bolt — Photon Engine
Viewing all 1054 articles
Browse latest View live

Allow players to join a game already running.

$
0
0
Hi,

I would like to allow a player to start a game and play in it, and keep it avaliable to join by other players. When I simply start a game with BoltMatchmaking.CreateSession() and then try to check the BoltNetwork.SessionList, it is not there. How can I get the currently open games?

Thanks

BoltRaycastAll() Not working properly on Mobile

$
0
0
Hi their am working on multiplayer shooting game using photon bolt. The raycast shooting is works perfectly on PC Build. but not works properly on Mobile Build

Photon Bolt Equipping/Switching Weapons.

$
0
0
Hello, so I'm fairly new to bolt, and was wondering how one would go about equipping items. What I'm trying to do is make it so that you can equip/switch different guns for an FPS that I am creating. Any help is appreciated. Thank you.

Vector3.Lerp doesnt Sync

$
0
0
Hello, so I am currently developing an FPS, and was adding aiming. When I went to test, I found that the gun wouldn't sync. I was hoping someone here would be able to help me. Thank you.

Playfab Integration problem

$
0
0
Hello! I am trying to do a PlayFab Integration lesson. And I have a problem with that.

1. I uploaded the .zip file to the Playfab server and made the settings. The virtual machine says State: Running Health, Status: Healthy. But the virtual server State: Initializing is in a loop. After several attempts, I get the status PendingHeartbeat. But I still can’t connect.

2. I tried to do local debugging with MockVmAgent. In the process, I see many repetitions of CurrentGameState: Initializing. And then CurrentGameState: Terminated. CurrentGameState: StandingBy and CurrentGameState: Active I do not see.

I can’t understand what could be the problem.
Maybe I missed something?

Settings
{
    "RunContainer": false,
    "OutputFolder": "C:\\PlayFabTests",
    "NumHeartBeatsForActivateResponse": 1,
    "NumHeartBeatsForTerminateResponse": 60,
    "AgentListeningPort": 56001,
    "AssetDetails": [
        {
            "MountPath": "C:\\Assets",
            "LocalFilePath": "C:\\DATA\\UNITY3D\\MyProjects\\Playfab\\Playfab\\Playfab2.zip"
        }
    ],
    "GameCertificateDetails": [],
    "PortMappingsList": [
        [
            {
                "NodePort": 56100,
                "GamePort": {
                    "Name": "bolt_server",
                    "Number": 60001,
                    "Protocol": "UDP"
                }
            },
            {
                "NodePort": 56100,
                "GamePort": {
                    "Name": "master_server1",
                    "Number": 5055,
                    "Protocol": "UDP"
                }
            },
            {
                "NodePort": 56100,
                "GamePort": {
                    "Name": "master_server2",
                    "Number": 27001,
                    "Protocol": "UDP"
                }
            },
            {
                "NodePort": 56100,
                "GamePort": {
                    "Name": "game_server1",
                    "Number": 5056,
                    "Protocol": "UDP"
                }
            },
            {
                "NodePort": 56100,
                "GamePort": {
                    "Name": "game_server2",
                    "Number": 27002,
                    "Protocol": "UDP"
                }
            }, 
            {
                "NodePort": 56100,
                "GamePort": {
                    "Name": "name_server1",
                    "Number": 5058,
                    "Protocol": "UDP"
                }
            },
            {
                "NodePort": 56100,
                "GamePort": {
                    "Name": "name_server2",
                    "Number": 27000,
                    "Protocol": "UDP"
                }
            }
        ]
    ],
     "ProcessStartParameters": {
        "StartGameCommand": "Playfab.exe -batchmode -nographics"
    },
    "ContainerStartParameters": {
        "StartGameCommand": "C:\\Assets\\Playfab.exe",
        "ResourceLimits": {
            "Cpus": 0,
            "MemoryGib": 0
        },
        "ImageDetails": {
            "Registry": "mcr.microsoft.com",
            "ImageName": "playfab/multiplayer",
            "ImageTag": "wsc-10.0.17763.973.1",
            "Username": "",
            "Password": ""
        }
    },
    "SessionConfig": {
        "SessionId": "ba67d671-512a-4e7d-a38c-2329ce181946",
        "SessionCookie": null,
        "InitialPlayers": [ "Player1", "Player2" ]
    },
    "TitleId": "",
    "BuildId": "00000000-0000-0000-0000-000000000000",
    "Region": "WestUs"
}

How to get player number when someone enters the room?

$
0
0
Hi, I'm trying to get the player number or ID when someone joins the room for Photon BOLT. On the console it prints this message when someone joins:
27/05/2020 12:03:14 PM: Player 3 entered the room
I want to get 3 in this case. I know this sounds like a very basic question, but I searched the documentation and the forums but I can't find anything that would give me this ID.

My use case for this is: I'm working on a multiplayer racing game. I want to assign each player to a specific slot: 1,2,3, etc.

Thanks in advance!

Bolt.GlobalEventListener.OnEvent no longer receiving event messages after BoltNetwork.Shutdown()

$
0
0
Is this intended? How do I make Bolt.GlobalEventListener.OnEvent(MyEvent evnt) continue to receieve events after calling BoltNetwork.Shutdown(). I uploaded a public github repo showcasing the issue. https://github.com/DrewProTag/PhotonBoltOnEventBugRepo Reproduction steps with Unity Project: 1. Built Unity Project. 2. Run 2 clients. 3. Have Player 1 hit Host button. 4. Have Player 2 hit Join button. 5. Wait for Player 2 to connect to Player 1. 6. Have Player 1 hit Send Event button. 7. Observe Player 2 receives event via status text update. 8. Have Player 1 hit Shutdown. 9. Observe Player 1 and Player 2 disconnect. 10. Have Player 2 hit Host button. 11. Have Player 1 hit Join button. 12. Wait for Player 1 to connect to Player 2. 13. Have Player 2 hit Send Event button. 14. Observe Player 1 doesn't receive event.

How do you set the maximum players for a lobby in BOLT?

$
0
0
I can't find anything that allows me to set the session info. In BOLT settings I can set a connection limit, however I want to be able to set it per lobby. Is there any way to do this?

What is the difference between BoltNetwork.Shutdown() and BoltNetwork.ShutdownImmediate() ?

Exporting Bolt Assets info

$
0
0
Hello.
I'm looking for a way to share my Bolt configuration with others without having to upload the whole Bolt package.
The idea is just to show how some asset pack integrates with Bolt and for that I was looking for the files that store information on the Bolt Assets.

Apple Reviewer cannot connect to Photon Cloud for Bolt Server

$
0
0
My application keeps getting rejected by apple test reviewers because it cannot connect to Photon Cloud from inside of their facility. I have seen a number of related forums posts on how to resolve this if you are using PUN(like switching to TCP or using iPv6), but I can't find how to resolve this using a dedicated Bolt server.

What is the current solution for this issue?

Can't sync force for explosions

$
0
0
Hi. I'm trying to cause explosions but can't seem to sync the regular unity forces for them. Is there a certain way that I should handle explosions. Any tutorials?

How to dynamically create game rooms (servers) in a bolt?

$
0
0
Hello! I have a prototype of my Bolt game. I want that after connecting two players, an instance (server, room) with authoritarian game logic should be created for them. And so for each pair. How to do this if each instance of the bolt server is a separate application? I don’t understand how to implement this mechanism. What is (1) on my chart?

1. Master server implemented on Photon Bolt?
2. Master server implemented on the Photon Server?
3. The Playfab service takes on this task.
4. other

https://imgur.com/a/Nr0kl8e

Kinematic Character Controller implementation

$
0
0
I'm currently trying to implement the Kinematic Character Controller (https://forum.unity.com/threads/released-kinematic-character-controller.497979/) to Bolt. Unfortunately, it's not that easy than I thought. The controller uses its own UpdateVelocity and UpdateRotation loop and requires to update both parameters inside them. So unlike the unity character controller, there is no Move() method. Maybe someone could point me in the right direction here?

SceneLoadLocalDone called before non-persistent entities destroyed

$
0
0
I've noticed that when I transition scenes, SceneLoadLocalDone callbacks of GlobalEventListeners in the new scene are invoked before the process of destroying all non-persistent entities upon scene transition is complete. If I spawn new non-persistent entities from within SceneLoadLocalDone, those entities wind up getting destroyed immediately as the prior scene transition completes.

Ultimately, this results in the following assert:
BoltAssertFailedException: Assert Failed: 
Bolt.Exceptions.Assert.True (System.Boolean condition, System.String message) (at <91e633532a7e4582a260e897276e2d36>:0)
Bolt.Entity.Detach () (at <91e633532a7e4582a260e897276e2d36>:0)
BoltInternal.BoltCore.DestroyForce (Bolt.Entity entity) (at <91e633532a7e4582a260e897276e2d36>:0)
BoltInternal.BoltCore.SceneLoadBegin (Bolt.SceneManagement.SceneLoadState state) (at <91e633532a7e4582a260e897276e2d36>:0)
Bolt.SceneManagement.BoltSceneLoader+<LoadAsync>d__9.MoveNext () (at <91e633532a7e4582a260e897276e2d36>:0)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <f56bb44ba853493d87ccc25c2e339f8a>:0)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
Bolt.SceneManagement.BoltSceneLoader:Update()

The entity being detached (3rd line from the top) is one that I just spawned from within SceneLoadLocalDone in a GlobalEventListener that is placed in the new scene.

Is this intended behavior or a bug? If intended, is there an alternative callback I could implement that would get called after the scene transition logic is done clearing non-persistent entities and it is safe to spawn new ones? Thanks for any help!

(I can work around this for now by marking all of my prefabs as persistent or else by delaying for ~1s before spawning these objects, but that feels gross. If I need to wait for the scene load to actually finish cleaning up these objects, I'd like to explicitly wait on that rather than an arbitrary delay that is probably long enough.)

Details, maybe relevant, maybe not:

I encounter this behavior running Bolt in SinglePlayer mode in the editor, which I'm mostly doing for workflow reasons. It doesn't seem to happen when I'm running as a dedicated server with two attached clients.

The GlobalEventListener in question is literally placed in the scene, not created via the BoltGlobalBehavior attribute (I needed to be able to have it reference some other specific scene objects). I wouldn't expect this to affect when in the loading process its callbacks are invoked, but you never know.

Is it possible for clients to load entities with scene instead of attaching them after load?

$
0
0
I want to have many enemies spawn into the world when the players spawn in. However, it can cause some lag spikes as all the entities are getting attached and loaded.

Is it possible to have an entity already in the scene, and then attach it after all players are done loading? Or is there maybe some better way to do it?

How to create the main menu according to the description given?

$
0
0
Hi, this is my first time on bolt, and I want to create a main menu scene as follows:
The scene has a canvas with 3 panels: p1, p2, p3(say). By default, p1 is open which has an input field to take in the username, and2 buttons, host and join. On clicking the host button, you are taken to p2, where there is text which shows the sessionID of the server created, and a text which should contain the list of all players connected so far. On the join button, you are taken to p3, where there is an input field to take in the sessionID of the server you wish to join, and a connect button which takes you to p2. Finally, p2 has a start button active only for the host, which should finally load the gameplay scene, which is a turn-based board game. Can Someone step by step guide me through this?

Achieve Automatic Scoping in Manual Scoping mode

$
0
0
I swapped to manual scoping because I needed minute control over the entities in my room and who could see them and interact with them.

However, I am struggling to find a solid way to get the automatic scoping behavior that existed before with my player characters.
I have found the SetScopeAll function, but that still doesn't help if someone new joins.
I have found that the Connected(BoltConnection connection) callback is not called on Clients more than one time for when they connect to the server.

I don't know how a Client is even aware of other clients. They can't detect , as far as I can tell and at least with built in Bolt functionality, when another client joins the room.

Do I need to program my server to handle this? I guess I was under the assumption that automatic mode works perfectly out of the box that I could recreate that functionality in manual mode without needing to stream bytes to connections to let them know new people are in.

Any pointers, examples, and help would be appreciated!
Thank you!

- Serling Long!

PhotonSession Missing

$
0
0
Hey all!

I am trying to setup custom session properties and access them when I receive the updated sessions to filter my data, however it seems like I need to cast the UdpSessions I receive as PhotonSessions. My issue is that I can't seem to find this class.
In the tutorials it seems like it should be found under Bolt.Matchmaking, but I can't find it there (https://doc.photonengine.com/en-us/bolt/current/lobby-and-matchmaking/bolt-matchmaking, see "Getting the Current Session").
Even in the official documentation, PhotonSession cannot be found under Bolt.Matchmaking (https://doc-api.photonengine.com/en/bolt/current/namespace_bolt_1_1_matchmaking.html).

Browsing through the docs has not helped me find this class. Neither has google searches.
I feel like it's in a simple spot, just can't find it.
Or there might be different way to get that data now. I simply don't know.

Any help would be amazing!

Thank you!

- Sterling Long!

State replication issues with VR.

$
0
0
Hi I'm a Bolt newbie but have been working on this problem for a while and need some pointers.

I'm working on an online VR game in Unity and trying to implement syncing of the hands and head. I've gone through a few ideas but for some reason, the server isn't replicating the client's movement. I would like some help with figuring out what I'm doing wrong with the state replication.

I am using VRTK 3 so each player has multiple input avatars that VRTK chooses from to load. I have a system working where I let the client load the avatar and once it finishes it tells the server which one was loaded and the server manually activates the hands and head and attaches the avatar models that should be shown to the other clients.

I have a Bolt state asset with transforms for the player position, head, and two hands. The client uses setTransforms when the input avatar is loaded and the server does the same when it loads its avatar. VRTK gives you references to the loaded hands and head objects so I know the client and server are setting the same transforms for replicating. When I run it the server has the avatar loaded but the components aren't following their counterparts on the client at all. The server avatar is all stuck at (0,0,0). I've tested with multiple clients and the avatar is visible but it's stuck at the same position.

fL8LVgG.png
This is how my state is set up.

using System.Linq;
using VRTK;
using static VRTK.VRTK_SDKManager;
using UnityEngine;
using Bolt;

public class VRPlayerBehaviour : EntityEventListener<IVRPlayer>
{
    private VRTK_SDKManager _vrManager;

    private bool _isSetupLoaded = false;

    public override void Attached()
    {
        BoltConsole.Write(entity.name + " attached.", Color.green);
        BoltConsole.Write("Controller = " + entity.IsControlled, Color.green);
        BoltConsole.Write("Owner = " + entity.IsOwner, Color.green);

        _vrManager = GetComponent<VRTK_SDKManager>();
        _vrManager.LoadedSetupChanged += SetupVR;

        if (BoltNetwork.IsClient && entity.IsControlled)
        {
            _vrManager.TryLoadSDKSetupFromList();
        }
    }

    private void SetupVR(VRTK_SDKManager sender, LoadedSetupChangeEventArgs e)
    {
        int setupIndex = sender.setups.ToList().FindIndex(x => { return sender.loadedSetup.name == x.name; });
        
        state.SetTransforms(state.PlayerTransform, sender.loadedSetup.actualBoundaries.transform);
        state.SetTransforms(state.HeadTransform, sender.loadedSetup.actualHeadset.transform);
        state.SetTransforms(state.LeftHandTransform, sender.loadedSetup.actualLeftController.transform);
        state.SetTransforms(state.RightHandTransform, sender.loadedSetup.actualRightController.transform);

        sender.loadedSetup.GetComponentsInChildren<VRAvatarSwitcher>().ToList().ForEach(x => { x.SetModel(false); });

        BoltConsole.Write("VR setup has changed to " + setupIndex, Color.green);
        _isSetupLoaded = true;

        VRSetupNotify vrSetupEvent = VRSetupNotify.Create(entity);
        vrSetupEvent.SetupID = setupIndex;
        vrSetupEvent.Send();
    }

    public override void OnEvent(VRSetupNotify evnt)
    {
        if (BoltNetwork.IsServer || !entity.IsControlled)
        {
            // load setup manually
            VRTK_SDKSetup clientSetup = _vrManager.setups[evnt.SetupID];

            _vrManager.enabled = false;
            clientSetup.gameObject.SetActive(true);
            clientSetup.actualHeadset.SetActive(true);
            clientSetup.actualLeftController.SetActive(true);
            clientSetup.actualRightController.SetActive(true);

            clientSetup.GetComponentsInChildren<VRAvatarSwitcher>().ToList().ForEach(x => { x.SetModel(true); });

            state.SetupID = evnt.SetupID;
            state.SetTransforms(state.PlayerTransform, clientSetup.actualBoundaries.transform);

            state.SetTransforms(state.HeadTransform, clientSetup.actualHeadset.transform);
            state.SetTransforms(state.LeftHandTransform, clientSetup.actualLeftController.transform);
            state.SetTransforms(state.RightHandTransform, clientSetup.actualRightController.transform);

            _isSetupLoaded = true;

            BoltConsole.Write("Loaded vr setup from client.", Color.green); 
        }
    }
}
Here is the EntityListener script.

The client calls SetupVR when the setup is loaded. It then sends an event to the server. The server calls OnEvent when it receives the event.

Is there anything obvious I missed or debug steps I could take? I'm sorta scratching my head cause it's set up the same as I did in the basic tutorial and the only thing I changed was the state transforms replication mode to "everyone except controller."

I have a bonus question too. Another idea I tried was to have a separate avatar from the input avatars. I wanted to have the input avatars transform positions be transferred to the server's avatar transforms somehow. I'm not sure how viable this is though. Would I have to use commands?
Viewing all 1054 articles
Browse latest View live