R0J0hound's Recent Forum Activity

  • Nothing looks amiss. You use the mouse movement to change the angles. You clamp the up and down angle a bit, it then gets a direction vector from the two angles and uses that for a look at.

    The video doesn’t show much. Do you get the runaway too or just some users?

    If it only happens on some machines then it’s an issue with the mouse movement values perhaps? Hard to debug if you don’t get the issue too.

    I guess you could make a test to log or graph the movement values along with the time. Then maybe nail down down what movements cause the runaway, and record that on both machines and see if there’s anything drastically different between the two.

    Overall if it’s a browser bug with the mouse movement callback then I’m not sure how to correct it. Maybe there’s some creative way to deal with it.

    Nothing else looks amiss otherwise.

  • Don’t use dt and it won’t be.

  • Here's something that you can have that user paste into the browser console. It checks to see if webgl2 and webgl is available and if two extensions are available.

    console.log(document.createElement("canvas").getContext("webgl2")?"webgl2 available":"webgl2 not available");
    gl = document.createElement("canvas").getContext("webgl");
    console.log(gl?"webgl available":"webgl not available")
    if(gl){console.log(gl.getExtension("OES_standard_derivatives")?"pass":"fail");
    console.log(gl.getExtension("EXT_shader_texture_lod")?"pass":"fail");}

    Mine gives this:

    webgl2 available
    webgl available
    pass
    pass

    But overall if webgl2 is available, or webgl and those two extensions are available, then it should work I imagine.

  • Is that error on your machine or someone else's?

    It looks like on that machine and browser it implements webgl with D3d, and fails when compiling a shader with the tex2Dgrad function. In vanilla Construct the only bundled shader that uses that is the TileRandomization feature for tilemaps which was added in B321. However there appears to be fallbacks in place when using webgl1 and the OES_standard_derivatives extension isn't available.

    Do you use any third party effects? If no, then I imagine a minimal c3p would be one with a tilemap in case that effect isn't automatically added otherwise.

    Best case it's just a slight mistake in checking if that extension is available with webgl1. But considering the error occurred at the D3D level and not the webgl level it may be a browser bug or outdated D3d version. I guess this is a fitting point to ask the browser and version, and what operating system.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If they are at the same zelevation the normal 2d overlapping conditions work well. If you compare the zelevation too it’s possible to check for collisions on that axis too.

    Another way is to compare the distance with sqrt((x0-x1)^2+(y0-y1)^2+(z0-z1)^2) <32 which would treat the objects as spheres.

    There are more complex methods, but for now it’s best to skim other posts or examples for working implementations.

  • Well I’m not familiar with those examples and i don’t have access to a mouse so I can’t test for myself.

    Does the issue you’re encountering happen in those examples or just in your game?

    If it’s just happening in yours then somehow you’re not doing it the same. You’ll need to double check to look for any differences.

    If it happens in the examples too then I guess it’s flawed somehow? No idea where. You only posted a partial of how the camera is rotated from moving the mouse.

  • Easiest would be to just manually come up with a list of equations. Make enough and it should work.

    Other ideas could be to randomly gen two numbers and an operator repeatedly. It’s kind of shooting in the dark idea. You’d keep trying combinations till you get a result close enough. You’d probably want to discard any results that aren’t integers too.

    To make it work faster you could take the result and change it by a small amount, generate one number and use some algebra to calculate the other.

    Another idea is to make a big list of all numbers in a range combined together with each operator. We’d throw out all the non integer results and then sort the whole list by the result. Then to use you’d pick a random one from the list then jump a random amount away to another index for the other equations.

    Anyways just some random ideas. No pun intended. Maybe some of it could give you a possible approach to try.

  • Give it a try. Engines help you out in a lot of ways, and each engine is a bit different. Construct has a lot of useful features and the editor saves a lot of time. Knowing JavaScript is really a small portion of it. Construct has a certain JavaScript api to interact with the engine, and if you used another library it would have a different one. Or you could even make your own engine directly working with the web apis, but having it work the same across different browsers becomes something to handle.

    Anyways, it’s always a good exercise to try. You’ll learn a lot even if it doesn’t work out. You’ll learn how to to use different libraries, how to do some things that construct handled for you and give an appreciation of some complex things that construct does that aren’t simple to do on your own. But overall it’s all good. I don’t think it’s likely to be faster, especially at first. Overall you’re trading issues you have to deal with in construct with different ones. Although many may be the same.

  • Using mesh distort you can make a collision shape that approximates any image.

    construct.net/en/forum/construct-3/how-do-i-8/manipulate-mesh-points-175978

    It was a preliminary example. It uses the first shape found.

  • I'm probably missing the mark about what you're after again. But this has an object move with a force applied to an object (I went with a gravity based force). The predicted path is found by just doing multiple steps.

    This just does the physics manually so we don't have to simulate what the physics behavior does and deal with the value differences. It uses a fixed timestep to avoid the inconsistencies of a variable timestep since the acceleration is continuously changing.

    dropbox.com/scl/fi/3zw8r9yo86oh0xpef5akl/perdict_path.capx

    Maybe it could be useful for some ideas.

  • You could try something like this. Speed would be updated per second. You’d just tune the 100 to a speed you’d like. The lerp is to make the change more gradual.

    Global number presses=0
    Global number speed=0
    On key pressed
    — add 1 to presses
    
    Every 1 second
    — set speed to lerp(speed, 100*presses, 0.5)
    — set presses to 0

    Another idea that’s more continuous could be to have an array of say width 60 and

    Global number presses=0
    Global number speed=0
    
    Start of layout
    — array: set size to 60,1,1
    
    Every tick
    — array: set at ticks%60 to 0
    — set presses to 0
    
    Key is down
    Trigger once
    — array: set at ticks%60 to 1
    
    Repeat 60 times
    — add array.at(loopindex) to presses
    
    Every tick
    — set speed to 100*presses
  • When you use a density of 0 it probably just sets it to 1. Otherwise there would be divides by 0.

    Anyways look at the 2nd capx to see the conversion factors between what the behavior uses and calculating it manually.

    You asked about velocity? It’s the same either way. Pixels per second.

    Box2d uses meters for the distance unit internally not pixels so it’s typically scaled. So likely they picked 50 pixels = 1 meter in the behavior. The behavior tries to convert the values to be in pixel units but misses the mark with the conversion for anything but velocity. A fix would be simple but would break all existing projects with physics.

    Anyways units aside I’ll mess with it later.