M4dM4tt's Forum Posts

  • 15 posts
  • Changing RoomName and GameName fixed it. Seemingly someone else can be in the same room with their own game or something. So they became my host..?

  • that's how the log looks on first browser window.

    also there seems to be 2 peers connected (should be only 1 as to my understanding?)

    and there's a peer joining with weird cyrillic letters as username.

  • Hey everyone

    I was working on a multiplayer game for the past week.

    Yesterday evening all was fine, but when i wanted to continue today, i realised that the first client opening the game does no longer become the host as usual.

    I asked myself if i messed up something and re-opened the original realtime multiplayer shooter file (which i used as template). Same happens when i launch that project.

    Went one level down and opened the chat tutorial. This one works. I become the host when i launch the project.

    What happened since midnight??? What is the difference? The signalling/log in code in chat tutorial, rt-shooter and my own project look identical to me.

    Anybody has any clue?

    I also can't figure out a way to FORCE myself to be the host. If i understand correctly the first who enters the game should be the host and there's no way around?

  • it DID work as expected. sorry. i mucked it up myself. (as in most cases)

    i'll try to add the second "else if...or..." block and report back.

    sorry again

  • My sample CAPX on the first page does this already.

    in my case i have to mix "else if...and...and" and "else if...or...or..."

    for now it's:

    for each:

    if

    or

    or

    else if

    else if

    else

    and works.

    when i try to apply your method onto that it doesnt work anymore.

    and even if it would work i would have to add another "else if...or...or..." to implement the new feature

    understandable enough?

  • I read again your doubt and logic to try to help you.

    Is your idea:

    - If condition is A or B or C Then Do Logic

    - Else if condition is X or Y or Z Then Do Other Logic

    - But else if condition is 1 or 2 or 3 Then Do A Barrel Roll

    Am I right?

    that is EXACTLY my problem at the moment.

    can you explain or show a screenshot of what it has to look like please?

    thank you very much!

  • cheers to Mrcoldmu and jose 901105!

    works ike a charm!

  • Problem Description

    in a multiplayer game, where one browser is host only and other browsers or browser tabs connect as players, when the playerobject is associated to the peer on the host, and that player object gets destroyed by the host (through destroy command directly or over health=0=destroy) it takes several seconds for the client to also destroy the object. if you disable said association the destroy command happens instantly on host and client.

    Attach a Capx

    see attachment

    Description of Capx

    the wreck chassis helps out as a base where the player(smoke, use "up arrow" for moving to the right) should respawn instantly after he gets killed by pressing "k" on the host browser. disable the associate blacksmoketopdown with multiplayer.peerid on the host side of the code and the bug is gone. but not associating makes multiplayer impossible right?...

    Steps to Reproduce Bug

    • Step 1: see "what the capx does"
    • Step 2
    • Step 3 etc.

    Observed Result

    few seconds delay to destroy player(smoke) on client if "k" is pressed on host and player is associated with multiplayer.peerid on host

    Expected Result

    player (smoke) gets deleted instantly on client and host on pressing "k" on host

    Affected Browsers

    • Chrome: YES
    • FireFox: YES
    • Opera: YES Operating System and Service Pack Win7 64bit SP1 Construct 2 Version ID Release173 64bit
  • hello anyone?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • oh! well thank you it's good to know that! even though i wonder what the subfolders in project folder are for if the images are stored in the capx?

    i finally figured out the problem. seems to be not my fault but merely a bug in construct or a necessity i dont understand.

    the delay on destroying objects on the client is depending on the "associate with multiplayer.peerid".

    -if you do that (which you have to if you go for multiplayer), you get that delay which sucks hell.

    -if you don't there's no delay but also no multiplayer.

    i'd really like to hear a statement from ashley or someone also that knows whats going on.

    check out the capx in the attachment and try enabling/disabling the associate actions on event sheet1.

    tnx for the help and little hints anyway unnatural!

    edit!: i forgot! use the UP arrow to accelerate the smoke then switch to the host window (2 browsers needed!) and press K the destroy it.

    you will see that on the client window the smoke lives much longer

    edit2!: just found out that what makes it delaying is the association on the player object on the host side.

    the other 3 object associations dont matter.

  • just from what i've seen on the forum so far when looking up something, i never saw someone putting such a huge capx up.

    and i'm not understanding how you would see my content anyhow qith no images.

    but maybe i'm just getting something wrong on how to upload it anyway...?

    would i have to put my project somewhere? you know like dropbox or something? i think of all the content in it. just a capx doesnt contain any sprites right?

    I was stripping my project down over the last two hours kickin everything out that was not related to my problem.

    Now at least i figured out the problem with the wrecks not appearing.

    it had to do with the scaling of the created wrecks.

    you see the working solution in the attachment.

    before that i directly scaled the wrecks. and then every tick set the scaling again to Self.S which was of course "0" so the wrecks became invisible.

    stupid error.

    gonna try to figure out the problem with the tank not destroying properly now.

    you see the code for that as well on the attachment.

    any ideas still welcome!

    and thanks so far because you got me to strip down the project, which helped me solve the first problem .

  • smassa: sounds he said.

    but i'm afraid i can't help with that topic, since i don't know either.

  • well as i feared, it happened. it works half the way 5 out of 20 times.

    but even then the tank is almost out of the crater and it still takes the same time for the respawn button to appear, the tank to disappear and the wreck is still just created as the player respawns.

    the only beneft so far is knowing that disable car actually exists and that the tank sometimes at least stops.

    but i figure i've gotta go for some screenshots or a replica(which is gonna be very hard because there are soo many objects synced and depending on each other already.)

  • now all i can say is... am i really that blind that i didnt see the "disable"? cause i was looking for it. because it made sense.

    still... if set car max speed to 0 and stop car didnt work i dont have much hope for disable...

    but i will try .

    thank you!

  • Hey dear constructers!,

    i'm working on an topdown tank shooter/mining game.

    now, when a player dies, i want to just have the tank stopped, create a crater and wreck, and display a respawn button which, once clicked starts the respawn countdown. after the countdown reaches zero the player is respawned at his base.

    what happens:

    when i have no timer it all goes fine, BUT!, it seems that the player isn't actually destroyed but just moved across the map (which results in him being stuck if there's a mountain on the way) except from that all is fine. the player and all of its parts are destroyed instantly on server an clients the crater and wrecks are built instantly as well.

    as soon as i have the respawn button in it (or a wait x seconds action), the player doesnt disappear instantly. merely it's car behaviour, rolls him out of the crater and is still steerable. it then takes about 1.5 seconds for the servers destroy signal to take action. after that the respawn button appears, the player disappears and spawning works fine. the wreck though is built just at the time the player respawns and not the moment he dies or the moment his visuals disappear.

    oh yeah, on the server everythings fine! this just happens on the client!

    does anyone know about such issues? are objects somehow kept alive for a short time to save the engine from unnecessary destroy/spawn actions?

    what can be done about it?

    for the moment i don't have a simple capx to post, but i no one has a fast idea on what might be going on i might be forced to replicate it, or at least cut some screenshots of the actions together.

    thank you all for taking the time,

    Matt

  • 15 posts