Methuselah's Forum Posts

  • Another thing you could try is a distance joint from the first link to the last to help it from not getting too long. This is a general box2d idea, not sure if that shakes out in construct.

    At first I tried changing all the revolute joints to distance joints but it became super stretchy and wacky and required a ton of experimentation, so I went back to all revolute joints. However, I took your advice and added one distance joint between the first and the last link and that helped tremendously! I have yet to get the rope stretching bug again after a bunch of attempts, knock on wood. It also makes the rope a lot more "snappy" and together than it was before and makes swinging a lot easier.

    Thank you for your help!

  • Or should I open a bug report about this?

  • I am making a rope swing/web swing game, think Indiana Jones or Spiderman. I'm using physics to create a rope (out of small rectangles that are chained together with revolute joints) when I click.

    When I'm swinging underneath platforms like you would expect Spiderman to do, everything is fine: the rope latches on to the platform and you swing in an arc underneath. However, when I connect my rope to a platform below the player character, there is a chance that it will just bug out and elongate forever, twitching and freaking out until I cancel it. Here is a video of what is going on:

    Subscribe to Construct videos now

    And here is the example project which is as bare-bones as I can get it:

    drive.google.com/file/d/1WCHxJhtm2usR0yjLsjDeNqAtwxreinag/view

    How can I make it so that the joints don't freak out? Any help with this would be appreciated. Thanks!

    Tagged:

  • You could always have an instance variable tick up. It would look like an instance variable called "timeSpentWalking" or something, and if the player is currently walking, then add 1 to that instance variable. This will add to the timeSpentWalking variable every tick. If the player is not currently walking (or running I guess), then reset the variable back to 0. Then you can compare the variable to some constant. In your example, if the character is walking for 2 seconds, then you just have to compare to 2 seconds worth of ticks (60ticks/second --> 120 ticks for 2 seconds). It might look like:

    If character Platform Is Moving, then Add 1 to timeSpentWalking

    If character X Platform Is Moving, then set timeSpentWalking to 0

    If character.timeSpentWalking = 120, then [whatever you want running to look like, including a different animation, or a Platform max speed increase, or new moves available, etc.]

    You might instead bind the first and second Ifs to whatever button you're using to walk/run, like:

    If Keyboard Is pressing Right, then Add 1 to timeSpentWalking

    If Keyboard X Is pressing Right, then set timeSpentWalking to 0

    Play with something like that to get a better result, like also adding not pressing left e.g. Hope that helps!

  • Any chance that there are more things that I can look at in the debugger for Multiplayer? Right now when I view the Multiplayer object in the debugger it just says it's on or not, but nothing like whether you're connected to the signalling server, if you've joined the room, any packet losses, etc.

  • In a normal playthrough, yes, the disconnect flow works as intended. It's just when this error occurs that attempting to disconnect fails.

  • As an update, it still happens in r285 stable.

    Although I'd like to fix this, I'd also like to offer players a way to get out of the game if this happens. Right now trying to disconnect from the multiplayer room doesn't work as it should, and the next steps in the process don't fire (doesn't disconnect from signalling server etc.). Is there a condition that I could include that would capture this scenario? If so I could give players a button to just completely disconnect entirely.

  • Here's a .c3p file that should help illustrate what's going on. Should be pretty simple.

    drive.google.com/file/d/121Gd9Txixt-Cw8cLMemnyYzNgxaUAYdU/view

    Thanks!

  • On further review, it looks like the peer is continuously trying to destroy something that isn't there? It says that I have -15,000 objects after leaving it be for a little while, and that number rises by around -250 every second:

    Whereas I have a steady number of objects for the host.

    Any ideas?

  • This is what things look like for the host and the peer:

    This is what the console is saying over and over:

    Thanks!

  • Try Construct 3

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

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

    I'm building a multiplayer game on C3 v276.2 stable, and I seem to be having a problem. Every so often, when an enemy object is destroyed by the host, a peer in the game is likely to freeze and receive the following error in console: runtime.js:62 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'GetInstances'). This error basically loops forever. I'm using the same basic code as in the real-time multiplayer tutorial example, has anyone had something like this happen to them? This happens over the internet and while simulating lag, but not on regular local testing. Any thoughts for how I can stop this from happening? Any help is appreciated. Thanks!

    Tagged:

  • Quick followup, I found what I was missing: I need to both leave the room AND disconnect from the signaling server. Then I can jump back in and start a new game! So the current flow that works is:

    On peer disconnected (for whatever reason) -> leave room

    On left room -> disconnect from signaling server

    On disconnect from signaling server -> go to layout "Login"

    At this point I can jump back in.

    Solved!

  • Thank you for your response. No matter what I try as the action, "leave room," Room "disconnect," or Signaling "disconnect," I still end up with the same thing. I do include the asynchronous "on Room/Signaling disconnected," but I still cannot create a new room as the old host of the previous room. Here are some pics:

    Host on the left, peer on the right

    The two play a game

    The peer disconnects/closes the game, which prompts host to disconnect OR leave room OR disconnect from room (I've tried all three), and upon completion of "on disconnected" for those, the host gets sent back to the login layout to ready another game

    The host is now stuck on either the "signaling logging in" step or the "signaling joining room" step (in this case, the "signaling logging in" step)

  • I'm having trouble allowing players to rejoin a game without closing out the game window entirely.

    What I'd like to happen: in a two-player game (like pong), if Player A leaves by clicking a back button or closing the game window, the game stops. Player B is informed that Player A disconnected, and then Player B is sent back to the login layout after disconnecting from the current room. Player B can then go back to the game layout through the login layout, becoming the host for a new game. Player C joins, and the two play as normal.

    This works well if Player A is the host and closes the game window: Player B can then basically make a new room as the host and play Player C.

    However, if Player A is the peer and leaves, the host can not create a new room. They get stuck on the "Joined Room" step. However, a Player C can join and create a new room just fine, and they'll be the new host of that room.

    Attached is an example of what's happening with just a slightly-modified pong example file: dropbox.com/s/icaz3edmv56hrun/pong%20reconnect%20example.c3p

    To reproduce, open two preview windows, allow both "players" to connect and begin the game, and then close the peer window. The host will see that the peer has disconnected and then get sent back to the login layout after disconnecting from the signalling server. After trying to start a new game, the host will get stuck.

    Any ideas as to how to solve this? In theory I would want to have a system like for a chess game or something: you connect with an opponent, play until one of you wins, and then you both get kicked back to the login page to play again against different opponents. Any help is appreciated! Thanks!

    Tagged:

  • Hello, I was wondering if you guys could help me with a weird problem I'm having? I have a ton of minigames that are deployed in iframes as HTML5 games that I built in Construct. In many of them I'm having a problem with audio when played on iOS: any music that I have playing is extremely loud, loud enough that it seems to be ignoring the volume settings I made. Even if I set the volume to something very low, like -35dB, it sounds like it's boosted the audio as if the volume is set to 10dB or higher. Has anyone had a problem like this with iOS? The same games in the same settings on web or Android are not experiencing this problem; in fact, they're playing very softly since I turned their volume down to account for the iOS volume. Is there something that I can do about this to make sure that iOS uses the correct volume setting? Thank you for any help you can give!