Assertion Failure

0 favourites
  • 14 posts
From the Asset Store
A pack of 250 robotic sounds, including glitches, movement, devices, interfaces, charges, failures, launches, and more.
  • I'm posting here because I'm not sure if this is a bug, and I'm using the latest stable version of C2.

    I'm working with Multiplayer, when the player mask and sprite are created on the host side, its fine obviously, but when created on the peers side by syncing them, it returns this error:

    "Assertion Failure: Creating World Instance Without Specifying Layer"

    The layer I'm creating them on is set to 0, so I'm not sure where this layer issue is coming from.

    Running the multiplayer example to check and see if this happens there too...

    Okay, I don't think it's a bug. So, here's what I just made:

    And this is what is connecting the player to the signalling server:

    Aside from that the only multiplayer logic I have so far is joining a room. Any idea what's causing this?

    Ashley, I honestly hate bothering you, but I'm considering this might actually be a bug.

  • You should post your complete capx to let other people see if they encounter the same issue.

    As it stands, it is too difficult to investigate and any theory would just be a shot in the dark.

    The message means that you have some kind of object on the peer side that is a world instance (so it's not your mask and player sprite, but rather something like a Function object) that is attempted to be created like on the host side and is attempted to be created in a layer that exists on the host's and not on the peer's side.

    Before telling if this is a C2 bug or not, first your project needs to be correctly investigated and posted for others to reproduce the error.

  • There's really nothing to be done without a .capx and the full details that a bug report would require. I can't debug screenshots.

  • Sounds good, I'll upload the Capx as soon as I can.

  • Okay, here it is: http://www.mediafire.com/download/2gbkg ... 9/bsh.capx

    In order to test it you'll need to start the preview through the multiplayer lobby, and create a match by pressing the button with a plus sign. When the host creates a match you can join it by pressing join. When a player joins the match they enter the Training layout, which is where the error is happening.

    Thanks in advance <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

  • Kyatric Well, I thought I had figured it out, but nothing I can do aside from not syncing the player mask can fix my problem.

  • The message means that you have some kind of object on the peer side that is a world instance (so it's not your mask and player sprite, but rather something like a Function object) that is attempted to be created like on the host side and is attempted to be created in a layer that exists on the host's and not on the peer's side.

    I don't believe the Function object is being synced.. Is it possible for it to conflict with something else?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Quick fix for now, add 5 layers to the "MAP_TRAINING" layout.

    As mentioned earlier, it is missing the correct amount of layers to correctly create the instance as it exists in the "MAP_AREAF_0" layout which is the one used by the host.

    Still not sure I'd consider that a C2 bug, more of an oversight on your part I'd say, this kind of JS error pops up "often" when dealing with non-existing layers.

    Let's see if Ashley thinks he may clarify the message, or give a more accurate explanation.

  • Please report this to the bugs forum following all the guidelines and with the .capx, I will miss it if you leave this here.

  • Kyatric, All layouts that the objects will be synced on need to have the same layers? Not a problem, but kinda weird. Thanks for the help! Fixed my problem!

    Ashley, I'll post a bug report tonight.

  • Kyatric, All layouts that the objects will be synced on need to have the same layers? Not a problem, but kinda weird. Thanks for the help! Fixed my problem!

    Well, I'm not sure how this is weird. It makes perfect sense to me.

    Consider a main layout on which you have an object standing in the layer n°5.

    Now take another layout that is supposed to display the object by syncing, but the layout contains only a single layer. How is Construct supposed to sync an object existing on a missing layer in the current layout ?

    It is the same for a global layer. You ARE to have the same name/number for the layer in a consistent manner over all your layouts, even if the layer is empty/contains nothing. It has to be there in order to be accessed/used.

    It makes sense to me that in the case of syncing (creating the same instances as in a different layout) that the same behavior/constraints applies.

  • Kyatric, So, does this mean that objects that are told to sync, although not in the current layout, would sync anyways? I guess I didn't think of it this way, I kind of just assumed that it'd sync the objects that exist within the current layout. But the objects exist within other layouts, so they must all be constructed the same way.

    Makes sense though, I just have to keep that in mind.

    Then, considering this it's obviously not a bug.

    Again, I apologize. I haven't used Multiplayer in Construct 2 much, so I wasn't aware of this.

  • As far as I can tell, this has nothing to do with multiplayer specifically.

    As mentioned, global layer works the same way.

    A global layer is set in a specific layout, contains instances, but for it to work in a consistent manner over the whole project, you need to have the same number of layers (or at least the same layer number) over all the layouts of the project or the instances won't appear/be created in the "non-original" layouts.

    In your project, on the host side you are displaying a specific layout (MAP_AREAF_0) which has 6 layers.

    But when having a peer joining the host, the peer is displaying a different layout (MAP_TRAINING) that originally only has 2 layers.

    The peer layout DOES not have the appropriate layer to spawn/sync an instance on.

    From your host, you ask your peer to create instances in a layer that does not exists. Hence the error your encountered.

    Syncing is just there to transmit infos from an instance to another from a computer to another. But if the instance does not logically exists, it cannot be synced.

    And for it to exist, it requires the same number of layers.

    Nevertheless, you still need to make a proper report as asked by Ashley.

  • Kyatric, Sorry I didn't read this until just now, I'll make the report, then.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)