Adavo's Recent Forum Activity

  • Thanks oosyrag for your answer.

    I have already read multiple times the tutorial that you have linked to me.

    By using scale inner, and some special layout for iPad, I thought that it will be ok but it appear that on iPad Air it's not the case : it just simply does not scale and let white image on the right.

    I have tried to use scale outer tonight. The issue is that by picking a 1440x1080 resolution, I really need to extend a lot the background in order to avoid white on the right part of the screen. But this come with an important cost : as you can see (or not), my game relies on finding object on a background. That's the reason why it's very important for my game to have more or less the same "background" view so the object position is coherent (a boat on the sea, not on the air). That's also why I had decided first to use scale inner and avoid putting object in the corner. And to handle 4:3 ratio (more on tablet), made specific layout for this ratio, but *sigh* is not "scaling" correctly on that one...

    How would you proceed in my kind of game ?

  • Hello,

    I make a game and would like to fit to the screen, on mobile and tablet. Here is my settings :

    • My default resolution is 16:9 (1920x1080)
    • My viewport fit is "cover"
    • My fullscreen mode is "scale inner"

    After making some adjustment on game objects in order to avoid them to be on the edges, it looks good on mobile.

    Then I tried the app on my iPad 8 which doesn't look good since the ratio is not really the same (4:3). That's the reason why I have decided to make specific "layout" for the iPad version, focusing on the ratio 4:3 (1440x1080).

    Unfortunately, while testing the game on an iPad Air 4, I have noticed white background as the ratio is 4:3 but the resolution is bigger (2360 x 1640).

    So... after reading the documentation about the screen size, I really don't understand why on iPad Air 4 the 4:3 layout is not good. I thought that ratio is more important than resolution, but it seems that it's not true. It's becoming very complicated to handle all the screen resolution on both tablet and mobile, and start to loosing more time that I though (technically speaking, in web design, I don't have so much trouble with lot of different screen resolution...).

    Thanks for your help.

  • Thanks lionz,

    It's still a bit strange for me since I thought that "stars" will pick every instance of stars to animate them.

    I am glad that on my specific case, it's working as expected.

  • 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...

Adavo's avatar

Adavo

Member since 27 Aug, 2020

None one is following Adavo yet!

Trophy Case

  • 4-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

6/44
How to earn trophies