Adavo's Forum Posts

  • Hello,

    I have 2 objects (sprite) "star" and "star1" that belongs to the family "stars".

    The family "stars" has a Sine behavior.

    The issue is that when I create a new "star" and "star1" object, and wants to apply the sine behavior to the family "stars", the behavior is not activated.

    The first sine activation is working, but as soon as I delete all stars objects, create a new star/star1 objects, and try to activate the behavior again, nothing happen.

    Thanks for your help

    Tagged:

  • Thanks

    I have an another issue but I will post it on a new post

  • Hello,

    On my game, I have made a family containing sprite and would like to animate them using Sine Behavior. That's why I have added the Sine Behavior to my family.

    The issue is that everytime I create a sprite of this family, it's the default Sine behavior that is applied.

    Here is the sine behavior on my star property that exist on the layout

    ibb.co/hyXHGfn

    Here is my code that remove all the stars, recreate the stars corresponding to the current mistake of the player, and activate the sine behavior.

    ibb.co/FDfDR7f

    The issue is that is the default sine behavior properties that is applied, not the one of the previous created object...

    Any ideas ?

    Thanks

    Tagged:

  • I have spent few hours to recreate a game and fortunately (or not) I can't reproduce this specific issue.

    However I encountered an issue that could (or not) be linked and that I can reproduce also in my game.

    If both the host and the peer connect to the game, everything is fine.

    If the host connect to the game, start the map, and then a peer launch the game, connect it, seems it can't move his character.

    Here is my project sample easyupload.io/eak5u4

    The steps to reproduce the issue :

    1. Open the project and remote preview it
    2. On a browser, go to the remote debug and clic on the Start game button
    3. When the host is connected to the game and can move the red square (this is very important to wait the host is on the game before doing the following), open a private browser and go to the game again to simulate a peer
    4. Click on Declare as ready button for the peer, you should be moved to the game map
    5. Host can move freely and are sync with peer, but peer cannot move
  • It's not a bug.

    You also don't need object uid or alias or anything.

    If you have a list of peerids, then you simply create a object for each of them. Set the instance variable to each peer id in order, and sync it.

    Hey oosyrag,

    Regarding the bug status, I am not that sure but that's my own opinion. OnPeerConnected or OnPeerMessage from my point of view should set the peerId to the context, so no matter you create a character in both of this event, you should have the right and proper peerId.

    For instance, on the multiplayer sample from Construct's team (hope that attaching multiple screen will works...) :

    So why it's not the case when I have this on my side ?

    The only difference is that PeerId seems not correctly "transmitted" to the CharacterCreation in case we receive a peerMessage. And what is so strange, is that my code sometimes works, sometimes don't. It's not clear when exactly peerId is set which is not convenient, maybe you can tell me more about that.

    Regarding your suggestions, unfotunately, is it not possible. On host side, everything is fine. Peer/host seems associated.

    The issue is located on peer side. As soon as the character is created on server side, since it's "sync", it is also created on peer side. However, seems that this is the only things that happen, any variable on character is not sync on the peer side. In order to be sync, the peer side need to associate the newly created character object to a peerId, which cannot be found in any way.

  • you can also use this instead of using the sync action for more flexibility drive.google.com/file/d/1FmEtzZJt_18EVaAoL5sBFS6h69xCr1OD/view

    Thanks eleanorjmorel, that require lot of rework I suppose and I seriously doubt that the code will remains clear :-D. I could send player data periodically but is a bit sad to go back to code when you have a tool like Construct. I am thinking also at some other cheap workaround, such as moving everybody to an another room when map is loaded. Then I could end up using "on peer connected". If only if Multiplayer.PeerId could be correctly set when the root event come from On Peer Message, that would be awesome.

  • Without analyzing or testing this too closely, I think the problem you're having is that the Multiplayer.PeerID expression is supposed to work specifically in certain triggered conditions, like OnPeerConnected. When you use it like that outside the trigger, you won't get the right PeerID.

    Thanks oosyrag for your thought, I agree mainly that Multiplayer.PeerId have inconsistent behaviour when used outside the OnPeerConnected trigger. Sadly, it seems that OnPeerMessage does not "attached" the context to the created object - not sure if it can be considered as a bug or it's as designed.

    An approach I would try (but have not tested), would be to store the relevant peerIDs of each player in an array upon joining, and use that array to look up and assign/associate peerIDs to objects for each player when you want to create player objects.

    I have tried to build a JSON object of players with their aliases/objectUid/peerId. The issue is that the objectUid is the one from the host and unfortunately, game object have different objectUid on peer side which prevent me to associate the peerId to corresponding game object. When a player game object is created, only the X/Y/LAYER data are sync until the object is synchronised with the Associate method and none of this is enough to identify a user, except a dirty workaround based on X/Y coordinate but I am really scared about the side effect and prefer to not go on this way...

    Hey eleanorjmorel,

    While I totally agree with your message, you may need some context to better understand why I have for instance "connected to the signalling server". It's a "cheap" way to distinguish OFFLINE from ONLINE behavior on my event sheet. I could have used "Is inside a room" but anyway, I don't think the issue is linked to that specific things.

    As described in my post, I can't use the "on peer connected" event since the peer is already connected for a while. In many game, you don't directly jump to the game screen, you may stay in a waiting room layout until everybody is ready and then be moved from the room layout to the actual game layout. That's the reason why I have used message to inform peer to load a map, and to inform host that the peer has successfully loaded the map.

    I could attached a game sample to illustrate the issue but it require me to clean all my assets before. Moreover, the game sample will still have lot of code and may be complicated to debug without spending (lot of) times... not sure to get lot of answers anyway.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hello folks,

    I have the exact same (or very similar) issue as this person construct.net/en/forum/construct-2/how-do-i-18/multiplayer-peer-problem-112589.

    To go straight to the point, my peer join the room before the map and the player sprite is created. Here is the workflow :

    1. The host create a room
    2. A peer join the room
    3. The host pick the mission to start
    4. The host is teleported to the game map
    5. The host broadcast a message "loadMap"
    6. Every peer load the map and send a mapIsLoaded message to the host
    7. The host create at that point the player game object for the peer
    8. Every peer need to set the correct peerId and associate it with the created game object

    The issue is at the last step, the peer sometimes does not get the correct peerId and get host one. Indeed, depending on how things going on, the "Multiplayer.PeerID" can be the correct value or not.

    I have tried lot of things described in the linked post, and I have seriously no idea about what to try next. I thought that the object Uid could be the same, but unfortunately it is not the case. I have tried to sync the peerId value, but it's not working as well.

    Do you have any ideas/suggestions to solve this issue ?

    Thanks a lot for your help

    Tagged:

  • Here is an another link since filebin website have some issue managing .c3p.

    file.io/hhu6F52EvLDp

    Sorry also for the formatting of the message, it looks good on the textarea but miserable when displayed...

  • Dear Construct community,

    I am currently struggling on a multiplayer game.

    Here is the workflow:

    - A user login to the signalling server and to the room

    - the first user to join a room become a host

    - the host can pick a mission to start

    - the peer can declare them as "ready"

    - When a host start the mission, he and all the ready peer are teleported to the mission map

    - A peer can join a mission after the host has started a mission and he is teleported to the mission map as well

    If the peer connect to the room before the host pick the mission, everything is fine.

    If the peer connect after the host has picked a mission, its inputs is not sync over the network

    What is strange is :

    - messaging is working (indeed, peer ask the host "GetMap" and receive "SetMap" message).

    - Ping is OK

    - peerId on peer/server side is OK

    I have "cleaned" my project so I can share it with you.

    filebin.net/qq48484a5poqpji6

    To reproduce the nominal behavior :

    - Remote preview

    - Click on COOP

    - Click on CONNECT

    - Open a new window, and do the same process.

    - When host and peer are visible in the team member, you can either

    - with the host, click on "START MISSION" and pick your mission (click on the TEST purple square and on the MISSION 01 and finally into the "DEPLOY SQUAD" button)

    - with the peer, click on "READY"

    everything should be sync, OK.

    To reproduce the issue :

    - go through all the process as an host, and when the host is on the map, start the process of the peer. The peer appear to the map, the host is well sync on both but the peer is not sync at all.

    Thanks for your help.

    Tagged: