Methuselah's Forum Posts

  • Just a suggestion. I currently have a problem where the service worker is great to give HTML5 games offline support, but trying to update a game causes all kinds of headaches when the SW doesn't want to give up its old files. I like the version numbers and the fact that you can auto-increment them, but to get around some of the service workers when you try to update a game, it would behoove us to change some of the actual file names and where index.html is pointing with the version number itself. That way the service worker would know there is an update and request the new files. Just thought I'd share a thought. Thanks! Ashley

  • igortyhon I appreciate your help but I'm looking to deliver actual forces/impulses to the arms/legs so as to move stuff around them/deliver blows rather than just move them via IK.

    R0J0hound That is definitely helpful! I'm currently using limited revolute joints and applying torques to much the same effect, just a torque "out" if a button is down and a torque "in" if it's not. What I'd really like, though, is to be able to have an arbitrary array of bones and joints that can connect and then flex and straighten independently without needing to track individual bones. I.e., I am coming to like applying torques to the joints, but I'd like to just have them in some hypothetical "tree" layout and then be able to torque them to their parent bones on their own. A bit like when AI trains to create a jumping or running on-screen robot, a little like the old videos like this (except without AI). Is this just a matter of deciding one bone is the grandparent and then iterating downwards through the bones to set some kind of joints between them all?

    For context, I'd like for the player to assemble a bone structure in a grid, and then it connects the bones with joints automatically and allows for some of them to be flexed and straightened by the player in an understandable way (probably just which ones are at right angles). Any thoughts on not relying on one bone to be the "upper arm" and one to be the "lower arm," but allowing a strange configuration?

  • I'm trying to build a "realistic" human arm for a dumb game idea and I can't figure out how to do it in an elegant manner. The idea would be two arm bones, connected to each other with a revolute joint, with a muscle in the middle attached to both bones. This muscle could then expand and contract to drive the bones and either "flex" the arm or straighten it. I've tried a lot of different joints to no avail. There's a good chance I could get something hacked together if I just tell the arm bones to torque in different directions but there's nothing bringing the bones back to a neutral position, which is what I want. Essentially:

    • Press nothing, have the bones be at a right angle to each other
    • Press button A, have the bones straighten out and become almost parallel
    • Press button B, have the bones pull in and be at a very acute angle to each other

    If anyone has any ideas, please let me know. I hope it's more elegant than what I think the answer is, which is constantly applying variable torque to each arm to force a neutral angle and it turns into a PID controller. If it could be not that, I would be grateful. Thanks!

    Tagged:

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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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!

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